大多数文本预测只需最后96个词,模型却常忽略长距离依赖。
Short-Context Dominance: How Much Local Context Natural Language Actually Needs?
- 用大模型测出96词内上下文可满足75%-80%的预测需求
- 提出新指标DaMCL,无需知道真实下一个词就能识别长依赖序列
- 设计解码算法,提升长距离相关词的生成质量,适合问答任务
我们研究短上下文主导假说:对于多数序列,仅需小范围局部前缀即可准确预测后续词。利用大语言模型作为统计探针,在不同长度的长上下文文档数据集上测量最小上下文长度(MCL),发现1-7千词的序列中,75%-80%仅需最后96词以内即可实现与全上下文一致的预测。鉴于短上下文主导现象,我们进一步探究能否识别那些无法靠短局部前缀预测的长上下文挑战序列。为此提出分布感知最小上下文长度(DaMCL)作为实用代理指标,无需实际目标词信息,且兼容非贪婪采样策略。实验表明,对DaMCL简单阈值化可高效区分长/短上下文序列。最后,为缓解短上下文主导带来的输出偏见,我们设计一种直观解码算法,利用探测器识别并增强长程相关词的生成。在多种问答任务和模型架构下验证,该方法有效提升了性能。
原文摘要 · Abstract (English)
We investigate the short-context dominance hypothesis: that for most sequences, a small local prefix suffices to predict their next tokens. Using large language models as statistical oracles, we measure the minimum context length (MCL) needed to reproduce accurate full-context predictions across datasets with sequences of varying lengths. For sequences with 1-7k tokens from long-context documents, we consistently find that 75-80% require only the last 96 tokens at most. Given the dominance of short-context tokens, we then ask whether it is possible to detect challenging long-context sequences for which a short local prefix does not suffice for prediction. We introduce a practical proxy to MCL, called Distributionally Aware MCL (DaMCL), that does not require knowledge of the actual next-token and is compatible with sampling strategies beyond greedy decoding. Our experiments validate that simple thresholding of the metric defining DaMCL achieves high performance in detecting long vs. short context sequences. Finally, to counter the bias that short-context dominance induces in LLM output distributions, we develop an intuitive decoding algorithm that leverages our detector to identify and boost tokens that are long-range-relevant. Across Q&A tasks and model architectures, we confirm that mitigating the bias improves performance.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。