Depth-Linked Residual Tokens for Multimodal Retrieval and Generation
Jiangfan Zhang, Wentao Bao, Xian Wu, Xiangjun Fan, Jianpeng Cheng, Jun Xiao
cs.LG, cs.AI
2026-11-20
DepThink chains K learnable tokens with a residual recurrence inside one prefill, matching or beating looped models on retrieval and math while training up to 11.9× faster.
Looped language models reuse one Transformer for K passes. The extra reasoning depth is extra compute, and the parameter count stays put. Every added pass reruns the whole backbone, so latency scales linearly with K. Learnable special tokens, including ViT register tokens, pause tokens, and soft prompts, finish in a single forward pass. Nothing in that design forces one token to correct the last, and the vectors often collapse onto the same features.
Retrieval wants several complementary vectors of one sample. Math and multi-hop QA want those vectors in order. Both jobs are asking for the loop's stepwise correction without K full backbone runs.
DepThink, from Meta AI, edits only the prefill, the pass that encodes the prompt before decoding starts. Text, image, or interleaved embeddings are extended with K learnable tokens and run through the causal Transformer once. The hidden state ek of special token k attends to the full input and to the special tokens in front of it.
The link itself is a first-order residual, not another stack of layers: zk = βk z{k-1} + αk ek, with z0 = 0. α and β are K scalars each. Unrolled, zk is a weighted sum of e1 through ek, and an early state remains only if the later β values keep it. α starts at 1 and β at 0, which makes the initial model identical to ordinary unlinked special tokens.
For retrieval, a query and a target are scored by the mean of K per-token cosines and trained with InfoNCE. For generation, z1 through zK enter the decoder as a latent trajectory, and the loss is still autoregressive token likelihood. Defaults are K=4 for retrieval and K=16 for generation. The main backbone is Qwen3-VL-Instruct 2B with LoRA rank 64. The same recipe is also run as 2B full fine-tuning, 8B LoRA, and Qwen3-VL-30B-A3B, a mixture-of-experts model with about 30B parameters and about 3B active. Optimizer setup is AdamW at 2e-4, 20,000 steps, 32 H100s, effective batch 1,024.
The proofs compare DepThink only with unlinked tokens. β=0 embeds that baseline with no distortion, so the best attainable risk cannot be worse. With the backbone held fixed, step k of the baseline points only along ek. Choosing α and β reaches the whole unit sphere of the span of e1 through ek. On InfoNCE, one gradient step away from β=0 beats the baseline step by about the step size times the squared β gradient. When that gradient is nonzero the step is strictly better, and a stationary point of the baseline does not block it.
The controls are a LoopLM that recycles every layer K times, and the same special tokens with the residual removed.
| Task | LoopLM | No residual | DepThink |
| CIRR | 60.9 | 62.7 | 65.8±1.1 |
| MSCOCO text-to-image | 78.2 | 78.6 | 79.6±0.8 |
| MSVD text-to-video | 74.9 | 71.5 | 77.9±0.8 |
| QVHighlights | 67.7 | 65.1 | 68.1±0.3 |
On MSVD the residual is doing real work: without it Recall falls to 71.5, below LoopLM at 74.9, and with it DepThink reaches 77.9. The 2B model also leads the 7B entries on CIRR, MSCOCO, and MSVD. UME-R1-7B sits at 55.3, 78.3, and 60.8 on those three. QVHighlights is only 0.4 above LoopLM.
MMEB-V2 here uses no extra training data. DepThink's image aggregate is 69.8±0.3, a hair under TTEs at 70.1 and above UME-R1 at 66.6. Grounding is 85.1 against 84.1 for TTEs, but classification goes the other way, 65.8 against 67.9. Video classification, QA, and retrieval are 54.7±0.9, 55.5±0.3, and 48.1±0.4, against 47.3, 49.1, 34.4 for TTEs and 44.3, 51.2, 32.9 for UME-R1. The paper's rollup is +9.7 over UME-R1 on video and +1.7 over TTE on VisDoc. Relative to the unlinked tokens, the residual adds 2.33% on video retrieval and 0.41% on zero-shot image classification.
| Task | No residual | LoopLM | DepThink |
| GSM8K | 68.52 | 70.88 | 71.11 |
| MATH-500 | 81.60 | 79.80 | 82.40 |
GSM8K is 0.23 over LoopLM. MATH-500 is 2.6 over LoopLM, and also over CRISP at 76.00 and HRPO at 63.30. A same-backbone Coconut with K=16 scores 37.73 on GSM8K and 71.00 on MATH-500. Coconut answers straight from an implicit trace, while the other runs write the reasoning out, so that gap mixes architecture with decode protocol. Scaling the token count up to 16 lifts both MMEB video retrieval and GSM8K, and DepThink stays above the unlinked tokens at every K tested.
Wall clock is the large gap. On 16 H100s, FSDP2, bf16, sequence length 2048, K=16 costs LoopLM 22.04s train and 7.24s inference per step. DepThink costs 1.85s and 1.70s, which is 11.9× and 4.3×. From K=2 to K=16, DepThink's training step stays between 1.7s and 1.9s, while LoopLM moves from 3.13s to 22.04s. Unlinked tokens are essentially as fast as DepThink, so the recurrence itself is cheap. The cost bound says DepThink is nearly K times cheaper when K is far below the prompt length. Measured training speedup is 11.9×, short of 16×.
The average retrieval margin over LoopLM remains about 2.1 to 3.1 after scaling. 8B LoRA scores 70.0 / 80.1 / 86.7 / 74.4 on CIRR / MSCOCO / MSVD / QVHighlights. 30B-A3B scores 73.3 / 81.3 / 84.0 / 71.5, so MSVD and QVHighlights are worse than the 8B, not better. On GSM8K, 2B full fine-tuning reaches 72.20, 8B LoRA reaches 85.76, and 30B-A3B LoRA reaches 84.31. The paper attributes the 8B lead to GSM8K being too small for a 30B model to show its capacity.
On OK-VQA, Gemini-2.5-Pro scores chain-of-thought traces from 1 to 5. At K=2, 4, and 8, DepThink's semantic margin over LoopLM is 1.04, 0.88, and 1.81, and the coherence margin is 1.18, 0.68, and 0.45. Exact match on NQ and HotpotQA reads 16.57, 15.81, 31.81 for DepThink, 16.12, 15.27, 31.22 without the residual, and 16.15, 15.49, 24.69 for LoopLM. The drop is in the third column. The paper traces it to the loop mixing earlier hidden states into the search query. DepThink's special tokens do not depend on the input, so the query stays intact. On that column the residual adds only 0.59 over unlinked tokens.
A fine-tune that currently loops the full network to build a latent state can swap that loop for one prefill plus 2K scalars. Retrieval then stores K vectors and averages their cosines. Generation skips the sequential prefill of the latent steps. The decoder is still autoregressive, so a written chain of thought is untouched.
Accuracy against LoopLM is a small step. GSM8K gains under 0.3, and the image aggregate still trails TTEs. The case for adopting it is wall-clock time.
There is no limitations section. The bounds have to be read off the experiments.
Directional reachability and the one-step descent gap are both stated against unlinked tokens, not against LoopLM. Reachability says some α, β can hit any direction in the span. It does not say gradient descent will find them. The descent gap covers InfoNCE only, inside a neighborhood of the β=0 initialization, and only for a small enough step. The autoregressive loss has no matching proof. Beating or tying LoopLM is a measurement.
Every backbone belongs to the Qwen3-VL family. Pause Token at 53.70 and Token Assorted at 48.70 on GSM8K are not using DepThink's decode protocol, so those published numbers are not a clean comparison.
Easy tasks barely use the residual. Image classification gains 0.41% relative, QVHighlights gains 0.4 Recall, and the MMEB image aggregate of 69.8 sits under TTEs at 70.1.
A layer sweep on OK-VQA perplexity favors the middle: layers 8 through 19 reach 2.0175, better than 2.0483 when every layer carries the residual. Layers 20 through 27 alone are the worst, at 2.1591. The headline results are not this multi-layer variant. In the appendix, short token chains answer the wrong question, and one K=8 trace emits no answer. The judge is a single model, Gemini-2.5-Pro.