Decoder-Hybrid-Decoder Architecture for Efficient Reasoning with Long Generation

Liliang Ren, Congcong Chen, Haoran Xu, Young Jin Kim, Adam Atkinson, Zheng Zhan, Jiankai Sun, Baolin Peng, Liyuan Liu, Shuohang Wang, Hao Cheng, Jianfeng Gao, Weizhu Chen, yelong shen

Introduction

The emergence of complex reasoning capabilities in Large Language Models (LLMs) has increasingly relied on generating long Chains-of-Thought (CoTs). However, standard Transformer architectures face a significant computational hurdle: the Key-Value (KV) cache. As sequence lengths grow, the memory and compute costs of maintaining this cache scale linearly, creating a bottleneck that limits both the speed and feasibility of long-form generation. While alternative architectures like State Space Models (SSMs) offer linear-time complexity, they often struggle with the precise in-context retrieval required for reasoning. This paper introduces SambaY, a novel "decoder-hybrid-decoder" architecture designed to bridge this gap by efficiently sharing representations across layers.

The SambaY Architecture

SambaY addresses the KV cache bottleneck through a structured split of the network into two primary components: a self-decoder and a cross-decoder.

The SambaY architecture featuring a Self-Decoder and a Cross-Decoder with Gated Memory Units (GMUs).

The self-decoder utilizes the Samba architecture, which interleaves Mamba (an SSM) and Sliding Window Attention (SWA) layers, concluding with a single full-attention layer. This structure generates the initial KV cache. The subsequent cross-decoder is the core innovation; it replaces 50% of traditional, expensive cross-attention layers with lightweight Gated Memory Units (GMUs). These GMUs dynamically recalibrate token mixing by reading hidden states directly from the final Mamba layer of the self-decoder. By shifting from attention-based retrieval to element-wise gating for half the layers, SambaY reduces memory I/O complexity from $O(N)$ to $O(1)$ for those specific components, significantly accelerating the decoding process.

Scaling and Efficiency

To evaluate SambaY's potential fairly against established architectures, the authors developed µP++, a principled hyperparameter transfer scheme. This framework accounts for variations in depth, width, and weight decay scaling across different model types.

Scaling law comparisons for compute (a) and data (b) showing SambaY's superior performance ceiling compared to Transformer++ and YOCO baselines.

Under the µP++ framework, SambaY demonstrated a significantly lower irreducible loss compared to pure Transformers and YOCO (You Only Cache Once) baselines. This suggests that SambaY is not just more efficient but also possesses a higher performance ceiling when scaled with massive compute and data.

Experimental Results

The architecture was tested at scale with Phi4-mini-Flash-Reasoning, a 3.8B parameter model trained on a 5T token corpus. The results highlight a dramatic improvement in inference efficiency. In vLLM benchmarks, the model achieved up to 10x higher decoding throughput for long sequences (32K generation length) compared to standard baselines.

Beyond efficiency, SambaY maintains state-of-the-art reasoning performance. Despite omitting the Reinforcement Learning (RL) phase used by its predecessors, Phi4-mini-Flash-Reasoning outperformed the strong Phi4-mini-Reasoning baseline on several benchmarks:

  • AIME 24: 52.29% vs 48.13%
  • Math500: 92.45% vs 91.20%
  • GPQA Diamond: 45.08% vs 44.51%

In long-context evaluations, such as the 32K Phonebook retrieval task, SambaY variants significantly outperformed pure Transformer and YOCO models. Interestingly, the authors found that smaller Sliding Window Attention sizes (e.g., 256) actually improved retrieval accuracy, likely by forcing the model to focus on local patterns and mitigating "attention sink" issues. Furthermore, the architecture's ability to function without explicit positional encodings (NoPE) allowed it to zero-shot extrapolate its retrieval capabilities beyond its training context length.

Conclusion

SambaY represents a significant step toward efficient long-sequence reasoning. By combining the retrieval power of attention with the constant-time efficiency of GMUs and SSMs, it offers a scalable path for future LLMs. While the current implementation still retains a single full-attention layer—keeping the overall complexity technically linear—future work exploring dynamic sparse attention could push the architecture toward true constant-time decoding for extremely long-sequence applications.

Summary updated

BibTeX
@inproceedings{ren2025decoder,
  author = {Liliang Ren and Congcong Chen and Haoran Xu and Young Jin Kim and Adam Atkinson and Zheng Zhan and Jiankai Sun and Baolin Peng and Liyuan Liu and Shuohang Wang and Hao Cheng and Jianfeng Gao and Weizhu Chen and yelong shen},
  title = {{Decoder-Hybrid-Decoder Architecture for Efficient Reasoning with Long Generation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=twSE0WA1vh},
}
Figure