迷失在中间:LLM中信息检索需求产生的一种涌现特性
Lost in the Middle: An Emergent Property from Information Retrieval Demands in LLMs
AI总结:
本研究提出LLM的“迷失在中间”现象是对预训练中长短期记忆检索需求的适应性表现,通过从头训练GPT-2和Llama变体验证了U型性能曲线的涌现,揭示了信息检索需求、模型架构与注意力动态共同导致了位置偏差。
摘要:
大型语言模型(LLMs)的性能在关键信息位于长上下文中间时通常会下降,这种“迷失在中间”现象类似于人类记忆中的首因效应和近因效应。我们提出,这种行为并非单纯指示信息丢失的缺陷,而是对预训练期间不同信息检索需求的适应:一些任务需要在整个输入中进行均匀回忆(长期记忆需求),而另一些任务则优先处理最新信息(短期记忆需求)。与这一观点一致,我们展示了当LLMs(GPT-2和Llama变体)在模拟长期和短期记忆需求的两种简单人类记忆范式上从头训练时,这种U型性能曲线会涌现。我们的分析揭示,近因效应直接与训练数据中的短期记忆需求对齐,而首因效应则由均匀的长期记忆需求引发,并额外受到模型自回归特性和注意力汇聚形成的共同影响。我们从简单人类记忆范式中的主要发现也推广到了序列补全任务,该任务更接近LLM预训练中的下一词预测过程。综合来看,我们的发现揭示了模型训练期间的信息检索需求、模型架构和结构化注意力动态如何共同产生LLMs中观察到的位置偏差。
英文摘要:
The performance of Large Language Models (LLMs) often degrades when crucial information is in the middle of a long context, a "lost-in-the-middle" phenomenon that mirrors the primacy and recency effects in human memory. We propose that this behavior is not simply a flaw indicative of information loss but an adaptation to different information retrieval demands during pre-training: some tasks require uniform recall across the entire input (a long-term memory demand), while others prioritize the most recent information (a short-term memory demand). Consistent with this view, we show that this U-shaped performance curve emerges when LLMs (GPT-2 and Llama variants) are trained from scratch on two simple human memory paradigms simulating long-term and short-term memory demands. Our analysis reveals that while the recency effect directly aligns with short-term memory demand in the training data, the primacy effect is induced by the uniform long-term memory demand and is additionally influenced by the model's autoregressive properties and the formation of attention sinks. Our main findings from simple human memory paradigms also generalize to a sequence completion task, which more closely resembles the next-token prediction process in LLM pre-training. Together, our findings reveal how information retrieval demands, model architecture, and structural attention dynamics during model training can jointly produce positional bias observed in LLMs.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。