E^2-LLM: Efficient and Extreme Length Extension of Large Language Models (2401.06951v3)
Abstract: Typically, training LLMs with long context sizes is computationally expensive, requiring extensive training hours and GPU resources. Existing long-context extension methods usually need additional training procedures to support corresponding long-context windows, where the long-context training data (e.g., 32k) is needed, and high GPU training costs are assumed. To address the aforementioned issues, we propose an Efficient and Extreme length extension method for LLMs, called E 2 -LLM, with only one training procedure and dramatically reduced computation cost, which also removes the need to collect long-context data. Concretely, first, the training data of our E 2 -LLM only requires a short length (e.g., 4k), which reduces the tuning cost greatly. Second, the training procedure on the short training context window is performed only once time, and we can support different evaluation context windows at inference. Third, in E 2 - LLM, based on RoPE position embeddings, we introduce two different augmentation methods on the scale and position index parameters for different samples in training. It aims to make the model more robust to the different relative differences when directly interpolating the arbitrary context length at inference. Comprehensive experimental results on multiple benchmark datasets demonstrate the effectiveness of our E 2 -LLM on challenging long-context tasks.
- 2023. Ntk-aware scaled rope.
- Proof-pile.
- Longbench: A bilingual, multitask benchmark for long context understanding. arXiv preprint arXiv:2308.14508.
- Longformer: The long-document transformer. CoRR, abs/2004.05150.
- Recurrent memory transformer. In NeurIPS.
- Extending context window of large language models via positional interpolation. CoRR, abs/2306.15595.
- Longlora: Efficient fine-tuning of long-context large language models. arXiv:2309.12307.
- A discourse-aware attention model for abstractive summarization of long documents. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers), pages 615–621, New Orleans, Louisiana. Association for Computational Linguistics.
- Tri Dao. 2023. Flashattention-2: Faster attention with better parallelism and work partitioning. CoRR, abs/2307.08691.
- Longnet: Scaling transformers to 1, 000, 000, 000 tokens. CoRR, abs/2307.02486.
- The pile: An 800gb dataset of diverse text for language modeling. arXiv preprint arXiv:2101.00027.
- Lm-infinite: Simple on-the-fly length generalization for large language models. CoRR, abs/2308.16137.
- Few-shot learning with retrieval augmented language models. CoRR, abs/2208.03299.
- Dense passage retrieval for open-domain question answering. In EMNLP, pages 6769–6781.
- Reformer: The efficient transformer. In ICLR.
- How long can open-source llms truly promise on context length?
- Ilya Loshchilov and Frank Hutter. 2019. Decoupled weight decay regularization. In ICLR.
- Amirkeivan Mohtashami and Martin Jaggi. 2023. Landmark attention: Random-access infinite context length for transformers. CoRR, abs/2305.16300.
- OpenAI. 2022. Introducing chatgpt.
- Yarn: Efficient context window extension of large language models. CoRR, abs/2309.00071.
- Train short, test long: Attention with linear biases enables input length extrapolation. In ICLR.
- Deepspeed: System optimizations enable training deep learning models with over 100 billion parameters. In KDD, pages 3505–3506. ACM.
- Roformer: Enhanced transformer with rotary position embedding. CoRR, abs/2104.09864.
- Llama: Open and efficient foundation language models. CoRR, abs/2302.13971.
- Llama 2: Open foundation and fine-tuned chat models. CoRR, abs/2307.09288.
- Linformer: Self-attention with linear complexity. CoRR, abs/2006.04768.
- Memorizing transformers. In ICLR.
- Efficient streaming language models with attention sinks. arXiv.
- Big bird: Transformers for longer sequences. In NeurIPS.
- Judging llm-as-a-judge with mt-bench and chatbot arena.