OedoSoldier commited on
Commit
590b4d6
路
verified 路
1 Parent(s): 5797037

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +295 -3
README.md CHANGED
@@ -1,4 +1,296 @@
1
  ---
2
- base_model:
3
- - Qwen/Qwen2.5-VL-3B-Instruct
4
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ library_name: transformers
3
+ pipeline_tag: image-text-to-text
4
+ base_model: Qwen/Qwen2.5-VL-3B-Instruct
5
+ tags:
6
+ - vision-language
7
+ - multimodal
8
+ - visual-question-answering
9
+ - visual-reasoning
10
+ - visual-grounding
11
+ - on-policy-self-distillation
12
+ - self-distillation
13
+ - qwen2.5-vl
14
+ - lora
15
+ - vigos
16
+ license: other
17
+ license_name: qwen
18
+ license_link: https://huggingface.co/Qwen/Qwen2.5-VL-3B-Instruct/blob/main/LICENSE
19
+ model-index:
20
+ - name: ViGOS-3B
21
+ results:
22
+ - task:
23
+ type: image-text-to-text
24
+ name: Multimodal Reasoning
25
+ dataset:
26
+ name: Eight Main Benchmarks Average
27
+ type: aggregated
28
+ metrics:
29
+ - type: pass@5
30
+ value: 71.97
31
+ name: Mean Pass@5
32
+ - type: avg@5
33
+ value: 41.35
34
+ name: Mean Avg@5
35
+ - task:
36
+ type: visual-question-answering
37
+ name: Prior-Sensitive Visual Question Answering
38
+ dataset:
39
+ name: ViLP-F
40
+ type: ViLP-F
41
+ metrics:
42
+ - type: accuracy
43
+ value: 70.17
44
+ name: Score
45
+ - type: accuracy
46
+ value: 97.67
47
+ name: Prior
48
+ - task:
49
+ type: visual-question-answering
50
+ name: Prior-Sensitive Visual Question Answering
51
+ dataset:
52
+ name: ViLP-P
53
+ type: ViLP-P
54
+ metrics:
55
+ - type: accuracy
56
+ value: 69.50
57
+ name: Score
58
+ - type: accuracy
59
+ value: 90.00
60
+ name: Prior
61
+ ---
62
+ # ViGOS-3B: Visual Grounding On-Policy Self-Distillation
63
+
64
+ ## Model Details
65
+
66
+ | Field | Value |
67
+ |---|---|
68
+ | Model name | `ViGOS-3B` |
69
+ | Repository ID | `OedoSoldier/ViGOS-3B` |
70
+ | Model family | ViGOS |
71
+ | Model type | Multimodal image-text-to-text / vision-language reasoning model |
72
+ | Base model | `Qwen/Qwen2.5-VL-3B-Instruct` |
73
+ | Training method | Segment-wise multimodal on-policy self-distillation |
74
+ | Weight format | Merged full weights |
75
+ | Training data | [LMMs-Lab-Turtle/Vision-SR1-47K](https://huggingface.co/datasets/LMMs-Lab-Turtle/Vision-SR1-47K) |
76
+ | Output format | `<description>...</description><think>...</think>\boxed{...}` |
77
+ | Paper | *Seeing Before Reasoning: Decoupling Perception and Reasoning for Shortcut-Resilient Multimodal On-Policy Self-Distillation* |
78
+ | Authors | Sihan Wang, Xiyao Liu, Lianqing Liu, Zhi Han |
79
+ | Code | https://github.com/OedoSoldier/ViGOS |
80
+ | License | Qwen research license |
81
+
82
+ This repository is for the 3B-scale ViGOS model only. The 7B-scale model should use a separate Hugging Face repository and model card.
83
+
84
+ ## Model Summary
85
+
86
+ **ViGOS** stands for **Visual Grounding On-Policy Self-Distillation**. It is a multimodal post-training method for reducing shortcut behavior in on-policy self-distillation for vision-language models. In vanilla OPSD, the privileged teacher can see the reference answer while supervising the whole student rollout. For MLLMs, that can make the dense training signal overly answer-driven before the model has grounded its response in image evidence.
87
+
88
+ ViGOS changes the supervision path by asking the student to first produce a visual description, then reason, then answer:
89
+
90
+ ```text
91
+ <description> visual description </description>
92
+ <think> reasoning process </think>
93
+ \boxed{FINAL ANSWER}
94
+ ```
95
+
96
+ For valid training rollouts, ViGOS uses segment-wise teachers:
97
+
98
+ - an **image-only perception teacher** supervises the description tokens;
99
+ - a **privileged reasoning teacher** supervises reasoning and final-answer tokens after the student-generated description prefix exists;
100
+ - a **reference fallback teacher** is used only for invalid or malformed rollouts to recover the required output format.
101
+
102
+ At inference time, all teachers, reference answers, and segment masks are removed. The model receives only the image, the question or instruction, and the output-format prompt.
103
+
104
+ ## Intended Use
105
+
106
+ This model is intended for research and development in multimodal reasoning tasks, including visual question answering, visual math and diagram reasoning, OCR- or chart-grounded reasoning, spatial reasoning, visual grounding, and shortcut/prior-sensitivity analysis.
107
+
108
+ ## Out-of-Scope Use
109
+
110
+ This model should not be used as the sole decision-maker in high-stakes settings such as medical diagnosis, legal judgment, financial decision-making, safety-critical robotics, surveillance, identity verification, or other contexts where hallucinated or incorrect visual reasoning could cause harm.
111
+
112
+ ## How to Use
113
+
114
+ > Replace `MODEL_ID` with the actual Hugging Face repository name after publishing. If this repository contains only LoRA adapters rather than merged weights, update the loading code to use the corresponding PEFT workflow.
115
+
116
+ ```bash
117
+ pip install git+https://github.com/huggingface/transformers accelerate
118
+ pip install qwen-vl-utils[decord]
119
+ ```
120
+
121
+ ```python
122
+ import torch
123
+ from transformers import Qwen2_5_VLForConditionalGeneration, AutoProcessor
124
+ from qwen_vl_utils import process_vision_info
125
+
126
+ MODEL_ID = "OedoSoldier/ViGOS-3B"
127
+
128
+ model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
129
+ MODEL_ID,
130
+ torch_dtype="auto",
131
+ device_map="auto",
132
+ )
133
+ processor = AutoProcessor.from_pretrained(MODEL_ID)
134
+
135
+ image_path = "path/to/image.jpg"
136
+ question = "What is the answer to the visual question?"
137
+
138
+ prompt = f"""Problem: {question}
139
+
140
+ You are tasked with analyzing an image to generate a detailed description that can help you answer the question. First analyze the image and produce a self-contained description, detailed enough to lead to the correct answer. Do not include the final answer in the description. Wrap the entire description in <description> </description> tags.
141
+
142
+ Next, reason step by step based on the image description and the image, and enclose this part within <think> </think> tags.
143
+
144
+ Finally, provide a single word or phrase answer to the question in \\boxed{{}}.
145
+ The output format should be: <description> image description here </description><think> reasoning process here </think> \\boxed{{FINAL ANSWER here}}.
146
+ """
147
+
148
+ messages = [
149
+ {
150
+ "role": "user",
151
+ "content": [
152
+ {"type": "image", "image": image_path},
153
+ {"type": "text", "text": prompt},
154
+ ],
155
+ }
156
+ ]
157
+
158
+ text = processor.apply_chat_template(
159
+ messages,
160
+ tokenize=False,
161
+ add_generation_prompt=True,
162
+ )
163
+ image_inputs, video_inputs = process_vision_info(messages)
164
+ inputs = processor(
165
+ text=[text],
166
+ images=image_inputs,
167
+ videos=video_inputs,
168
+ padding=True,
169
+ return_tensors="pt",
170
+ ).to(model.device)
171
+
172
+ with torch.no_grad():
173
+ generated_ids = model.generate(
174
+ **inputs,
175
+ max_new_tokens=4096,
176
+ do_sample=True,
177
+ temperature=1.0,
178
+ top_p=0.90,
179
+ top_k=20,
180
+ )
181
+
182
+ generated_ids_trimmed = [
183
+ out_ids[len(in_ids):] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
184
+ ]
185
+ output_text = processor.batch_decode(
186
+ generated_ids_trimmed,
187
+ skip_special_tokens=True,
188
+ clean_up_tokenization_spaces=False,
189
+ )[0]
190
+
191
+ print(output_text)
192
+ ```
193
+
194
+ ### Recommended Answer Extraction
195
+
196
+ For benchmark-style evaluation, the paper extracts the final answer from the last `\boxed{...}` span. Outputs without a parseable final answer are counted as incorrect.
197
+
198
+ ## Training Details
199
+
200
+ The paper trains this model for one epoch on **Vision-SR1-47K** using 8 NVIDIA A100 GPUs. The student is trained on on-policy rollouts, and the frozen teacher roles are used only to score the student-generated prefixes during training.
201
+
202
+ | Parameter | Value |
203
+ |---|---:|
204
+ | Training epochs | 1 |
205
+ | GPUs | 8 脳 A100 |
206
+ | Effective batch size | 32 |
207
+ | Optimizer | Fused AdamW |
208
+ | Learning rate | 5e-6 |
209
+ | LR scheduler | Linear |
210
+ | Maximum gradient norm | 0.1 |
211
+ | Precision | bf16 |
212
+ | Distributed training | ZeRO-2 |
213
+ | Maximum prompt length | 32,768 |
214
+ | Maximum completion length | 4,096 |
215
+ | LoRA rank | 64 |
216
+ | LoRA alpha | 128 |
217
+ | LoRA dropout | 0.05 |
218
+ | LoRA target modules | `q_proj`, `k_proj`, `v_proj`, `o_proj`, `gate_proj`, `up_proj`, `down_proj` |
219
+ | Rollout temperature | 1.1 |
220
+ | Rollout top-p / top-k | 0.95 / 20 |
221
+ | 位_perc | 1.0 |
222
+ | 位_rea | 1.0 |
223
+ | 位_ref | 2.0 |
224
+ | Distillation temperature | 1.0 |
225
+ | KL clipping | 0.05 |
226
+
227
+ ## Evaluation Protocol
228
+
229
+ For the eight main benchmarks, the paper samples five stochastic responses per example and reports **Pass@5 / Avg@5**. Pass@5 checks whether at least one of the five sampled answers is correct, while Avg@5 is the mean correctness across all five samples.
230
+
231
+ For ViLP, the paper generates one response per prompt and reports **Score / Prior**. Score measures accuracy on visually diagnostic questions where the model must use the image, and Prior measures accuracy on prior-aligned questions where the common visual-language prior is correct.
232
+
233
+ Evaluation decoding settings:
234
+
235
+ | Parameter | Value |
236
+ |---|---:|
237
+ | Maximum generated tokens | 4,096 |
238
+ | Number of samples per main benchmark question | 5 |
239
+ | Temperature | 1.0 |
240
+ | Top-p | 0.90 |
241
+ | Top-k | 20 |
242
+ | Random seed | 42 |
243
+
244
+ ## Evaluation Results
245
+
246
+ ### Main Benchmarks
247
+
248
+ Pass@5 / Avg@5, in percent:
249
+
250
+ | Benchmark | ViGOS-3B |
251
+ |---|---:|
252
+ | MM-Vet | 65.60 / 43.76 |
253
+ | MMMU | 76.42 / 42.32 |
254
+ | MMMU-Pro | 56.44 / 26.16 |
255
+ | MathVerse | 58.55 / 30.10 |
256
+ | MathVista | 74.00 / 43.50 |
257
+ | MMSI | 66.40 / 24.90 |
258
+ | RealWorldQA | 86.80 / 55.37 |
259
+ | CV-Bench | 91.51 / 64.67 |
260
+ | **Mean across 8 benchmarks** | **71.97 / 41.35** |
261
+
262
+ ### Prior-Sensitive ViLP Results
263
+
264
+ Score / Prior, in percent:
265
+
266
+ | Setting | ViGOS-3B |
267
+ |---|---:|
268
+ | ViLP-F | 70.17 / 97.67 |
269
+ | ViLP-P | 69.50 / 90.00 |
270
+
271
+ ## Limitations
272
+
273
+ The paper identifies several limitations that also apply to this released model:
274
+
275
+ - The generated visual description may be incomplete or incorrect.
276
+ - The image-only perception teacher may produce generic descriptions.
277
+ - Training requires extra teacher forward passes.
278
+ - PALR is a diagnostic under specific counterfactual choices and does not prove that all shortcut behavior is eliminated.
279
+ - The model may hallucinate, misread fine visual details, fail on out-of-domain images, or inherit biases from the base model and training data.
280
+
281
+ ## Ethical Considerations
282
+
283
+ Users should validate the model carefully before deployment. The model can generate plausible but incorrect visual descriptions and rationales. In user-facing applications, consider presenting only concise final answers, or clearly mark generated descriptions and rationales as model-generated rather than authoritative evidence.
284
+
285
+ ## Citation
286
+
287
+ Please cite the ViGOS paper if you use this model or method.
288
+
289
+ ```bibtex
290
+ @misc{wang2027vigos,
291
+ title = {Seeing Before Reasoning: Decoupling Perception and Reasoning for Shortcut-Resilient Multimodal On-Policy Self-Distillation},
292
+ author = {Wang, Sihan and Liu, Xiyao and Liu, Lianqing and Han, Zhi},
293
+ year = {2027},
294
+ note = {ViGOS manuscript. Update with official proceedings or arXiv metadata when available.}
295
+ }
296
+ ```