paper-with-me

Papers

Extending LLMs' Context Window with 100 Samples

2024-01-13 · Yikai Zhang, Junlong Li, PengFei Liu

Large Language Models (LLMs) are known to have limited extrapolation ability beyond their pre-trained context window, constraining their application in downstream tasks with lengthy inputs. Recent studies have sought to extend LLMs' context window by modifying rotary position embedding (RoPE), a popular position encoding method adopted by well-known LLMs such as LLaMA, PaLM, and GPT-NeoX. However, prior works like Position Interpolation (PI) and YaRN are resource-intensive and lack comparative experiments to assess their applicability. In this work, we identify the inherent need for LLMs' attention entropy (i.e. the information entropy of attention scores) to maintain stability and introduce a novel extension to RoPE which combines adjusting RoPE's base frequency and scaling the attention logits to help LLMs efficiently adapt to a larger context window. We validate the superiority of our method in both fine-tuning performance and robustness across different context window sizes on various context-demanding tasks. Notably, our method extends the context window of LLaMA-2-7B-Chat to 16,384 with only 100 samples and 6 training steps, showcasing extraordinary efficiency. Finally, we also explore how data compositions and training curricula affect context window extension for specific downstream tasks, suggesting fine-tuning LLMs with lengthy conversations as a good starting point. We release our code and SFT data at https://github.com/GAIR-NLP/Entropy-ABF.

📄 PDF Abstract BibTeX arXiv:2401.07004

Code (1)

gair-nlp/entropy-abf 공식 구현 pytorch

Tasks

Position

Methods 이 논문이 사용한 방법론

PaLM 설명 없음
BASE 설명 없음
SFT Shrink and Fine-Tune, or SFT, is a type of distillation that avoids explicit distillation by copying parameters to a student student model and then fine-tuning.…
GPT-NeoX GPT-NeoX is an autoregressive transformer decoder model whose architecture largely follows that of GPT-3, with a few notable deviations. The model has 20 billion parameters…

Similar Papers 제목 키워드 기반

Extending Context Window of Large Language Models from a Distributional Perspective

2024-10-02 · Yingsheng Wu, Yuxuan Gu, Xiaocheng Feng, Weihong Zhong 외

Scaling the rotary position embedding (RoPE) has become a common method for extending the context window of RoPE-based large language models (LLMs). However, existing scaling methods often rely on empirical approaches an…

16k8k

LongRecipe: Recipe for Efficient Long Context Generalization in Large Language Models

2024-08-31 · Zhiyuan Hu, Yuliang Liu, Jinman Zhao, Suyuchen Wang 외

Large language models (LLMs) face significant challenges in handling long-context tasks because of their limited effective context window size during pretraining, which restricts their ability to generalize over extended…

8kGPU

CLEX: Continuous Length Extrapolation for Large Language Models

2023-10-25 · Guanzheng Chen, Xin Li, Zaiqiao Meng, Shangsong Liang 외

Transformer-based Large Language Models (LLMs) are pioneering advances in many natural language processing tasks, however, their exceptional capabilities are restricted within the preset context window of Transformer. Po…

4kPosition

CoCA: Fusing Position Embedding with Collinear Constrained Attention in Transformers for Long Context Window Extending

2023-09-15 · Shiyi Zhu, Jing Ye, Wei Jiang, Siqiao Xue 외

Self-attention and position embedding are two key modules in transformer-based Large Language Models (LLMs). However, the potential relationship between them is far from well studied, especially for long context window e…

2kPosition

Retrieval meets Long Context Large Language Models

2023-10-04 · Peng Xu, Wei Ping, Xianchao Wu, Lawrence McAfee 외

Extending the context window of large language models (LLMs) is getting popular recently, while the solution of augmenting LLMs with retrieval has existed for years. The natural questions are: i) Retrieval-augmentation v…

16k4kFew-Shot LearningNatural Questions+2