LLM Talvez LongLM: Estendendo Autonomamente a Janela de Contexto de LLMs Sem Ajustes
LLM Maybe LongLM: Self-Extend LLM Context Window Without Tuning
January 2, 2024
Autores: Hongye Jin, Xiaotian Han, Jingfeng Yang, Zhimeng Jiang, Zirui Liu, Chia-Yuan Chang, Huiyuan Chen, Xia Hu
cs.AI
Resumo
Este trabalho explora a capacidade inerente dos LLMs de lidar com contextos longos sem a necessidade de ajuste fino. O comprimento limitado da sequência de treinamento pode restringir a aplicação de Modelos de Linguagem de Grande Escala (LLMs) em sequências de entrada longas durante a inferência. Neste trabalho, argumentamos que os LLMs existentes já possuem capacidades inerentes para lidar com contextos longos. Com base nesse argumento, sugerimos estender a janela de contexto dos LLMs por eles mesmos para aproveitar plenamente essa capacidade inerente. Propomos o Self-Extend para estimular o potencial dos LLMs no tratamento de contextos longos. A ideia básica é construir informações de atenção em dois níveis: o nível do grupo e o nível do vizinho. Os dois níveis são calculados pela auto-atenção original do modelo, o que significa que o método proposto não requer nenhum treinamento adicional. Com apenas quatro linhas de código modificadas, o método proposto pode estender facilmente a janela de contexto dos LLMs existentes sem qualquer ajuste fino. Realizamos experimentos abrangentes e os resultados mostram que o método proposto pode efetivamente estender o comprimento da janela de contexto dos LLMs existentes.
English
This work elicits LLMs' inherent ability to handle long contexts without
fine-tuning. The limited length of the training sequence during training may
limit the application of Large Language Models (LLMs) on long input sequences
for inference. In this work, we argue that existing LLMs themselves have
inherent capabilities for handling long contexts. Based on this argument, we
suggest extending LLMs' context window by themselves to fully utilize the
inherent ability.We propose Self-Extend to stimulate LLMs' long context
handling potential. The basic idea is to construct bi-level attention
information: the group level and the neighbor level. The two levels are
computed by the original model's self-attention, which means the proposed does
not require any training. With only four lines of code modification, the
proposed method can effortlessly extend existing LLMs' context window without
any fine-tuning. We conduct comprehensive experiments and the results show that
the proposed method can effectively extend existing LLMs' context window's
length.