何时停止:通过潜在充分信号实现高效的上下文处理
Knowing When to Stop: Efficient Context Processing via Latent Sufficiency Signals
AI总结:
通过潜在充分信号实现高效上下文处理,使LLMs在获得足够信息后自动终止处理,提升效率并减少token使用。
摘要:
大型语言模型(LLMs)会无差别地处理整个输入上下文,这在回答查询所需信息局部化于上下文时效率低下。我们提出了动态上下文截断,一种新的方法,使LLMs能够在获得足够的任务相关信息时自行终止处理。通过分析模型内部,我们发现特定的注意力头本质上编码了
英文摘要:
Large language models (LLMs) process entire input contexts indiscriminately, which is inefficient when the information required to answer a query is localized within the context. We present dynamic context cutoff, a novel method enabling LLMs to self-terminate processing upon acquiring sufficient task-relevant information. Through analysis of model internals, we discover that specific attention heads inherently encode "sufficiency signals" -- detectable through lightweight classifiers -- that predict when critical information has been processed. This reveals a new efficiency paradigm: models' internal understanding naturally dictates processing needs rather than external compression heuristics. Comprehensive experiments across six QA datasets (up to 40K tokens) with three model families (LLaMA/Qwen/Mistral, 1B-70B) demonstrate 3.4% accuracy improvement while achieving 1.33x token reduction on average. Furthermore, our method demonstrates superior performance compared to other context efficiency methods at equivalent token reduction rates. Additionally, we observe an emergent scaling phenomenon: while smaller models require probing for sufficiency detection, larger models exhibit intrinsic self-assessment capabilities through prompting.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。