Tencent's DIPE Stops Vision AI From Forgetting Images Over Long Contexts
A query-side position encoding tweak stops multimodal models from ignoring images once the text context grows past a few thousand tokens.
ProTakeaways
- ECCV 2026 paper identifies visual fading: multimodal LLMs stop attending to images as text context grows.
- Root cause is Multimodal RoPE's long-term decay penalizing inter-modal attention over increasing sequential distance.
- DIPE splits attention into intra-modal (standard MRoPE) and inter-modal (query anchored to segment start).
- Adds no parameters, works with KV cache and FlexAttention via LogSumExp fusion of two kernels.
- Gains 4.10% average on long-context VQA over MRoPE, with matching short-context accuracy across 19 benchmarks.
- Training and evaluation code released; larger relative gains on smaller models like Qwen2.5-0.5B.
Multimodal LLMs have a quiet failure mode: the longer they talk, the less they look. A new ECCV 2026 paper from researchers at the Chinese Academy of Sciences and Tencent Hunyuan pinpoints why this happens and proposes a fix that plugs into existing models without extra parameters, without touching the KV cache layout, and without hurting short-context accuracy.
The paper, Beyond Sequential Distance: Inter-Modal Distance Invariant Position Encoding, introduces DIPE, a modification to how position information is applied inside attention. Integrating DIPE consistently yields absolute average improvements of 2.00%, 4.10%, and 2.01% for Vanilla RoPE, MRoPE and MRoPE-I, respectively on long-context multimodal benchmarks, and the training code is already on GitHub.
The visual fading problem
The authors call the failure mode visual fading. While MLLMs maintain robust attention to visual inputs and successfully ground visual evidence in a short-context scenario, they fail to attend to correct visual cues and generate erroneous predictions in a long-context one. Put simply, if you show a model an image and ask a question right away, it looks at the image. If you show it the same image followed by thousands of tokens of text before the question, the image effectively disappears from its attention budget.

The culprit is the position encoding that most modern vision-language models rely on. RoPE (Rotary Position Embedding) has a well-known property called long-term decay: attention scores between tokens shrink as their relative distance grows. That is a useful bias for language, where nearby words matter more, but it becomes toxic when images sit at position 0 and generated text keeps pushing further away.
As the response length grows, the relative distance between the newly generated text query and the fixed visual keys increases linearly. Consequently, the attention mechanism mathematically suppresses visual signals as the generation proceeds, causing the model to gradually look away from the image. Multimodal RoPE (MRoPE), introduced with Qwen2-VL and now widespread, inherits this same decay along its temporal, height, and width axes.
The fix: two views of the query
DIPE's insight is that the decay is only harmful for inter-modal pairs (text attending to image, or vice versa). Within a single modality, you actually want positional locality: text should respect word order, and image patches should respect 2D spatial structure. So DIPE splits attention into two kinds:
- Intra-modal attention keeps standard MRoPE position tuples on both query and key. Call this Sequential Position Encoding (SPE).
- Inter-modal attention rewrites the query's position to the starting
(t, h, w)coordinates of its own segment. Call this Anchored Position Encoding (APE). The key still uses SPE.
Because the query is always anchored to the first token of its own modality segment when attending across modalities, the effective distance between visual keys and any text query stays constant regardless of how many tokens have been generated. The long-term decay penalty on visual signals is neutralized without changing intra-modal geometry.
How it plugs into existing infra
The practical engineering matters here. DIPE is strictly a query-side intervention. It requires creating two views of the query vector during the forward pass. Critically, it does not alter the content of previous keys and values. This allows DIPE to be deployed on top of pre-computed KV caches without requiring cache re-indexing or memory layout modifications.
At runtime, the attention block runs two masked kernels, one for intra-modal pairs using the SPE-rotated query and one for inter-modal pairs using the APE-rotated query. Their outputs are merged exactly using the LogSumExp statistic that FlashAttention-style kernels already return:
q_spe = apply_mrope(q, pos_spe)
q_ape = apply_mrope(q, pos_ape)
k = apply_mrope(k, pos_spe)
o_intra, lse_intra = flex_attn_func(q_spe, k, v, intra_mask)
o_inter, lse_inter = flex_attn_func(q_ape, k, v, inter_mask)
alpha = sigmoid(lse_intra - lse_inter)
output = alpha * o_intra + (1 - alpha) * o_interThe fusion is mathematically equivalent to running a single softmax over all keys, so nothing about the attention math is approximated. The cost is a second attention call over the same KV.
Numbers
The authors trained Qwen2.5-3B with a SigLIP2-SO400M vision tower using the standard LLaVA-Pretrain + LLaVA-NeXT recipe, then stress-tested it by inserting 1K to 32K tokens of unrelated distractor text between the image and the question across 19 benchmarks.
The most striking result is that while the base MRoPE model exhibits lower overall accuracy than both Vanilla RoPE and MRoPE-I, it registers the most substantial gain (+4.10%) when equipped with DIPE. On specific perception benchmarks the gains are large: POPE jumps by 11.08 points, CountBench by 9.37, MMBench-EN by 8.75, and HRBench-4K by 6.87.
Two other findings are worth flagging:
- Short-context parity. MRoPE-I equipped with DIPE achieves an overall accuracy of 51.4%, effectively matching the 51.5% of the vanilla baseline. DIPE does not tax models when the failure mode it targets is not present.
- Larger relative gains on smaller models. On Qwen2.5-0.5B, DIPE adds 8.81% overall accuracy, more than double the 3B gain. We attribute this to the fact that lightweight models inherently possess weaker long-context capabilities, rendering them more susceptible to visual fading.
Cost and caveats
DIPE is not free. Running a second masked attention kernel roughly doubles attention-block latency in the worst case, though the full-model overhead is small because attention is only one component. At 32K tokens the attention forward pass rises from 13.56ms to 14.31ms, and the full forward from 818ms to 840ms. Under packed-sequence training, the overhead is closer to noise.
The current release ships with an eager-attention implementation for stability, with FlexAttention integration described in the paper. Backward pass memory is unchanged versus the MRoPE baseline in the reported settings, both hitting OOM at the same 16K point on the test hardware.
The paper also reports minor regressions on a handful of benchmarks such as InfoVQA and V*, and the technique is limited to models trained with the decoupled position scheme, meaning existing checkpoints need fine-tuning rather than a pure inference-time swap. But as a drop-in modification to any MRoPE-family model, without extra parameters and without breaking the KV cache, it looks like a cheap way to make long-context multimodal generation actually keep looking at the image.