ChatPaper.aiChatPaper

Por que o Comprimento Efetivo do Contexto dos LLMs Deixa a Desejar?

Why Does the Effective Context Length of LLMs Fall Short?

October 24, 2024
Autores: Chenxin An, Jun Zhang, Ming Zhong, Lei Li, Shansan Gong, Yao Luo, Jingjing Xu, Lingpeng Kong
cs.AI

Resumo

Os avanços no treinamento distribuído e nos mecanismos de atenção eficientes expandiram significativamente os tamanhos das janelas de contexto dos grandes modelos de linguagem (LLMs). No entanto, trabalhos recentes revelam que os comprimentos efetivos de contexto dos LLMs de código aberto frequentemente ficam aquém, geralmente não ultrapassando a metade de seus comprimentos de treinamento. Neste trabalho, atribuímos essa limitação à distribuição de frequência enviesada para a esquerda das posições relativas formadas nas etapas de pré-treinamento e pós-treinamento dos LLMs, o que impede sua capacidade de reunir efetivamente informações distantes. Para enfrentar esse desafio, introduzimos a EMBEDDING de posição ShifTed Rotray (STRING). O STRING desloca posições bem treinadas para sobrescrever as posições originais ineficazes durante a inferência, aprimorando o desempenho dentro de seus comprimentos de treinamento existentes. Resultados experimentais mostram que, sem treinamento adicional, o STRING melhora drasticamente o desempenho dos últimos modelos em grande escala, como Llama3.1 70B e Qwen2 72B, em mais de 10 pontos nos populares benchmarks de contexto longo RULER e InfiniteBench, estabelecendo novos resultados de ponta para LLMs de código aberto. Comparado aos modelos comerciais, o Llama 3.1 70B com o \method alcança até melhor desempenho do que o GPT-4-128K e supera claramente o Claude 2 e o 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

PDF183November 16, 2024