Perché la lunghezza del contesto efficace dei LLMs è insufficiente?
Why Does the Effective Context Length of LLMs Fall Short?
October 24, 2024
Autori: Chenxin An, Jun Zhang, Ming Zhong, Lei Li, Shansan Gong, Yao Luo, Jingjing Xu, Lingpeng Kong
cs.AI
Abstract
I progressi nel training distribuito e nei meccanismi di attenzione efficienti hanno notevolmente ampliato le dimensioni della finestra di contesto dei grandi modelli linguistici (LLM). Tuttavia, recenti lavori rivelano che le lunghezze di contesto effettive dei LLM open-source spesso risultano limitate, di solito non superando la metà delle loro lunghezze di training. In questo lavoro, attribuiamo questa limitazione alla distribuzione della frequenza spostata a sinistra delle posizioni relative formate nelle fasi di pretraining e post-training dei LLM, che ostacola la capacità di raccogliere efficacemente informazioni distanti. Per affrontare questa sfida, introduciamo ShifTed Rotray position embeddING (STRING). STRING sposta le posizioni ben addestrate per sovrascrivere le posizioni originali inefficaci durante l'inferenza, migliorando le prestazioni entro le loro lunghezze di training esistenti. I risultati sperimentali mostrano che senza ulteriore training, STRING migliora drasticamente le prestazioni dei più recenti modelli su larga scala, come Llama3.1 70B e Qwen2 72B, di oltre 10 punti sui popolari benchmark di contesto lungo RULER e InfiniteBench, stabilendo nuovi risultati state-of-the-art per i LLM open-source. Rispetto ai modelli commerciali, Llama 3.1 70B con \method raggiunge addirittura prestazioni migliori rispetto a GPT-4-128K e supera chiaramente Claude 2 e Kimi-chat.
English
Advancements in distributed training and efficient attention mechanisms have
significantly expanded the context window sizes of large language models
(LLMs). However, recent work reveals that the effective context lengths of
open-source LLMs often fall short, typically not exceeding half of their
training lengths. In this work, we attribute this limitation to the left-skewed
frequency distribution of relative positions formed in LLMs pretraining and
post-training stages, which impedes their ability to effectively gather distant
information. To address this challenge, we introduce ShifTed Rotray position
embeddING (STRING). STRING shifts well-trained positions to overwrite the
original ineffective positions during inference, enhancing performance within
their existing training lengths. Experimental results show that without
additional training, STRING dramatically improves the performance of the latest
large-scale models, such as Llama3.1 70B and Qwen2 72B, by over 10 points on
popular long-context benchmarks RULER and InfiniteBench, establishing new
state-of-the-art results for open-source LLMs. Compared to commercial models,
Llama 3.1 70B with \method even achieves better performance than GPT-4-128K and
clearly surpasses Claude 2 and Kimi-chat.Summary
AI-Generated Summary