NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Curse of High Dimensionality Issue in Transformer for Long Context Modeling

Shuhai Zhang, Zeng You, Yaofo Chen, Zhiquan Wen, Qianyue Wang, Zhijie Qiu, Yuanqing Li, Mingkui Tan

TL;DR

Transformers are notoriously inefficient at handling long sequences because they spend equal computational effort on every token, even though most are "irrelevant" to the current prediction. This paper introduces Dynamic Group Attention (DGA), a method that theoretically identifies "focal" tokens and aggregates the rest into groups. This approach slashes inference latency by up to 3.5x while maintaining competitive accuracy on long-context tasks.

The Problem: Redundancy in the Quadratic Bottleneck

The "quadratic bottleneck" of self-attention is a well-known hurdle for Large Language Models (LLMs). However, the authors argue the core problem isn't just the sheer volume of mathematical operations—it's the redundancy.

In a sequence of 32,000 tokens, only a tiny fraction actually influences the next word prediction. Standard Transformers suffer from a "Curse of High Dimensionality": they treat the entire context as a monolithic block, wasting resources computing sparse attention weights. While existing "token dropping" methods attempt to fix this by deleting tokens entirely, they often break the model's ability to understand complex relationships. The central challenge is reducing redundant computation without losing the connective tissue of the broader context.

Methodology: Dynamic Group Attention

The authors tackle this problem through a mix of theoretical reformulation and architectural innovation:

  1. Supervised Reformulation: They move away from traditional autoregressive modeling to view sequence modeling as a supervised learning task. This mathematical shift allows them to formally separate "relevant" tokens from "irrelevant" ones.
  2. Linear Coding Theory: By modeling attention as a "linear coding problem," they prove that grouping tokens (Group Coding) isn't just a compression trick. It actually makes the model more robust to random noise and improves the "condition number" of the optimization, leading to faster, more stable training.
  3. Dynamic Group Attention (DGA): This is the core algorithm, operating in distinct phases:
  4. Identify & Split: It calculates an importance score for every token based on accumulated attention weights, separating them into Focal tokens (the "VIPs" that get full attention) and Non-focal tokens.
  5. Aggregate: Non-focal tokens are grouped together (size m) and their Key-Value (KV) pairs are aggregated.
  6. Complement: To ensure the model doesn't "go blind" due to causal masking, they introduce "complementary" KV pairs that allow tokens to access group information they would otherwise miss.
Dynamic Group Attention Process

Key Insights

Using datasets like SlimPajama, WikiText2, and LongBench-E, the researchers uncovered several critical insights:

  • Sparsity is Guaranteed: The authors provide a theoretical proof showing that as context length increases, the probability of attention being extremely sparse approaches 100%. Redundancy is an inherent property of long sequences, not a bug.
  • Grouping as a Denoising Filter: One of the most surprising findings is that grouping tokens reduces the variance of weight changes by a factor of $1/m^2$. This means DGA is actually more robust to noise than standard vanilla attention.
  • Optimization Efficiency: By reducing the dimensionality of the attention problem, DGA improves the objective function's condition number, allowing the model to converge on the right answer much faster during training.

Key Results

The empirical results demonstrate that DGA successfully balances efficiency and performance:

  • Massive Speedups: On a LLaMA2-7B model with a 16K context, DGA achieved an Inter-Token Latency (ITL) of 28.80 ms. That is 2.42x faster than vanilla attention (69.70 ms) and 3.55x faster than other popular baselines like LM-Infinite (102.22 ms).
  • Accuracy Retention: On the LongBench-E benchmark, DGA-LLM maintained an average score of 21.14, nearly matching the vanilla model (21.69) while significantly outperforming other efficient models like StreamingLLM (16.43).
  • Memory Efficiency: DGA significantly reduces the KV cache footprint, making it possible to run much longer contexts on the same hardware.
Performance and Latency Comparison on LongBench-E

Limitations and Future Work

While DGA represents a major step forward for long-context modeling, the authors note a few areas for future improvement:

  • Hyperparameter Tuning: Performance is currently sensitive to the group size ($m$) and the importance rate ($\gamma$). Finding the optimal "sweet spot" requires manual effort.
  • Static Thresholds: The current model uses a fixed importance rate. Future iterations should explore adaptive mechanisms that change the grouping strategy dynamically based on input complexity.
  • Multimodal Expansion: The authors suggest DGA could be revolutionary for video and audio processing, where temporal redundancy (e.g., a static background in a video) is even higher than in text.

Summary updated

BibTeX
@inproceedings{zhang2025curse,
  author = {Shuhai Zhang and Zeng You and Yaofo Chen and Zhiquan Wen and Qianyue Wang and Zhijie Qiu and Yuanqing Li and Mingkui Tan},
  title = {{Curse of High Dimensionality Issue in Transformer for Long Context Modeling}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=CYmaCpGDDG},
}
Figure