LatentWeave: Test-Time Latent Optimization for Multimodal Reasoning
Organizations: University of Science and Technology of China · Nanyang Technological University · National University of Singapore · The Chinese University of Hong Kong ·
Abstract
Recent advances in test-time optimization have shown that the multimodal reasoning performance of large multimodal language models (MLLMs) can be improved during inference without modifying backbone model parameters. However, existing approaches primarily operate at the prompt or output level, leaving the latent reasoning process largely uncontrolled and insufficient to prevent error accumulation during autoregressive generation. To address this limitation, we propose LatentWeave, a test-time framework that treats multimodal reasoning as a controllable latent trajectory. LatentWeave performs structured Latent Weaving, progressively refining intermediate hidden states segment-wise to correct emerging deviations, and further introduces Reasoning Anchors via lightweight WEAVE tokens to stabilize reasoning structure and guide answer-oriented generation. These mechanisms are designed to enable fine-grained, step-aware intervention in the latent reasoning process while keeping the main MLLM backbone parameters fixed. Extensive experiments across diverse multimodal reasoning benchmarks report improvements over the evaluated baselines; the contribution of latent optimization, anchor training, and additional test-time computation is analyzed separately in the ablation and efficiency studies. Our code is available at https://github.com/jins7/LatentWeave.
Figures & tables
| Method | Mathematical Reasoning | General Visual QA | Diagram | ||||
|---|---|---|---|---|---|---|---|
| Math Vision | Math Verse | Math Vista | MMMU | RealWorld QA | MME | AI2D | |
| InternVL2.5-4B | |||||||
| Vanilla | |||||||
| CoT | 20.93_{{\color[rgb]{0,0.7,0}\uparrow 1.35}} | 35.95_{{\color[rgb]{0,0.7,0}\uparrow 1.46}} | 60.81_{{\color[rgb]{0,0.7,0}\uparrow 0.64}} | 48.22_{{\color[rgb]{0,0.7,0}\uparrow 1.40}} | 62.19_{{\color[rgb]{0,0.7,0}\uparrow 1.15}} | 2331_{{\color[rgb]{0,0.7,0}\uparrow 15.0}} | 80.10_{{\color[rgb]{0,0.7,0}\uparrow 0.47}} |
| SFT | 19.28_{{\color[rgb]{0.8,0,0}\downarrow 0.30}} | 35.13_{{\color[rgb]{0,0.7,0}\uparrow 0.64}} | 60.82_{{\color[rgb]{0,0.7,0}\uparrow 0.65}} | 49.51_{{\color[rgb]{0,0.7,0}\uparrow 2.69}} | 63.29_{{\color[rgb]{0,0.7,0}\uparrow 2.25}} | 2309_{{\color[rgb]{0.8,0,0}\downarrow 7.0}} | 80.87_{{\color[rgb]{0,0.7,0}\uparrow 1.24}} |
| GRPO | 20.07_{{\color[rgb]{0,0.7,0}\uparrow 0.49}} | 35.66_{{\color[rgb]{0,0.7,0}\uparrow 1.17}} | 61.34_{{\color[rgb]{0,0.7,0}\uparrow 1.17}} | 48.86_{{\color[rgb]{0,0.7,0}\uparrow 2.04}} | 61.35_{{\color[rgb]{0,0.7,0}\uparrow 0.31}} | 2302_{{\color[rgb]{0.8,0,0}\downarrow 14.0}} | 78.41_{{\color[rgb]{0.8,0,0}\downarrow 1.22}} |
| Backbone | Method | MathVision | MathVerse | MathVista | MMMU | RealWorldQA | MME | AI2D |
|---|---|---|---|---|---|---|---|---|
| Qwen2.5-VL-7B | Vanilla | 23.65 | 47.98 | 66.15 | 56.96 | 66.02 | 2328 | 80.58 |
| + LatentWeave | 30.11 | 53.80 | 72.03 | 63.15 | 70.89 | 2388 | 88.93 | |
| +6.46 | +5.82 | +5.88 | +6.19 | +4.87 | +60.0 | +8.35 | ||
| Qwen3.5-4B | Vanilla | 66.12 | 66.37 | 75.80 | 68.32 | 73.33 | 2372 | 85.91 |
| + LatentWeave | 72.69 | 71.44 | 79.30 | 72.81 | 76.71 | 2404 | 89.25 | |
| +6.57 | +5.07 | +3.50 | +4.49 | +3.38 | +32.0 | +3.34 |
Appendix figures & tables14 assets
Supplementary material from the paper’s appendix.
Appendix
| Symbol | Description |
|---|---|
| Textual input (question or instruction) | |
| Visual input (image or diagram) | |
| Generated output token sequence | |
| Hidden state at decoding step | |
| Latent reasoning trajectory composed of hidden states | |
| Pretrained vision–language model with frozen parameters |
| Phase / split | Verifier weights | Prompt / config ID | Status | |
|---|---|---|---|---|
| Offline collection | 0.3 | rw-v1/offline | Verified | |
| Development | 0 | rw-v1/dev | Verified | |
| Test evaluation | 0 | rw-v1/test | Verified |
| Backbone / split | Segmentation | Rollouts | Updates | Baseline / regularization | Seed / ID |
|---|---|---|---|---|---|
| Qwen2.5-VL-7B / test | LOO / | / opt-v1 | |||
| InternVL2.5-4B / test | LOO / | / opt-v1 |
| Stage | Input output | Serialization / insertion | Aux call / cache | Leakage / config |
|---|---|---|---|---|
| Anchor training | anchor text | Six spans: <WEAVE> </WEAVE> , tokens each | No / N/A | Train split only |
| Evaluation | anchor text | Identical string; inserted after visual tokens, before the CoT trigger | Once / no cross-example reuse | No labels / anchor-v1 |
| Question Type | Required Output Format |
|---|---|
| Multiple-Choice Questions | You must answer this multiple-choice question. Think step by step, then at the very end of your response, output: Final Answer: [X] where X is the chosen option label (A, B, C, D, E, etc.). Do not include any text after this line. |
| Open-Ended Questions | You must answer this open-ended question. Think step by step, then at the very end of your response, output: \boxed{your final answer} where your final answer is the concise answer to the question. Do not include any text after this line. |
| Variant | Latent | Anchors | MathVista | MMMU | AI2D |
|---|---|---|---|---|---|
| Vanilla | Off | Off | |||
| Anchors only | Off | On | |||
| Latent Weaving only | On | Off | |||
| LatentWeave (Full) | On | On |
| Method | Rollouts / updates | Main FWD / BWD | Aux / verifier | Tokens | Time / peak memory |
|---|---|---|---|---|---|
| Self-Consistency | /0 | / | 2.8k | 14 s / 21 GB | |
| Self-Refine | /0 | / | 1.3k | 7 s / 20 GB | |
| TTRV | –/– | –/– | / | 3.0k | 18 s / 22 GB |
| Same-verifier Best-of- | –/0 | / | 5.6k | 31 s / 21 GB | |
| LatentWeave | –/ | / | 9.2k | 52 s / 41 GB |
| Condition | Latent / anchors | Rollouts / evaluations | Comparison | Accuracy | Gain (pp) |
|---|---|---|---|---|---|
| Vanilla | Off / Off | Reference | – | ||
| Best-of- | Off / Off | Same verifier | |||
| Latent Weaving only | On / Off | Same verifier | |||
| Full | On / On | ( aux) | Same verifier |
| Verifier | Audit | Agreement (CI) | Discrimination | Calibration | Bias checks |
|---|---|---|---|---|---|
| Consistency ( ) | AUROC | ECE | len. ; self | ||
| Correctness ( ) | AUROC | ECE | len. ; self | ||
| Completeness ( ) | AUROC | ECE | len. ; self | ||
| Understanding ( ) | AUROC | ECE | len. ; self |
| Method | Backbone / checkpoint | Decoding / samples | Train data / budget | Verifier | Seeds / config |
|---|---|---|---|---|---|
| CoT | Qwen2.5-VL-7B-Instruct | Greedy, , 1024 tok. | – | – | 1 / base-cot |
| Self-Consistency | Qwen2.5-VL-7B-Instruct | , top- , | – | Majority vote | 3 / base-sc |
| Self-Refine | Qwen2.5-VL-7B-Instruct | Greedy, 2 refine rounds | – | Self-critique | 3 / base-sr |
| TTRV | Qwen2.5-VL-7B-Instruct | , | Unlabeled test inputs; online GRPO | Frequency + entropy | 3 / base-ttrv |
| SFT / GRPO | Qwen2.5-VL-7B-Instruct | Greedy, | 18k CoT traces; 2 ep. / 1.0k steps | – / same reward | 3 / base-sft , base-grpo |
| IVT-LR / LaCoT | Released checkpoints | Per original paper | Same 18k pool | Per original paper | 3 / base-ivtlr , base-lacot |
| Parameter sweeps from Figure 5 | ||||
|---|---|---|---|---|
| Factor | Values | MathVista | RealWorldQA | Spread |
| 0.05/0.10/0.15/0.20/0.25/0.30 | 66.5/67.2/67.8/68.2/ 68.5 /67.5 | 66.3/66.8/67.1/67.3/ 67.5 /67.2 | 2.0/1.2 | |
| 2/4/6/8 | 66.8/67.5/ 68.2 /67.6 | 66.5/ 67.4 /67.0/66.3 | 1.4/1.1 | |
| 3/4/5/6/7 | 67.2/67.6/67.9/ 68.3 /68.0 | 66.5/67.0/67.3/ 67.6 /67.1 | 1.1/1.1 | |
| Separate anchor-delimiter control | ||||
| Factor | Values | MathVista | MMMU | Spread |
| Configuration | Weight vector | MathVista | MMMU |
|---|---|---|---|
| Default | |||
| Uniform | |||
| Correctness-heavy | |||
| Structure-heavy |
| Reward setting | MathVision | RealWorldQA | vs. full |
|---|---|---|---|
| Full composite reward | – | ||
| Without consistency | / | ||
| Without correctness | / | ||
| Without completeness | / | ||
| Without understanding | / |
| Location | Task / backbone / split | Prompt / config | Raw artifact | Metric / value | Status |
|---|---|---|---|---|---|
| Table 1 | MathVista / Qwen2.5-VL-7B / testmini | cot-v1 / lw-v1 | qwen7b_mathvista | Acc. | Verified |
| Table 2 | MathVision / STEP3-VL-10B / test | cot-v1 / lw-v1 | step3_mathvision | Acc. | Verified |
| Table 9 | AI2D / Qwen2.5-VL-7B / test | cot-v1 / lw-anchor-v1 | qwen7b_ai2d_s{0,1,2} | Acc. | Verified |
| Table 10 | Cost / Qwen2.5-VL-7B / MathVista-200 | lw-v1 | cost_qwen7b | s / item | Verified |