一种面向LLM的免训练长度外推方法:贪婪注意力Logit插值(GALI)
A Training-Free Length Extrapolation Approach for LLMs: Greedy Attention Logit Interpolation (GALI)
AI总结:
针对LLMs处理超长上下文时的位置分布外问题,提出免训练方法GALI,通过贪婪复用预训练位置区间并插值注意力logit消除异常值,在广泛长上下文任务中实现稳定优越的性能,提升了长文本处理的鲁棒性。
摘要:
基于Transformer的大语言模型(LLMs)在处理超出其训练上下文窗口的输入时,会因为位置分布外(O.O.D.)问题破坏注意力而陷入困境。现有解决方案包括微调和免训练方法,但面临效率低下、冗余插值、logit异常值或丢失局部位置信息等挑战。我们提出了贪婪注意力Logit插值(GALI),这是一种免训练方法,通过贪婪地复用预训练位置区间并对注意力logit进行插值以消除异常值,从而提升长度外推能力。GALI在广泛的各类长上下文任务中实现了稳定且优越的性能,且无需针对特定输入长度进行调优。我们的分析进一步揭示,LLMs对位置区间的理解是不均匀的,即使是在短上下文任务上,将插值限制在更窄的范围内也能提升性能。GALI代表了向LLMs中更鲁棒和更具泛化能力的长文本处理迈出的一步。我们在 https://github.com/adlnlp/Gali 开源了GALI的实现及论文中的实验。
英文摘要:
Transformer-based Large Language Models (LLMs) struggle with inputs exceeding their training context window due to positional out-of-distribution (O.O.D.) issues that disrupt attention. Existing solutions, including fine-tuning and training-free methods, face challenges like inefficiency, redundant interpolation, logit outliers, or loss of local positional information. We propose Greedy Attention Logit Interpolation (GALI), a training-free method that improves length extrapolation by greedily reusing pretrained positional intervals and interpolating attention logit to eliminate outliers. GALI achieves stable and superior performance across a wide range of long-context tasks without requiring input-length-specific tuning. Our analysis further reveals that LLMs interpret positional intervals unevenly and that restricting interpolation to narrower ranges improves performance, even on short-context tasks. GALI represents a step toward more robust and generalizable long-text processing in LLMs. Our implementation of GALI, along with the experiments from our paper, is open-sourced at https://github.com/adlnlp/Gali.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。