ACL Findings2025
Training Long-Context LLMs Efficiently via Chunk-wise Optimization
Wenhao Li, Yuxin Zhang, Gen Luo, Daohai Yu, Rongrong Ji
Abstract
While long-context large language models (LLMs) exhibit remarkable document processing capabilities, their prohibitively high training costs often hinder customized applications. To mitigate this issue, we propose Sequential Chunk-wise Optimization (SeCO), a memory-efficient training paradigm that partitions lengthy inputs into manageable chunks. Each chunk independently constructs its computational graph and performs localized backpropagation, ensuring that only one chunk's forward activations are stored in memory. Building on SeCO, we further introduce Sparse Chunk-wise Optimization (SpaCO), which reduces computational overhead by selectively propagating gradients to specific chunks and incorporates a carefully designed compensation factor to ensure unbiased gradient estimation. SpaCO decouples the computational cost of backpropagation from the context length, enabling training time to gradually converge to inference time as sequences become longer. Implemented as lightweight training wrappers, both SeCO and SpaCO offer substantial practical benefits. For example, when fine-tuning an 8B model with LoRA on a single RTX 3090 GPU, SeCO expands maximum sequence length from 1K to 16K tokens, while SpaCO demonstrates accelerated training speed-achieving up to 3× faster than SeCO under the same experimental setup. These innovations provide new insights into optimizing long-context models, making them more accessible for practical applications. We have open-sourced the code at here.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
1 top-tier paper has cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Out of the Memory Barrier: A Highly Memory-Efficient Training System for LLMs with Million-Token Contexts cites YaRN: Efficient Context Window Extension of Large Language Models
- Out of the Memory Barrier: A Highly Memory-Efficient Training System for LLMs with Million-Token Contexts cites FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
- Out of the Memory Barrier: A Highly Memory-Efficient Training System for LLMs with Million-Token Contexts cites Efficient Memory Management for Large Language Model Serving with PagedAttention
- Out of the Memory Barrier: A Highly Memory-Efficient Training System for LLMs with Million-Token Contexts cites LongLoRA: Efficient Fine-tuning of Long-Context Large Language Models
- LongLoRA: Efficient Fine-tuning of Long-Context Large Language Models cites LoRA: Low-Rank Adaptation of Large Language Models
- LongLoRA: Efficient Fine-tuning of Long-Context Large Language Models cites YaRN: Efficient Context Window Extension of Large Language Models
- LongLoRA: Efficient Fine-tuning of Long-Context Large Language Models cites FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
Cited by top-tier papers1
Builds on7
- LoRA: Low-Rank Adaptation of Large Language ModelsEdward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu et al.ICLR 2022 · 18,833 citations
- FlashAttention-2: Faster Attention with Better Parallelism and Work PartitioningTri DaoICLR 2024 · 2,600 citations
- Efficient Memory Management for Large Language Model Serving with PagedAttentionWoosuk Kwon, Zhuohan Li, Siyuan Zhuang, Ying Sheng et al.SOSP 2023 · 1,016 citations
- YaRN: Efficient Context Window Extension of Large Language ModelsBowen Peng, Jeffrey Quesnelle, Honglu Fan, Enrico ShippoleICLR 2024 · 508 citations
- LongLoRA: Efficient Fine-tuning of Long-Context Large Language ModelsYukang Chen, Shengju Qian, Haotian Tang, Xin Lai et al.ICLR 2024 · 254 citations
Related papers
- LLoCO: Learning Long Contexts OfflineSijun Tan, Xiuyu Li, Shishir G. Patil, Ziyang Wu et al.EMNLP 2024 · 3 citations
- AutoSP: Unlocking Long-Context LLM Training Via Compiler-Based Sequence ParallelismAhan Gupta, Zhihao Wang, Neel Dani, Masahiro Tanaka et al.ICLR 2026 · 1 citation
- Efficient Long Context Fine-tuning with Chunk FlowXiulong Yuan, Hongtao Xu, Wenting Shen, Ang Wang et al.ICML 2025
- PoSE: Efficient Context Window Extension of LLMs via Positional Skip-wise TrainingDawei Zhu, Nan Yang, Liang Wang, Yifan Song et al.ICLR 2024 · 110 citations
- LoCoCo: Dropping In Convolutions for Long Context CompressionRuisi Cai, Yuandong Tian, Zhangyang Wang, Beidi ChenICML 2024 · 17 citations
