Reversing the Flow: Generation-to-Understanding Synergy in Large Multimodal Models
Paper: arXiv:2605.15792 Code: PRIS-CV/reverse-flow-mllm Code reference:
main@d10606c8(2026-03-09)
1. Motivation (研究动机)
这篇论文要解决的是 unified multimodal model 里的一个“结构统一但认知单向”的问题:BAGEL、BLIP3-o、Janus、Show-o 等模型已经把 visual understanding 与 visual generation 放进同一类架构里,但常见路径仍然是 Understanding-to-Generation (UG)。模型先理解图像与指令,再把理解结果送给 diffusion 或 autoregressive generator 生成图像;生成结果通常被当作最终输出,而不是反过来作为理解的中间证据。
作者指出,这种单向性会让“统一模型”停留在架构层面的共享参数,而不是认知层面的互相增强。理解能力可以帮助生成更可控的图像,但生成能力很少被显式用来帮助模型重新看懂原图:模型不会主动去放大细节、补全背景、去除干扰物、构造新视角,随后把这些“想象出来的视觉证据”反馈给自己的 reasoning pathway。
Figure 1 解读:图中强调 unified model 的目标不应只是把 U 与 G 放在同一个模型里,而是让二者形成闭环。现有模型主要沿着 UG 方向工作:视觉/语言理解控制图像编辑或合成;本文关注被忽略的反向 GU:让生成模块先产生辅助视觉线索,再把这些线索作为额外上下文交给理解模块。
这个问题值得研究有三个原因。第一,人类在感知不确定时常会通过“想象”来辅助理解,例如脑内补全遮挡区域、换一个视角观察结构、放大局部细节;如果统一模型真的要模拟这种 cognition loop,就不能只会把理解结果转成图像。第二,generation pathway 已经携带丰富的视觉先验与世界知识,如果它只能作为输出端使用,就浪费了模型内部已有的生成能力。第三,论文发现生成质量会约束理解收益,而 prompt family 会决定收益迁移到哪些任务;这使 GU 不只是一个 prompt trick,而是统一模型中“生成如何服务理解”的可测机制。
2. Idea (核心思想)
核心 insight:把视觉生成从“答案之后的输出”改造成“答案之前的中间推理步骤”。模型先对输入图像执行受控编辑,生成一个 visual thought,再把原图、visual thought 与问题一起送回理解路径,让模型在 observed evidence 与 imagined evidence 之间做联合推理。
本文的关键创新是提出 Generation-to-Understanding (GU) synergy:不训练新模型、不接外部工具,而是在同一个 unified LMM 内用两阶段 zero-shot prompting 构造闭环。Stage I 让 generative pathway 产生增强/扩展后的辅助图像 ;Stage II 让 understanding pathway 读取 与 ,输出最终答案 。
与 UG 方法(例如 InstructPix2Pix、Show-o、BAGEL、Janus 系列的常规图像编辑/生成流程)相比,本文的根本差异在于信息流方向:传统方法让 understanding condition generation;GU 让 generation construct evidence for understanding。与 textual Chain-of-Thought 相比,它不是在语言空间解释决策,而是在图像空间先改造感知输入,因此更适合处理局部细节、空间布局、视觉错觉和鲁棒性感知问题。
3. Method (方法)
3.1 总体框架:闭环的 GU visual thinking
设统一多模态模型为 ,包含 coupled understanding pathway 与 generative pathway ,二者共享部分参数或表示空间。传统 UG 可写为: 其中 是输入图像, 是指令/问题, 是 visual encoder, 是 diffusion 或 autoregressive generator。这个公式中,理解只作为生成的条件,生成不会反馈给理解。
本文把流程改写成两步: 其中 是结构化 visual editing prompt, 是 self-generated visual thought。直觉上, 不是最终答案,也不是外部工具产生的新数据,而是模型利用自身生成先验构造出的“中间视觉假设”:如果图像更清晰、背景更完整、视角更合适、干扰更少,模型可能更容易回答原始问题。
Figure 2 解读:左侧 Stage I 使用同一个 unified model 的 generative capability 对原图执行编辑,得到 enhanced image / visual evidence;右侧 Stage II 将原始图像、生成图像与 query 一起输入 understanding pathway。这个设计的关键不是“多看一张图”本身,而是让第二张图由模型内部的生成路径构造,因此它体现了模型 latent world knowledge 对当前理解任务的可视化外化。
3.2 Stage I:Visual Thought Generation
Stage I 激活 generative pathway : 指定应该如何变换原图,使生成图像能够补充原始视觉证据。论文把 prompt library 分成两类:
- Enhancement Prompts :低层视觉增强,例如 denoising、deblurring、exposure correction、colorization、inpainting、increasing saturation。它们主要提升 perceptual fidelity、边缘/纹理/颜色可见性,适合 object counting、attribute recognition、color reasoning 等依赖局部视觉证据的任务。
- Expansion Prompts :高层语义或结构扩展,例如 outpainting、background reconstruction、viewpoint translation / novel view synthesis、object removal、texture enhancement、auxiliary line generation。它们主要扩展上下文、减少干扰、显式化空间关系,适合 spatial reasoning、illusion reasoning、结构理解等任务。
Figure 3 解读:上半部分展示低层 enhancement:模型通过去噪、去模糊、曝光/饱和度调整等方式让细节更可见;下半部分展示高层 manipulation:模型通过 outpainting、zoom-in、object removal、novel view 等方式生成新的上下文或结构线索。图中的样例都是 BAGEL 原本失败、但 GU visual thinking 能纠正的案例,说明生成不是为了“好看”,而是为了提供后续回答所需的证据。
这一阶段的关键约束是避免 answer leakage。也就是说,edit prompt 不应该直接包含答案,也不应该把问题转写成标签提示;它只能描述可视化操作。否则模型提升可能来自语言暗示,而不是生成出的视觉证据。
3.3 Stage II:Understanding via Internal Feedback
Stage II 把 重新输入 understanding pathway,构造增强上下文: 模型分别编码原图和 visual thought: 然后把视觉特征与问题拼接后送入 reasoning decoder: 这一步带来两种互补收益。第一是 perceptual enrichment:增强型编辑让局部结构更清楚,减少由于模糊、低对比度、遮挡带来的歧义。第二是 contextual supplementation:扩展型编辑提供额外空间/语义上下文,例如通过 outpainting 或 novel view 让模型看到原图中被截断或难以推断的关系。若 ,流程退化为不引入生成证据的 baseline,因此它与原始理解流程兼容。
3.4 Autonomous Prompt Generation:模型是否知道该想象什么
手工 prompt 可以验证 GU 是否存在,但不适合覆盖大量任务。论文引入 autonomous prompt writer ,使用 GPT-4o-mini 和 个 in-context examples 生成 task-specific edit prompt: 作者还对生成 prompt 做 semantic consistency 与 lexical diversity 过滤,目标是让 prompt 既贴合任务,又不要在 wording 上过度单一。这个模块的研究问题是:当前 unified model 是否能自己决定“应该想象什么”?后续实验显示 Self-Prompt 能生成语法合理、视觉上可执行的编辑指令,但经常关注表层变化而不是任务真正需要的信息;外部 writer,尤其 GPT-4o-mini,更稳定地对齐任务需求。
3.5 伪代码:基于论文流程与 released repo 可见代码的算法级实现
Code reference:
main@d10606c8(2026-03-09) — pseudocode and mapping based on this commit. Released repo exposes evaluation/config wrappers, but thevlmeval/vlm/bagelimplementation is an unresolved gitlink without.gitmodules; therefore generation internals are reconstructed from paper equations and visible registry/evaluation protocol. The pseudocode below is a schematic reading-note reconstruction, not a directly runnable copy of releasedBagelInfer*code.
import torch
@torch.no_grad()
def generate_visual_thought(bagel_model, image, question, edit_prompt):
"""Stage I: M_G(I, q; p_edit) -> I_hat."""
# Paper: I_hat = D_G(f_v(I), q, p_edit)
visual_features = bagel_model.encode_image(image)
enhanced_image = bagel_model.generate_image(
visual_features=visual_features,
question=question,
edit_prompt=edit_prompt,
# Paper setting: 30 denoising steps, CFG text=4.0, image=1.0.
# The public repo's BagelInfer submodule is unavailable, so these
# exact kwargs cannot be verified against released class code.
num_denoising_steps=30,
cfg_text=4.0,
cfg_image=1.0,
)
return enhanced_image@torch.no_grad()
def answer_with_visual_feedback(bagel_model, image, enhanced_image, question, mode="concat"):
"""Stage II: M_U(I, I_hat, q) -> answer."""
z_v = bagel_model.encode_image(image)
z_hat = bagel_model.encode_image(enhanced_image)
if mode == "concat":
# Best visible strategy in Table 3: [z_v, q, z_hat]
multimodal_context = bagel_model.pack_context([z_v, question, z_hat])
elif mode == "replace":
multimodal_context = bagel_model.pack_context([z_hat, question])
elif mode == "vae_concat":
# Paper reports modality confusion for this path.
vae_features = bagel_model.encode_with_vae(enhanced_image)
multimodal_context = bagel_model.pack_context([z_v, question, vae_features])
else:
raise ValueError(mode)
return bagel_model.decode_answer(multimodal_context)def choose_edit_prompt(question, image=None, writer="manual", demos=None):
"""Prompt selection / writer abstraction used by G->U."""
if writer == "manual":
if asks_about_fine_detail(question):
return "Enhance fine details and improve local clarity without changing semantics."
if asks_about_spatial_layout(question):
return "Generate an auxiliary view that makes spatial structure easier to inspect."
return "Improve visual evidence relevant to the question without revealing the answer."
if writer in {"gpt-4o-mini", "gemini-2.5-flash", "self-prompt"}:
# Paper: p_edit = W(I, q; {(I_i, q_i, p_i)}_{i=1}^K), K=5 by default.
prompt = writer_model(writer).generate_edit_prompt(
image=image,
question=question,
demonstrations=demos[:5],
constraints=["no answer leakage", "visual edit only", "task aligned"],
)
return filter_for_semantic_consistency_and_diversity(prompt)
raise ValueError(writer)def run_g2u_eval(dataset, model_alias="bagel_zoomin"):
"""Visible repo protocol: keep prediction, prompt, and enhanced_path."""
model = build_model_from_vlmeval_config(model_alias) # vlmeval/config.py
rows = []
for sample in dataset:
edit_prompt = choose_edit_prompt(sample.question, sample.image)
enhanced = generate_visual_thought(model, sample.image, sample.question, edit_prompt)
answer = answer_with_visual_feedback(model, sample.image, enhanced, sample.question)
rows.append({
"index": sample.index,
"prediction": answer,
"prompt": edit_prompt,
"enhanced_path": save_image(enhanced, sample.index),
})
return rows3.6 Code-to-paper mapping
Code reference:
main@d10606c8(2026-03-09) — pseudocode and mapping based on this commit
| Paper Concept | Source File | Key Class/Function |
|---|---|---|
| Paper metadata / GU description | README.md | README abstract states visual thoughts are fed back for perception |
| BAGEL baseline and GU model aliases | vlmeval/config.py | bagel, bagel_prompt, bagel_concat, bagel_zoomin, bagel_gpt*, bagel_prompt_gen, gemini_prompt_gen registry entries |
| BAGEL class imports | vlmeval/vlm/__init__.py | imports BagelInfer, BagelInfer_concat, BagelInfer_zoomin, BagelInfer_GPT, BagelInfer_prompt_gen |
| Evaluation output carrying visual-thought evidence | vlmeval/inference.py | BAGEL-specific result rows preserve prediction, prompt, enhanced_path |
| Benchmark launch examples | 0.sh, 1.sh | torchrun run.py --data MME/MMBench/MMVet/MMStar/HallusionBench --model bagel_gpt/bagel_zoomin --batch-size ... |
| Missing generation internals | vlmeval/vlm/bagel | gitlink d8acd820060ec12e3e3e991fe37858a0cdaca165; no .gitmodules, cloned directory empty |
论文公式与 released code 实现差异:论文给出了完整的 GU 公式、BAGEL 7B、30 denoising steps、text CFG 、image CFG ;public repo 则主要释放了 VLM-Eval 风格的 registry / launch / result-serialization wrapper,核心 BagelInfer* 文件位于未解析 gitlink 中,无法从当前 release 直接核对 generation 调用、concat 细节、VAE concat 实现与 prompt writer 内部逻辑。因此本笔记把代码锚定到 main@d10606c8,但对 generation internals 标注为 paper-specified / code-unverified。
4. Experimental Setup (实验设置)
4.1 数据集与规模
作者构造了 VisThink-Bench,用于直接测量 visual generation 对 understanding 的帮助。该 benchmark 有 个 VQA samples,来自 个已有 benchmark,覆盖 个 fine-grained tasks,并被组织成三大类:
| Category | Source benchmarks | Samples |
|---|---|---|
| Perception | MME, MMBench, SEED, MMStar, R-Bench, Q-Bench | |
| Logic Reasoning | EMMA, MMBench, SEED, KiVA, MMStar, HallusionBench | |
| Spatial Reasoning | LogicVista, LEGO, Spatial-457, MMBench |
此外,论文还在七个常用 benchmark 上评估泛化性:MMBench、MME、MM-Vet 用于 general perception / composition;MM-Star 与 KiVA 用于 reasoning;HallusionBench 用于 hallucination mitigation;R-Bench 用于 robustness under visual corruptions。
Figure 4 解读:左侧统计 GU 相对 vanilla BAGEL 在 个细粒度任务上的 accuracy change;右侧给出 VisThink-Bench 的任务构成。图中的核心现象是收益与任务类型高度相关:3D height estimation、illusion reasoning、color recognition 等任务提升最大,因为它们依赖局部对比度、空间布局或细节放大;text / pattern recognition 等符号密集任务可能下降,因为生成器难以稳定保留离散字符或规则图案。
4.2 Baselines 与比较对象
比较对象分成两类。第一类是 specialised understanding systems:Qwen2.5-VL、InternVL2.5、LLaVA-OV、DeepSeek-VL2、Emu3-chat。第二类是 unified models:MetaQuery、BLIP3-o、Janus-Pro、Show-o2、LMFusion、TokenFlow-XL、BAGEL。核心对比是 BAGEL baseline 与 BAGEL+Ours,即在 BAGEL 上加入 GU visual thinking。
4.3 Evaluation metrics
- Accuracy / benchmark score:MMBench、MM-Vet、MMStar、KiVA、HallusionBench、R-Bench 等按照各 benchmark 的标准 accuracy 或综合分数报告。
- MME-P / MME-S:MME-P 是 Perception score;MME-S 是 Perception + Cognition 的 total sum score。
- VIE metric:用于衡量编辑质量,论文报告 Semantic Consistency 与 Perceptual Quality,并把它们与下游 understanding gain 做相关性分析。
- AVG:在 ablation table 中对 R-Bench、HallBench、MMStar 三个分数求平均,用于比较 reasoning modality、context integration 和 prompt writer。
4.4 模型与推理配置
实验实例化在 BAGEL (7B) 上。论文强调所有实验都是 zero-shot:不 fine-tune,不增加参数,也不改模型架构。VisThink-Bench 使用手工 task-specific edit prompts;其他 benchmark 使用 GPT-4o-mini few-shot writer,默认 个 in-context examples。视觉编辑使用 BAGEL 默认 diffusion 设置: denoising steps、text classifier-free guidance scale 、image guidance scale 。
代码侧可见配置包括:vlmeval/config.py 将所有 BAGEL alias 指向 /data/tongyujun/uni-tts/models/BAGEL-7B-MoT;0.sh / 1.sh 给出单卡 torchrun 评估示例,例如 bagel_gpt 在 MME/MMBench 上 batch size 、HallusionBench/MMVet/MMStar 上 batch size ,bagel_zoomin 在 AI2D_TEST 上 batch size 、MMBench/MMVet/HallusionBench 上 batch size 。由于 BagelInfer* 子模块未随 repo 正常展开,30 steps 与 CFG 数值目前只能锚定到论文文本,不能从 released implementation 中复核。
5. Experimental Results (实验结果)
5.1 主结果:BAGEL+GU 在多数 benchmark 上提升
| Model | MMB | MME-P | MME-S | MMVet | MMStar | KiVA | HallBench | R-Bench |
|---|---|---|---|---|---|---|---|---|
| BAGEL | ||||||||
| BAGEL+Ours | ||||||||
| Change |
结果显示,GU 对 reasoning / hallucination / robustness 更有帮助:MMStar 提升 ,KiVA 提升 ,HallusionBench 提升 ,R-Bench 提升 ,MMBench 提升 。MME 与 MMVet 小幅下降,说明生成反馈并不是无条件提升;当任务更依赖离散符号、细小文本或 benchmark scoring 与图像编辑不对齐时,visual thought 可能引入噪声。
5.2 VisThink-Bench:收益取决于任务需要哪种 visual thought
VisThink-Bench 上的 fine-grained 分析表明,GU 的收益不是均匀分布的。3D height estimation、illusion reasoning、color recognition 等任务提升超过 ,因为它们分别受益于 novel view / spatial layout、结构可视化、局部颜色与细节增强。human counting、object counting、shape recognition 等复杂场景感知任务有中等收益,但当编辑需要高保真姿态或复杂布局时,生成错误会限制提升。text / pattern recognition 等符号密集任务略降,原因是生成 prior 对离散 token fidelity 不稳定。
5.3 编辑质量与下游理解收益正相关
论文用 VIE metric 衡量 BAGEL 在 VisThink-Bench 上的编辑质量,平均 Semantic Consistency 为 ,Perceptual Quality 为 。按任务计算编辑质量与 GU accuracy gain 的关系后,Semantic Consistency 与 Perceptual Quality 都呈显著正相关:,。
Figure 5a–5b 解读:两张散点图分别对应 Semantic Consistency 与 Perceptual Quality;横轴是编辑质量,纵轴是 understanding improvement。回归线向上说明“想象得越好,理解通常越好”,但 也说明编辑质量不是唯一因素:prompt 是否选对、任务是否需要视觉补证据、生成是否保留关键符号都会影响最终收益。
5.4 Ablation:视觉推理优于 textual CoT,Concat 最稳,外部 prompt writer 更好
| Method | R-Bench | HallBench | MMStar | AVG |
|---|---|---|---|---|
| BAGEL (Baseline) | ||||
| BAGEL Textual CoT | ||||
| Replace | ||||
| Concat | ||||
| VAE Concat | ||||
| Self-Prompt | ||||
| Gemini-2.5-Flash | ||||
| GPT-4o-mini (Ours) |
Textual CoT 把 AVG 从 降到 ,说明语言解释会引入 spurious linguistic bias,并不等价于视觉推理。Replace 与 Concat 都证明 GU 机制有效,其中 Concat 最高(AVG ),因为它同时保留原始证据与生成证据。VAE Concat 降到 ,论文解释为 modality confusion:模型难以判断自己应当生成还是理解。
Prompt writer 的结果说明当前模型“能想象,但不会稳定决定该想象什么”。Self-Prompt 的 AVG 是 ,说明模型能产生可执行 prompt;Gemini-2.5-Flash 达到 ;GPT-4o-mini 最好,AVG 。差异来自 task alignment:外部 writer 更能针对问题选择低层增强、高层扩展或结构可视化,而 Self-Prompt 容易生成表面合理但任务无关的编辑。
Figure 6 解读:图中比较不同 prompt writer 生成 edit prompt 的行为分布。它支持论文的核心判断:unified model 已经具备生成 visual thought 的能力,但缺乏 meta-awareness 来选择最有用的想象方向;外部 prompt writer 的优势不只是语言更流畅,而是更能把任务需求映射到合适的视觉编辑 family。
5.5 局限与失败模式
作者总结了三类边界条件。第一,generative fidelity 是上限:如果生成器不能保留文字、图表、小数字或细粒度 pattern,visual thought 就不能提供新证据,甚至会误导理解。第二,抽象 prompt 会导致 circular reasoning:例如“提取最显著物体”这类指令本身就要求先理解图像,模型若已经不理解,就无法通过生成获得额外信息。第三,缺乏 extrapolative imagination:当前模型主要是插值式想象,能重排或增强已观察内容,但很难预测未来运动、因果后果或时间演化。
总体结论是:GU 证明视觉生成可以成为 multimodal understanding 的内部 reasoning step,并在无需训练的条件下提高多个 benchmark;但真正的 unified cognition 还需要模型学会判断“何时想象、想象什么、想象结果是否可信”。