Training-Free Long-Context Scaling of Large Language Models

Chen An, Fei Huang, Jun Zhang, Shansan Gong, Xipeng Qiu +2 more
2/12/2026

No official code found. Best implementation: HKUNLP/ChunkLlama (450 stars, Apache-2.0, last commit 2024-10-16).

Abstract

The ability of Large Language Models (LLMs) to process and generate coherent text is markedly weakened when the number of input tokens exceeds their pretraining length. Given the expensive overhead of finetuning large-scale models with longer sequences, we propose Dual Chunk Attention (DCA), which enables Llama2 70B to support context windows of more than 100k tokens without continual training. By decomposing the attention computation for long sequences into chunk-based modules, DCA manages to effectively capture the relative positional information of tokens within the same chunk (Intra-Chunk) and across distinct chunks (Inter-Chunk), as well as integrates seamlessly with Flash Attention. In addition to its impressive extrapolation capability, DCA achieves performance on practical long-context tasks that is comparable to or even better than that of finetuned models. When compared with proprietary models, our training-free 70B model attains 94% of the performance of gpt-3.5-16k, indicating it is a viable open-source alternative. All code and data used in this work are released at \url{https://github.com/HKUNLP/ChunkLlama}.

View on arXivView PDF

Code Implementations(1)

HKUNLP/ChunkLlamaCommunity100%
Apache-2.0

[ICML'24] Data and code for our paper "Training-Free Long-Context Scaling of Large Language Models"

45023C, C++Feb 19, 20242 years agoApache-2.0

Cite this paper

@article{an2026trainingfree,
  title  = {Training-Free Long-Context Scaling of Large Language Models},
  author = {Chen An and Fei Huang and Jun Zhang and Shansan Gong and Xipeng Qiu and Chang Zhou and Lingpeng Kong},
  year   = {2026},
  eprint = {2402.17463},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2402.17463},
  journal = {ICML 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2402.17463.svg)](https://codeofpaper.com/paper/2402.17463)

Discussion