Proceedings

Beyond the Limits: A Survey of Techniques to Extend the Context Length in Large Language Models

Download BibTeX Cite

Proceedings of the Thirty-Third International Joint Conference on Artificial Intelligence. Survey Track. Pages 8299-8307.

https://doi.org/10.24963/ijcai.2024/917

Abstract

Recently, large language models (LLMs) have shown remarkable capabilities including understanding context, engaging in logical reasoning, and generating responses. However, this is achieved at the expense of stringent computational and memory requirements, hindering their ability to effectively support long input sequences. This survey provides an inclusive review of the recent techniques and methods devised to extend the sequence length in LLMs, thereby enhancing their capacity for long-context understanding. In particular, we review and categorize a wide range of techniques including architectural modifications, such as modified positional encoding and altered attention mechanisms, which are designed to enhance the processing of longer sequences while avoiding a proportional increase in computational cost. The diverse methodologies investigated in this study can be leveraged across different phases of LLMs, i.e., training, fine-tuning and inference. This enables LLMs to efficiently process extended sequences. The limitations of the current methodologies is discussed in the last section along with the suggestions for future research directions, underscoring the importance of sequence length in the continued advancement of LLMs.

  1. [Ainslie et al., 2023] Joshua Ainslie, James Lee-Thorp, et al. GQA: Training generalized multi-query transformer mod- els from multi-head checkpoints. In EMNLP, 2023.
  2. [Alizadeh et al., 2023] Keivan Alizadeh, Iman Mirzadeh, et al. LLM in a flash: Efficient large language model in- ference with limited memory. arXiv:2312.11514, 2023.
  3. [Anil et al., 2023] Rohan Anil, Andrew M Dai, et al. PaLM 2 technical report. arXiv:2305.10403, 2023.
  4. [Beltagy et al., 2020] Iz Beltagy, Matthew E Peters, and Ar- man Cohan. Longformer: The long-document trans- former. arXiv:2004.05150, 2020.
  5. [Brown et al., 2020] Tom B. Brown, Benjamin Mann, et al. Language models are few-shot learners. In NeurIPS, 2020.
  6. [Chen et al., 2021] Pu-Chin Chen, Henry Tsai, et al. A sim- ple and effective positional encoding for transformers. In EMNLP, 2021.
  7. [Chen et al., 2023] Shouyuan Chen, Sherman Wong, et al. Extending context window of large language models via positional interpolation. arXiv:2306.15595, 2023.
  8. [Chen et al., 2024] Guanzheng Chen, Xin Li, et al. CLEX: Continuous length extrapolation for large language mod- els. In ICLR, 2024.
  9. [Choromanski et al., 2021] Krzysztof M. Choromanski, Va- lerii Likhosherstov, et al. Rethinking attention with per- formers. In ICLR, 2021.
  10. [Chowdhery et al., 2024] Aakanksha Chowdhery, Sharan Narang, et al. PaLM: scaling language modeling with pathways. JMLR, 2024.
  11. [Dao et al., 2022] Tri Dao, Dan Fu, et al. Flashatten- tion: Fast and memory-efficient exact attention with io- awareness. In NeurIPS, 2022.
  12. [Dao et al., 2023] Tri Dao, Daniel Haziza, et al. Flash- Decoding for long-context inference, 2023.
  13. [de Jong et al., 2023] Michiel de Jong, Yury Zemlyanskiy, et al. FiDO: Fusion-in-decoder optimized for stronger per- formance and faster inference. In Findings of ACL, 2023.
  14. [Dettmers et al., 2022] Tim Dettmers, Mike Lewis, et al. LLM.int8(): 8-bit matrix multiplication for transformers at scale. In NeurIPS, 2022.
  15. [Ding et al., 2023] Jiayu Ding, Shuming Ma, et al. LongNet: Scaling transformers to 1,000,000,000 to- kens. arXiv:2307.02486, 2023.
  16. [Frantar and Alistarh, 2023] Elias Frantar and Dan Alistarh. SparseGPT: Massive language models can be accurately pruned in one-shot. In ICML, 2023.
  17. [Frantar et al., 2023] Elias Frantar, Saleh Ashkboos, et al. OPTQ: Accurate quantization for generative pre-trained transformers. In ICLR, 2023.
  18. [Fu et al., 2023] Daniel Y Fu, Tri Dao, et al. Hungry Hun- gry Hippos: Towards language modeling with state space models. In ICLR, 2023.
  19. [Gholami et al., 2022] Amir Gholami, Sehoon Kim, et al. A survey of quantization methods for efficient neural net- work inference. In Low-Power Computer Vision, 2022.
  20. [Gu and Dao, 2023] Albert Gu and Tri Dao. Mamba: Linear-time sequence modeling with selective state spaces. arXiv:2312.00752, 2023.
  21. Gu et al., ] A. Gu, T. Dao, et al. HiPPO: Recurrent memory with optimal polynomial projections. In NeurIPS,2020.
  22. [Gu et al., 2022] Albert Gu, Karan Goel, and Christopher Re. Efficiently modeling long sequences with structured state spaces. In ICLR, 2022.
  23. [Hao et al., 2022] Yaru Hao, Yutao Sun, et al. Structured prompting: Scaling in-context learning to 1,000 examples. arXiv:2212.06713, 2022.
  24. [Hong et al., 2023] Ke Hong, Guohao Dai, et al. FlashDe- coding++: Faster large language model inference on gpus. arXiv:2311.01282, 2023.
  25. [Huang et al., 2023] Yunpeng Huang, Jingwei Xu, et al. Advancing transformer architecture in long-context large language models: A comprehensive survey. arXiv:2311.12351, 2023.
  26. [Jiang et al., 2023a] Huiqiang Jiang, Qianhui Wu, et al. LLMLingua: Compressing prompts for accelerated infer- ence of large language models. In EMNLP, 2023.
  27. [Jiang et al., 2023b] Huiqiang Jiang, Qianhui Wu, et al. LongLLMLingua: Accelerating and enhancing LLMs in long context scenarios via prompt compression. arXiv:2310.06839, 2023.
  28. [Kitaev et al., 2020] Nikita Kitaev, Lukasz Kaiser, et al. Re- former: The efficient transformer. In ICLR, 2020.
  29. [Koohpayegani and Pirsiavash, 2024] Soroush A. Kooh- payegani and Hamed Pirsiavash. SimA: Simple softmax- free attention for vision transformers. In WACV, 2024.
  30. [Kwan et al., 2023] Wai-Chung Kwan, Xingshan Zeng, et al. M4LE: A multi-ability multi-range multi-task multi- domain long-context evaluation benchmark for large lan- guage models. arXiv:2310.19240, 2023.
  31. [Kwon et al., 2023] Woosuk Kwon, Zhuohan Li, et al. Effi- cient memory management for large language model serv- ing with pagedattention. In SOSP, 2023.
  32. [Lee et al., 2024] Changhun Lee, Jungyu Jin, et al. OWQ: Outlier-aware weight quantization for efficient fine-tuning and inference of large language models. In AAAI, 2024.
  33. [Li et al., 2019] Shiyang Li, Xiaoyong Jin, et al. Enhancing the locality and breaking the memory bottleneck of trans- former on time series forecasting. In NeurIPS, 2019.
  34. [Li et al., 2023a] Raymond Li, Loubna Ben allal, et al. Star- Coder: may the source be with you! TMLR, 2023.
  35. [Li et al., 2023b] Yucheng Li, Bo Dong, et al. Compressing context to enhance inference efficiency of large language models. In EMNLP, 2023.
  36. [Lin et al., 2024] Ji Lin, Jiaming Tang, et al. AWQ: Activation-aware weight quantization for LLM compres- sion and acceleration. In MLSys, 2024.
  37. [Liu and Abbeel, 2023] Hao Liu and Pieter Abbeel. Block- wise parallel transformers for large context models. In NeurIPS, 2023.
  38. [Liu et al., 2023a] Hao Liu, Matei Zaharia, and Pieter Abbeel. Ring attention with blockwise transformers for near-infinite context. In NeurIPS FMDM Workshop, 2023.
  39. [Liu et al., 2023b] Zechun Liu, Barlas Oguz, et al. LLM- QAT: Data-free quantization aware training for large lan- guage models. arXiv:2305.17888, 2023.
  40. [Lu et al., 2021] Jiachen Lu, Jinghan Yao, et al. SOFT: Softmax-free transformer with linear complexity. In NeurIPS, 2021.
  41. [Ma et al., 2023a] Xinyin Ma, Gongfan Fang, and Xinchao Wang. LLM-Pruner: On the structural pruning of large language models. In NeurIPS, 2023.
  42. [Ma et al., 2023b] Xuezhe Ma, C. Zhou, et al. MEGA: Mov- ing average equipped gated attention. In ICLR, 2023.
  43. [Naveed et al., 2023] Humza Naveed, Asad Ullah Khan, et al. A comprehensive overview of large language mod- els. arXiv:2307.06435, 2023.
  44. [Orvieto et al., 2023] Antonio Orvieto, Samuel L Smith, et al. Resurrecting recurrent neural networks for long se- quences. In ICML, 2023.
  45. [Packer et al., 2023] Charles Packer, Vivian Fang, et al. MemGPT: Towards LLMs as operating systems. arXiv:2310.08560, 2023.
  46. [Peng et al., 2023a] Bo Peng, Eric Alcaide, et al. RWKV: Reinventing RNNs for the transformer era. In Findings of EMNLP, 2023.
  47. [Peng et al., 2023b] Bowen Peng, Jeffrey Quesnelle, et al. YaRN: Efficient context window extension of large lan- guage models. In ICLR, 2023.
  48. [Poli et al., 2023] Michael Poli, Stefano Massaroli, et al. Hyena Hierarchy: towards larger convolutional language models. In ICML, 2023.
  49. [Pope et al., 2023] Reiner Pope, Sholto Douglas, et al. Effi- ciently scaling transformer inference. MLSys, 2023.
  50. [Press et al., 2022] Ofir Press, Noah Smith, and Mike Lewis. Train short, test long: Attention with linear biases enables input length extrapolation. In ICLR, 2022.
  51. [Qin et al., 2022] Zhen Qin, Weixuan Sun, et al. cosFormer: Rethinking softmax in attention. In ICLR, 2022.
  52. [Qiu et al., 2020] Jiezhong Qiu, Hao Ma, et al. Blockwise self-attention for long document understanding. In Find- ings of EMNLP, 2020.
  53. [Ratner et al., 2023] Nir Ratner, Yoav Levine, et al. Parallel context windows for large language models. In ACL, 2023.
  54. [Roy et al., 2021] Aurko Roy, Mohammad Saffar, et al. Ef- ficient content-based sparse attention with routing trans- formers. TACL, 2021.
  55. [Saragadam et al., 2022] Vishwanath Saragadam, Randall Balestriero, et al. DeepTensor: Low-rank tensor decompo- sition with deep network priors. arXiv:2204.03145, 2022.
  56. [Shaw et al., 2018] Peter Shaw, Jakob Uszkoreit, and Ashish Vaswani. Self-attention with relative position representa- tions. In NAACL, 2018.
  57. [Shazeer, 2019] Noam Shazeer. Fast transformer decoding: One write-head is all you need. arXiv:1911.02150, 2019.
  58. [Shen et al., 2023] Kai Shen, J. Guo, et al. A study on ReLU and softmax in transformer. arXiv:2302.06461, 2023.
  59. [Su et al., 2024] Jianlin Su, Murtadha Ahmed, et al. Ro- former: Enhanced transformer with rotary position embed- ding. Neurocomputing, 2024.
  60. [Sun et al., 2023a] Mingjie Sun, Zhuang Liu, et al. A simple and effective pruning approach for large language models. In Workshop on ES-FoMo @ ICML2023, 2023.
  61. [Sun et al., 2023b] Yutao Sun, Li Dong, et al. A length- extrapolatable transformer. In ACL, 2023.
  62. [Sun et al., 2023c] Yutao Sun, Li Dong, et al. Retentive Net- work: A successor to transformer for large language mod- els. arXiv:2307.08621, 2023.
  63. [Touvron et al., 2023] Hugo Touvron, Thibaut Lavril, et al. LLaMA: Open and efficient foundation language models. ArXiv, abs/2302.13971, 2023.
  64. [Vaswani et al., 2017] Ashish Vaswani, Noam Shazeer, et al. Attention is all you need. In NeurIPS, 2017.
  65. [Wan et al., 2023] Z. Wan, X. Wang, et al. Efficient large language models: A survey. arXiv:2312.03863, 2023.
  66. [Wang et al., 2020] Sinong Wang, Belinda Z Li, et al. Linformer: Self-attention with linear complexity. arXiv:2006.04768, 2020.
  67. [Wang et al., 2023] Xindi Wang, Yufei Wang, et al. Inves- tigating the learning behaviour of in-context learning: A comparison with supervised learning. ECAI, 2023.
  68. [Winata et al., 2020] Genta Indra Winata, Samuel Cahyaw- ijaya, et al. Lightweight and efficient end-to-end speech recognition using low-rank transformer. In ICASSP, 2020.
  69. [Wu et al., 2021] Haixu Wu, Jiehui Xu, et al. Auto- former: Decomposition transformers with auto-correlation for long-term series forecasting. In NeurIPS, 2021.
  70. [Xia et al., 2024] Mengzhou Xia, Tianyu Gao, et al. Sheared LLaMA: Accelerating language model pre-training via structured pruning. In ICLR, 2024.
  71. [Xiao et al., 2024] G. Xiao, Y. Tian, et al. Efficient streaming language models with attention sinks. In ICLR, 2024.
  72. [Zhai et al., 2021] Shuangfei Zhai, Walter Talbott, et al. An attention free transformer. arXiv:2105.14103, 2021.
  73. [Zhao et al., 2023] Wayne Xin Zhao, Kun Zhou, et al. A sur- vey of large language models, 2023.
  74. [Zhu et al., 2023] Xunyu Zhu, Jian Li, et al. A sur- vey on model compression for large language models. arXiv:2308.07633, 2023.
  75. [Zhuang et al., 2023] Bohan Zhuang, Jing Liu, et al. A sur- vey on efficient training of transformers. In IJCAI, 2023. IJCAI

References were extracted automatically from the PDF and may contain errors.

Welcome Future Conferences AI Journal Division IJCAI Proceedings About IJCAI IJCAI Awards