grKnight commited on
Commit
6a7ef0b
·
verified ·
1 Parent(s): b42f862

docs: add AstraQ-VL paper citation

Browse files
Files changed (1) hide show
  1. README.md +139 -121
README.md CHANGED
@@ -1,45 +1,45 @@
1
- ---
2
- license: cc-by-sa-4.0
3
- base_model:
4
- - Qwen/Qwen2.5-1.5B-Instruct
5
- - openai/clip-vit-large-patch14
6
- datasets:
7
- - UniverseTBD/AstroLLaVA_convos
8
- language:
9
- - en
10
- pipeline_tag: image-text-to-text
11
  tags:
12
  - astraq-vl
13
  - vision-language-model
14
- - llava
15
- - astronomy
16
- - multimodal
17
- - image-captioning
18
- - connector
19
- ---
20
-
21
  # AstraQ-VL Stage-1 (connector alignment)
22
 
23
  AstraQ-VL Stage-1 is the public name for this connector-alignment checkpoint.
24
-
25
- A LLaVA-style vision–language connector that lets **Qwen2.5-1.5B-Instruct** describe astronomy
26
- images encoded by **CLIP ViT-L/14**. Only the connector (~3.9M params) is trained; both backbones
27
- stay frozen. This is the **Stage-1 feature-alignment** stage, trained for **3 epochs** on
28
- [`UniverseTBD/AstroLLaVA_convos`](https://huggingface.co/datasets/UniverseTBD/AstroLLaVA_convos)
29
- with a **disjoint held-out test split** so it can be evaluated on unseen images.
30
-
31
- > ⚠️ This repo ships the **connector checkpoint only** (`connector.safetensors`, ~16 MB). It is
32
- > **not** a standalone `transformers` model — it needs the custom VLM code from the
33
  > [astraq-vl](https://github.com/crimsonKn1ght/astraq-vl) repo plus the two base models
34
- > (auto-downloaded from the Hub) to run.
35
-
36
- ## Downloads (per-epoch bundles)
37
-
38
  Each bundle holds that epoch's checkpoint, its **held-out** predictions (`predictions_test_ep*.jsonl`),
39
  the training config, the `test.json` split, and a `REPRODUCE.md`:
40
 
41
  | Bundle | Checkpoint | |
42
- |--------|-----------|--|
43
  | [`astraq-vl-stage1-ep3.zip`](https://huggingface.co/grKnight/astraq-vl-stage1/blob/main/checkpoints/standard/astraq-vl-stage1-ep3.zip) | `checkpoint-3789` (epoch 3, final) | **recommended** |
44
  | [`astraq-vl-stage1-ep2.zip`](https://huggingface.co/grKnight/astraq-vl-stage1/blob/main/checkpoints/standard/astraq-vl-stage1-ep2.zip) | `checkpoint-2500` (≈ epoch 2) | |
45
  | [`astraq-vl-stage1-ep1.zip`](https://huggingface.co/grKnight/astraq-vl-stage1/blob/main/checkpoints/standard/astraq-vl-stage1-ep1.zip) | `checkpoint-1300` (≈ epoch 1) | |
@@ -57,98 +57,116 @@ The Phase 0 archives are the earlier caption-generation evaluation only; they do
57
  the held-out QA records. Each contains predictions for 591 held-out images, of which 586 have
58
  reference captions used for scoring. Use the full-heldout artifact for the combined caption + QA
59
  evaluation.
60
-
61
- > **Superseded files.** An earlier release (`*-legacy-1epoch-no-heldout-*`) was trained to ~1 epoch
62
- > only and evaluated on training images (no held-out split, so possible leakage). Kept for record;
63
- > use the `ep1`/`ep2`/`ep3` bundles above.
64
-
65
- ## Architecture
66
-
67
- ```
68
- image ─► CLIP ViT-L/14 (frozen) ─► MLP connector (TRAINED) ─► Qwen2.5-1.5B-Instruct (frozen) ─► text
69
- 1024 → 1536 → 1536
70
- ```
71
-
72
- - **Vision:** `openai/clip-vit-large-patch14`, penultimate layer patch features (frozen)
73
- - **Connector:** 2-layer MLP with GELU, 1024→1536→1536 (the only trained weights)
74
- - **LLM:** `Qwen/Qwen2.5-1.5B-Instruct` (frozen)
75
- - **Trainable / total:** 3,935,232 / 1,850,414,592 (0.21%)
76
-
77
- ## Training
78
-
79
- | | |
80
- |---|---|
81
- | Data | `UniverseTBD/AstroLLaVA_convos`, per-image held-out split: train 161,653 recs / 29,151 imgs, test 3,271 recs / 591 imgs (41 corrupt skipped) |
82
- | Image prep | long side ≤ 384 px, JPEG |
83
- | Objective | next-token cross-entropy on answer tokens only (connector-only) |
84
- | Epochs / steps | 3 epochs, 3,789 update steps |
85
- | Effective batch | 128 (per-device 8 × grad-accum 16) |
86
- | LR / schedule | 1e-3, cosine with 3% warmup |
87
- | Precision | bf16 (autocast) |
88
- | Max length | 512 (+256 image tokens) |
89
- | Hardware | 1× RTX 6000 Ada (48 GB), ~26 samples/s, ~38 GB VRAM |
90
- | Loss | ~2.08 → ~1.50 |
91
-
92
- `checkpoint-3789` (epoch 3) is the recommended checkpoint; `checkpoint-1300`/`-2500` are the
93
- epoch-1/epoch-2 points for comparison.
94
-
95
- ## Usage
96
-
97
- ```bash
98
- # 1. get the code
99
  git clone https://github.com/crimsonKn1ght/astraq-vl && cd astraq-vl
100
- pip install -r requirements.txt
101
-
102
- # 2. download + unzip the recommended bundle
103
  hf download grKnight/astraq-vl-stage1 checkpoints/standard/astraq-vl-stage1-ep3.zip --local-dir .
104
  unzip checkpoints/standard/astraq-vl-stage1-ep3.zip -d ckpt
105
-
106
- # 3. caption an image (CLIP + Qwen auto-download on first run)
107
- python inference.py \
108
  --config ckpt/pretrain_astrollava.yaml \
109
- --checkpoint ckpt/checkpoint-3789 \
110
- --image your_astro_image.jpg \
111
- --prompt "Describe this astronomical image." \
112
- --temperature 0
113
- ```
114
-
115
- The bundled `predictions_test_ep*.jsonl` hold the held-out outputs with their reference captions.
116
-
117
- ## Capabilities & limitations
118
-
119
- **What it does well** — it grounds on *coarse visual structure* (object class / morphology), and
120
- this **generalizes to held-out images**. On unseen test images, quality improved monotonically with
121
- training: epoch 1 misidentified objects, epoch 2 fixed the object *category*, and epoch 3 recovered
122
- *specific* objects — e.g. correctly naming **SN 1987A and its ring** and the **Dumbbell Nebula**, on
123
- images it never trained on. Because these are held-out, that's genuine generalization, not
124
- memorization.
125
-
126
- **What it doesn't** — it **hallucinates fine details** (exact catalog numbers, telescopes, dates,
127
- distances), filling specifics from the frozen LLM's prior rather than the pixels. This is the
128
  expected AstraQ-VL Stage-1 ceiling: the connector supplies a coarse visual category and the frozen LLM
129
- improvises the rest. For factual specificity, a **Stage-2 fine-tune** (unfreezing the LLM via LoRA
130
- on the QA pairs) is the fix — more Stage-1 epochs do not help. That model is now released at
131
- [`grKnight/astraq-vl-stage2`](https://huggingface.co/grKnight/astraq-vl-stage2).
132
-
133
- The held-out comparison above is a **qualitative spot check** on a few samples, not a full
134
- quantitative benchmark.
135
-
136
- ## Reproduction
137
-
138
- Each bundle includes a `REPRODUCE.md` pinning the exact code commit, base models, and package
139
- versions (`torch 2.8.0+cu128`, `transformers 5.12.1`). The split is seeded, so the build reproduces
140
- the exact train/test partition.
141
-
142
- ```
143
- build: python scripts/build_astrollava_trainset.py --include-qa --max-image-size 384 --test-fraction 0.02 --seed 42
144
- train: python train.py --config configs/pretrain_astraq_vl.yaml
145
- eval: python scripts/batch_inference.py --records-json datasets/astrollava_llava/test.json --num-samples 0 ...
146
- ```
147
-
148
- ## License & attribution
149
-
150
- - **Weights:** `cc-by-sa-4.0`, inherited from the training data.
151
- - **Training data:** [`UniverseTBD/AstroLLaVA_convos`](https://huggingface.co/datasets/UniverseTBD/AstroLLaVA_convos)
152
- (CC-BY-SA-4.0); imagery from NASA APOD, ESO, and NASA/ESA Hubble.
153
- - **Base models:** Qwen2.5-1.5B-Instruct (Apache-2.0), CLIP ViT-L/14 (OpenAI, MIT).
154
- - Built on the AstroLLaVA work ([arXiv:2504.08583](https://arxiv.org/abs/2504.08583)).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-sa-4.0
3
+ base_model:
4
+ - Qwen/Qwen2.5-1.5B-Instruct
5
+ - openai/clip-vit-large-patch14
6
+ datasets:
7
+ - UniverseTBD/AstroLLaVA_convos
8
+ language:
9
+ - en
10
+ pipeline_tag: image-text-to-text
11
  tags:
12
  - astraq-vl
13
  - vision-language-model
14
+ - llava
15
+ - astronomy
16
+ - multimodal
17
+ - image-captioning
18
+ - connector
19
+ ---
20
+
21
  # AstraQ-VL Stage-1 (connector alignment)
22
 
23
  AstraQ-VL Stage-1 is the public name for this connector-alignment checkpoint.
24
+
25
+ A LLaVA-style vision–language connector that lets **Qwen2.5-1.5B-Instruct** describe astronomy
26
+ images encoded by **CLIP ViT-L/14**. Only the connector (~3.9M params) is trained; both backbones
27
+ stay frozen. This is the **Stage-1 feature-alignment** stage, trained for **3 epochs** on
28
+ [`UniverseTBD/AstroLLaVA_convos`](https://huggingface.co/datasets/UniverseTBD/AstroLLaVA_convos)
29
+ with a **disjoint held-out test split** so it can be evaluated on unseen images.
30
+
31
+ > ⚠️ This repo ships the **connector checkpoint only** (`connector.safetensors`, ~16 MB). It is
32
+ > **not** a standalone `transformers` model — it needs the custom VLM code from the
33
  > [astraq-vl](https://github.com/crimsonKn1ght/astraq-vl) repo plus the two base models
34
+ > (auto-downloaded from the Hub) to run.
35
+
36
+ ## Downloads (per-epoch bundles)
37
+
38
  Each bundle holds that epoch's checkpoint, its **held-out** predictions (`predictions_test_ep*.jsonl`),
39
  the training config, the `test.json` split, and a `REPRODUCE.md`:
40
 
41
  | Bundle | Checkpoint | |
42
+ |--------|-----------|--|
43
  | [`astraq-vl-stage1-ep3.zip`](https://huggingface.co/grKnight/astraq-vl-stage1/blob/main/checkpoints/standard/astraq-vl-stage1-ep3.zip) | `checkpoint-3789` (epoch 3, final) | **recommended** |
44
  | [`astraq-vl-stage1-ep2.zip`](https://huggingface.co/grKnight/astraq-vl-stage1/blob/main/checkpoints/standard/astraq-vl-stage1-ep2.zip) | `checkpoint-2500` (≈ epoch 2) | |
45
  | [`astraq-vl-stage1-ep1.zip`](https://huggingface.co/grKnight/astraq-vl-stage1/blob/main/checkpoints/standard/astraq-vl-stage1-ep1.zip) | `checkpoint-1300` (≈ epoch 1) | |
 
57
  the held-out QA records. Each contains predictions for 591 held-out images, of which 586 have
58
  reference captions used for scoring. Use the full-heldout artifact for the combined caption + QA
59
  evaluation.
60
+
61
+ > **Superseded files.** An earlier release (`*-legacy-1epoch-no-heldout-*`) was trained to ~1 epoch
62
+ > only and evaluated on training images (no held-out split, so possible leakage). Kept for record;
63
+ > use the `ep1`/`ep2`/`ep3` bundles above.
64
+
65
+ ## Architecture
66
+
67
+ ```
68
+ image ─► CLIP ViT-L/14 (frozen) ─► MLP connector (TRAINED) ─► Qwen2.5-1.5B-Instruct (frozen) ─► text
69
+ 1024 → 1536 → 1536
70
+ ```
71
+
72
+ - **Vision:** `openai/clip-vit-large-patch14`, penultimate layer patch features (frozen)
73
+ - **Connector:** 2-layer MLP with GELU, 1024→1536→1536 (the only trained weights)
74
+ - **LLM:** `Qwen/Qwen2.5-1.5B-Instruct` (frozen)
75
+ - **Trainable / total:** 3,935,232 / 1,850,414,592 (0.21%)
76
+
77
+ ## Training
78
+
79
+ | | |
80
+ |---|---|
81
+ | Data | `UniverseTBD/AstroLLaVA_convos`, per-image held-out split: train 161,653 recs / 29,151 imgs, test 3,271 recs / 591 imgs (41 corrupt skipped) |
82
+ | Image prep | long side ≤ 384 px, JPEG |
83
+ | Objective | next-token cross-entropy on answer tokens only (connector-only) |
84
+ | Epochs / steps | 3 epochs, 3,789 update steps |
85
+ | Effective batch | 128 (per-device 8 × grad-accum 16) |
86
+ | LR / schedule | 1e-3, cosine with 3% warmup |
87
+ | Precision | bf16 (autocast) |
88
+ | Max length | 512 (+256 image tokens) |
89
+ | Hardware | 1× RTX 6000 Ada (48 GB), ~26 samples/s, ~38 GB VRAM |
90
+ | Loss | ~2.08 → ~1.50 |
91
+
92
+ `checkpoint-3789` (epoch 3) is the recommended checkpoint; `checkpoint-1300`/`-2500` are the
93
+ epoch-1/epoch-2 points for comparison.
94
+
95
+ ## Usage
96
+
97
+ ```bash
98
+ # 1. get the code
99
  git clone https://github.com/crimsonKn1ght/astraq-vl && cd astraq-vl
100
+ pip install -r requirements.txt
101
+
102
+ # 2. download + unzip the recommended bundle
103
  hf download grKnight/astraq-vl-stage1 checkpoints/standard/astraq-vl-stage1-ep3.zip --local-dir .
104
  unzip checkpoints/standard/astraq-vl-stage1-ep3.zip -d ckpt
105
+
106
+ # 3. caption an image (CLIP + Qwen auto-download on first run)
107
+ python inference.py \
108
  --config ckpt/pretrain_astrollava.yaml \
109
+ --checkpoint ckpt/checkpoint-3789 \
110
+ --image your_astro_image.jpg \
111
+ --prompt "Describe this astronomical image." \
112
+ --temperature 0
113
+ ```
114
+
115
+ The bundled `predictions_test_ep*.jsonl` hold the held-out outputs with their reference captions.
116
+
117
+ ## Capabilities & limitations
118
+
119
+ **What it does well** — it grounds on *coarse visual structure* (object class / morphology), and
120
+ this **generalizes to held-out images**. On unseen test images, quality improved monotonically with
121
+ training: epoch 1 misidentified objects, epoch 2 fixed the object *category*, and epoch 3 recovered
122
+ *specific* objects — e.g. correctly naming **SN 1987A and its ring** and the **Dumbbell Nebula**, on
123
+ images it never trained on. Because these are held-out, that's genuine generalization, not
124
+ memorization.
125
+
126
+ **What it doesn't** — it **hallucinates fine details** (exact catalog numbers, telescopes, dates,
127
+ distances), filling specifics from the frozen LLM's prior rather than the pixels. This is the
128
  expected AstraQ-VL Stage-1 ceiling: the connector supplies a coarse visual category and the frozen LLM
129
+ improvises the rest. For factual specificity, a **Stage-2 fine-tune** (unfreezing the LLM via LoRA
130
+ on the QA pairs) is the fix — more Stage-1 epochs do not help. That model is now released at
131
+ [`grKnight/astraq-vl-stage2`](https://huggingface.co/grKnight/astraq-vl-stage2).
132
+
133
+ The held-out comparison above is a **qualitative spot check** on a few samples, not a full
134
+ quantitative benchmark.
135
+
136
+ ## Reproduction
137
+
138
+ Each bundle includes a `REPRODUCE.md` pinning the exact code commit, base models, and package
139
+ versions (`torch 2.8.0+cu128`, `transformers 5.12.1`). The split is seeded, so the build reproduces
140
+ the exact train/test partition.
141
+
142
+ ```
143
+ build: python scripts/build_astrollava_trainset.py --include-qa --max-image-size 384 --test-fraction 0.02 --seed 42
144
+ train: python train.py --config configs/pretrain_astraq_vl.yaml
145
+ eval: python scripts/batch_inference.py --records-json datasets/astrollava_llava/test.json --num-samples 0 ...
146
+ ```
147
+
148
+ ## Citation
149
+
150
+ If you use AstraQ-VL, this checkpoint, or its evaluation artifacts, please cite:
151
+
152
+ > Roy, G. (2026). *AstraQ-VL: Parameter-Efficient Astronomy Vision-Language Modeling with Connector Alignment and LoRA Tuning* (Version v1). Zenodo. [https://doi.org/10.5281/zenodo.21284851](https://doi.org/10.5281/zenodo.21284851)
153
+
154
+ ```bibtex
155
+ @misc{roy2026astraqvl,
156
+ author = {Roy, Gourab},
157
+ title = {AstraQ-VL: Parameter-Efficient Astronomy Vision-Language Modeling with Connector Alignment and LoRA Tuning},
158
+ year = {2026},
159
+ publisher = {Zenodo},
160
+ version = {v1},
161
+ doi = {10.5281/zenodo.21284851},
162
+ url = {https://doi.org/10.5281/zenodo.21284851}
163
+ }
164
+ ```
165
+
166
+ ## License & attribution
167
+
168
+ - **Weights:** `cc-by-sa-4.0`, inherited from the training data.
169
+ - **Training data:** [`UniverseTBD/AstroLLaVA_convos`](https://huggingface.co/datasets/UniverseTBD/AstroLLaVA_convos)
170
+ (CC-BY-SA-4.0); imagery from NASA APOD, ESO, and NASA/ESA Hubble.
171
+ - **Base models:** Qwen2.5-1.5B-Instruct (Apache-2.0), CLIP ViT-L/14 (OpenAI, MIT).
172
+ - Built on the AstroLLaVA work ([arXiv:2504.08583](https://arxiv.org/abs/2504.08583)).