[论文解读] Exploring Length Generalization in Large Language Models
本文分析基于变换器的 LLMs 如何将泛化扩展到更长的问题实例,并指出仅靠微调难以实现长度泛化,而在上下文草稿提示中,显著改善长度泛化。还识别了失败模式以及微调、提示和草稿策略之间的相互作用。
The ability to extrapolate from short problem instances to longer ones is an important form of out-of-distribution generalization in reasoning tasks, and is crucial when learning from datasets where longer problem instances are rare. These include theorem proving, solving quantitative mathematics problems, and reading/summarizing novels. In this paper, we run careful empirical studies exploring the length generalization capabilities of transformer-based language models. We first establish that naively finetuning transformers on length generalization tasks shows significant generalization deficiencies independent of model scale. We then show that combining pretrained large language models' in-context learning abilities with scratchpad prompting (asking the model to output solution steps before producing an answer) results in a dramatic improvement in length generalization. We run careful failure analyses on each of the learning modalities and identify common sources of mistakes that highlight opportunities in equipping language models with the ability to generalize to longer problems.
研究动机与目标
- 定义并表征通过奇偶性和变量赋值任务的变换器模型的长度泛化.
- 评估在分布内与分布外长度下,微调、提示和草稿方法的表现。
- 识别阻碍长度泛化的失效模式与上下文因素。
- 研究草稿提示或微调是否能够实现对更长问题长度的外推。
提出的方法
- 在确定性马尔可夫过程的上下文中定义长度,并研究需要状态跟踪的两个任务(奇偶性与布尔变量赋值)。
- 评估多种学习模态:对预训练解码器的全面微调、就地少-shot 提示学习,以及草稿纸推理(连锁推理)。
- 测试组合(微调、提示、草稿)以观察相互作用和失效模式。
- 进行失效分析,聚焦于位置编码、干扰项和序列结束信号。
- 尝试草稿提示以评估基于模板的长度泛化在预训练大型语言模型上的效果。
- 描述不同输入长度分布如何影响分布内与分布外的性能。
实验结果
研究问题
- RQ1微调学习得到的变换器模型是否能将泛化推广到超出训练长度的更长问题长度?
- RQ2就地学习并结合草稿推理是否比单一微调更能提升长度泛化?
- RQ3哪些主要失效模式阻碍长度的外推(如位置偏差、EOS 处理、干扰项等)?
主要发现
- 在长度泛化任务上的微调在分布外性能较差,即使模型规模扩大也如此。
- 在微调条件下,扩大模型规模和数据量并不能显著改善长度泛化。
- 草稿纸微调显示对更长问题的泛化能力不足,干扰项被识别为关键罪魁。
- 就地学习配合草稿提示可显著提升长度泛化,使模板能够外推到更长长度。
- 当基础模型在该任务上已经表现良好(特别是奇偶性)时,少-shot 草稿提示显著优于零-shot。
- 将微调、提示与草稿策略相结合的效果依任务而异,可能带来混合结果(在奇偶性方面表现强,在变量赋值方面较弱)。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。