Long-Context Architecture in LLMs: A Paradigm Shift from Thinning to Shortening Attention

    This article explains why long context has become core infrastructure for the next generation of large language models, and why benchmark scores alone no longer capture real progress. It breaks down the quadratic complexity bottleneck of Transformer attention, then examines the paradigm-level shift toward sequence-dimension compression, including the CSA and HCA approaches, and the move to treat long context as a unified foundation for both training and inference. Readers will also find practical guidance on evaluation metrics, compression strategy selection, and observability.

    1. Introduction: When Benchmarks No Longer Tell the Whole Story

    Expectations for the next generation of large models have been pushed higher over the past year. Yet public leaderboards show that the latest batch of models roughly matches the previous flagship generation, while leading open-source models have closed in on the same range. On scores alone, the surprise factor looks limited. One research team admitted in its technical report that its flagship model leads current mainstream open-source models by a small margin and sits above the previous international flagship, but still trails the latest international flagship by roughly three to six months.

    Judging by leaderboards alone, a team that once held a clear edge through a strong general-purpose generation and a reasoning model now looks indistinguishable from the crowd. That view misses a key fact: training paradigms have converged sharply over the past year, peers are catching up fast, and competing purely on general-purpose scores has entered a region of diminishing marginal returns. The real dividing line is shifting from scores to architectural efficiency, especially the efficiency of handling long context.

    2. Why Long Context Is the Next Generation of Infrastructure

    Long context is no longer an optional feature; it is infrastructure for the next generation of large models, for three reasons:

    • Test-time scaling demands very long chains of thought: models need to “think for a long time” during inference, and as context grows, attention computation grows quadratically, so costs spiral quickly.
    • Agentic workflows are inherently long-horizon: complex agent tasks and large-scale cross-document analysis require the model to maintain state and consistency across very long contexts. Low efficiency means these workflows cannot run, and what cannot run has no commercial value.
    • Online post-training depends on a long horizon: longer context is needed to support more complex online post-training and self-improvement loops.

    One technical report states plainly that the emergence of long-horizon scenarios and tasks makes efficient support for very long context critical to future progress. It also notes that while some recent open-source efforts have advanced general capabilities, inefficient core architectures remain a key obstacle when processing very long sequences, limiting the gains from test-time scaling and blocking exploration of long-horizon scenarios. In other words, whoever breaks through on long context first can advance both training and productization faster.

    3. The Root Bottleneck: Quadratic Attention Complexity

    The core constraint on context is that the computational and memory complexity of the Transformer attention mechanism grows with the square of sequence length. Double the sequence, and attention overhead roughly quadruples, while the KV cache expands linearly, putting pressure on both bandwidth and capacity. Compression is therefore inevitable, but how you compress determines the height of the innovation.

    4. Paradigm Shift One: Redefining Compression, from Thinner to Shorter

    The common compression approach in the industry is to make things “thinner”: reduce channel dimensions, cut the number of attention heads, or quantize the KV cache. This essentially narrows the information width of each token. The limitation is that information is diluted, long-range dependencies still have to be computed over the full sequence, and the complexity does not fundamentally drop.

    V4 takes the “shorter” path: it works on the sequence dimension by compressing the attention span so the model interacts only with a shorter representation, reducing quadratic complexity to near-linear. It can be abstracted as:

    1. # Illustration: sequence-dimension compression (shorter) vs. channel-dimension compression (thinner)
    2. # Thinner: reduce d_k / number of heads, complexity stays O(n^2)
    3. # Shorter: aggregate n tokens into m compressed slots (m << n)
    4. compressed_kv = compress_over_sequence(kv, target_len=m) # O(n) preprocessing
    5. out = attention(q, compressed_kv) # O(n*m) ≈ near-linear

    The key to “shorter” is that compression must be learnable and recoverable, not simple truncation or pooling, otherwise long-range detail is lost.

    5. Paradigm Shift Two: The Dual Paths of CSA and HCA

    The most important technical innovation in V4 is the pair of routes for handling attention compression, CSA and HCA, which reflect a judgment about the next high ground:

    • CSA (Compressed Span Attention): splits a long sequence into blocks, keeps fine detail within blocks and compresses across blocks, carrying global information in a small number of compressed slots to achieve near-linear complexity.
    • HCA (Hierarchical Compressed Attention): uses multiple levels of abstraction, with lower layers preserving local detail and higher layers progressively compressing into a global summary, balancing local precision with a global view.

    Both share the same idea: rewrite “pairwise interaction across the full sequence” as “query-to-compressed-representation” interaction, and learn compression and recovery during training, so long context strikes a balance between efficiency and quality.

    6. Paradigm Shift Three: Long Context as a Unified Foundation for Training and Inference

    The third paradigm shift elevates long context from an inference-time feature to training-time infrastructure: a long horizon supports longer chains of thought, more complex agent trajectories, and online post-training loops, forming a positive cycle of “longer context → stronger reasoning → better tasks → better training.” This requires engineering support: sequence parallelism in distributed training, KV cache tiering and offloading, and general-purpose capabilities commonly used on Baidu AI Cloud, such as object storage, message queues, container platforms, log services, and monitoring and alerting, to carry long-trajectory data and elastic compute.

    7. Implementation and Evaluation Recommendations

    • Upgrade evaluation dimensions: beyond general leaderboards, add long-context retrieval, cross-document reasoning, long-horizon agent task completion rate, and cost per token.
    • Choose a compression strategy: for local tasks, prioritize “thinner” to cut costs; for long-horizon tasks, prioritize “shorter” approaches such as CSA/HCA.
    • Observability: use log services and monitoring and alerting to track KV cache hit rate, compression ratio, and long-task success rate.

    8. Conclusion

    As leaderboards converge, the real competition turns to architectural efficiency. The compression paradigm represented by CSA/HCA, the shift “from thinner to shorter,” and the judgment to treat long context as infrastructure are the paradigm-level innovations worth continued attention from developers and enterprises.