A Review of Long-Context Processing Ability in Large Language Models: Technical Progress and Challenges
Abstract
In recent years, large language models (LLMs) have achieved significant results in natural language processing. They are applied to various tasks, including text generation, question answering, automatic summarization, code generation, and complex reasoning. With the increasingly complex real scenarios, the length of input text that models need to deal with also grows. Thus, the long-context processing ability of language models has gradually become an important factor in evaluating the practicability of LLMs. This paper gives an introduction to the long-context processing ability of large language models. It first introduces the background of large language models and the basic concept of long-context processing. It then summarizes the main technical methods of long-context modeling, such as improving positional encoding, training stage expansion, inference-stage optimization, and architecture-level innovation. Third, the paper also discusses the use of long-context ability in long-document question answering, long-text summarization, multi-document integration, code understanding and long-context evaluation tasks. Then, summarize the current main challenges and prospects of research work. This paper argues that the ability of long context should not only come from increasing the context window, but also from the ability of the model to locate, integrate and reason about important information in long text.
References
- Vaswani, A., Shazeer, N., Parmar, N., et al. (2017). Attention is all you need.Advances in Neural Information Processing Systems, 30, 5998–6008.
- Devlin, J., Chang, M. W., Lee, K., et al. (2019). BERT: Pre-training of deep bidirectional transformers for language understanding.Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, 4171–4186.
- Brown, T. B., Mann, B., Ryder, N., et al. (2020). Language models are few-shot learners.Advances in Neural Information Processing Systems, 33, 1877–1901.
- Dai, Z., Yang, Z., Yang, Y., et al. (2019). Transformer-XL: Attentive language models beyond a fixed-length context.Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, 2978–2988.
- Beltagy, I., Peters, M. E., & Cohan, A. (2020). Longformer: The long-document transformer.arXiv preprint arXiv:2004.05150.
- Zaheer, M., Guruganesh, G., Dubey, K. A., et al. (2020). Big Bird: Transformers for longer sequences.Advances in Neural Information Processing Systems, 33, 17283–17297.
- Liu, N. F., Lin, K., Hewitt, J., et al. (2024). Lost in the middle: How language models use long contexts.Transactions of the Association for Computational Linguistics, 12, 157–173.
- Lewis, P., Perez, E., Piktus, A., et al. (2020). Retrieval-augmented generation for knowledge-intensive NLP tasks.Advances in Neural Information Processing Systems, 33, 9459–9474.
- Press, O., Smith, N. A., & Lewis, M. (2022). Train short, test long: Attention with linear biases enables input length extrapolation.International Conference on Learning Representations.
- Chen, S., Wong, S., Chen, L., et al. (2023). Extending context window of large language models via positional interpolation.arXiv preprint arXiv:2306.15595.
- Peng, B., Quesnelle, J., Fan, H., et al. (2024). YaRN: Efficient context window extension of large language models.International Conference on Learning Representations.
- Zhu, D., Yang, N., Wang, L., et al. (2024). PoSE: Efficient context window extension of LLMs via positional skip-wise training.International Conference on Learning Representations.
- Chen, G., Li, X., Meng, Z., et al. (2024). CLEX: Continuous length extrapolation for large language models.International Conference on Learning Representations.
- Xiao, G., Tian, Y., Chen, B., et al. (2024). Efficient streaming language models with attention sinks.International Conference on Learning Representations.
- Han, C., Wang, Q., Peng, H., et al. (2024). LM-Infinite: Zero-shot extreme length generalization for large language models.Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, 3991-4008.
- Tworkowski, S., Staniszewski, K., Pacek, M., et al. (2023). Focused transformer: Contrastive training for context scaling.arXiv preprint arXiv:2307.03170.
- Zhang, Z., Sheng, Y., Zhou, T., et al. (2023). H2O: Heavy-Hitter Oracle for efficient generative inference of large language models.Advances in Neural Information Processing Systems, 36, 34661-34710.
- Gu, A., & Dao, T. (2023). Mamba: Linear-time sequence modeling with selective state spaces.arXiv preprint arXiv:2312.00752.
- Sun, Y., Dong, L., Huang, S., et al. (2023). Retentive network: A successor to Transformer for large language models.arXiv preprint arXiv:2307.08621.
- Peng, B., Alcaide, E., Anthony, Q., et al. (2023). RWKV: Reinventing RNNs for the Transformer era.Findings of the Association for Computational Linguistics: EMNLP 2023, 14048–14077.
- Lieber, O., Lenz, B., Bata, H., et al. (2024). Jamba: A hybrid Transformer-Mamba language model.arXiv preprint arXiv:2403.19887.
- Glorioso, P., Anthony, Q., Tokpanov, Y., et al. (2024). Zamba: A compact 7B SSM hybrid model.arXiv preprint arXiv:2405.16712.
- Liu, H., Zaharia, M., & Abbeel, P. (2024). RingAttention with blockwise Transformers for near-infinite context.International Conference on Learning Representations.
- Dasigi, P., Lo, K., Beltagy, I., et al. (2021). A dataset of information-seeking questions and answers anchored in research papers.Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, 4599–4610.
- Bai, Y., Lv, X., Zhang, J., et al. (2024). LongBench: A bilingual, multitask benchmark for long context understanding.Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics, 3119-3137.
- Li, J., Wang, M., Zheng, Z., et al. (2024). LooGLE: Can long-context language models understand long contexts?Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics, 16304-16333.
- Huang, L., Cao, S., Parulian, N., et al. (2021). Efficient attentions for long document summarization.Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, 1419-1436.
- Kryscinski, W., Rajani, N., Agarwal, D., et al. (2022). BOOKSUM: A collection of datasets for long-form narrative summarization.Findings of the Association for Computational Linguistics: EMNLP 2022, 6536-6558.
- Yuan, T., Ning, X., Zhou, D., et al. (2024). LV-Eval: A balanced long-context benchmark with 5 length levels up to 256K.arXiv preprint arXiv:2402.05136.
- Liu, T., Xu, C., and McAuley, J. (2024). RepoBench: Benchmarking repository-level code auto-completion systems.International Conference on Learning Representations.
- Kuratov, Y., Bulatov, A., Anokhin, P., et al. (2024). BABILong: Testing the limits of LLMs with long context reasoning-in-a-haystack.arXiv preprint arXiv:2406.10149.