熵 context 形状:基于信息论的 context-aware LLM agent 的过滤方法
Entropic Context Shaping: Information-Theoretic Filtering for Context-Aware LLM Agents
AI总结:
本文提出熵 context 形状方法,通过信息论衡量 context 的语用效用,优于词汇相似性方法,在多轮 context 选择任务中取得显著提升。
摘要:
针对大型语言模型(LLM)代理的 context 工程需要区分在语用上有用的 information 与误导性的干扰项。我们引入了熵 context 形状(ECS),一种基于信息论的框架,通过模型答案分布向正确答案偏移来衡量 context 的效用。不同于依赖词重叠的词汇相似性方法,ECS 捕捉到语用效用——一段 passage 是否实际上有助于回答问题。我们将效用形式化为答案概率的有符号变化,并提供理论分析,表明与任务无关的更新会导致分布偏移接近零。我们在多轮 context 选择任务上使用 LongMemEval(会话级)和 LoCoMo(轮级)基准进行评估。在细粒度轮选择中,ECS 与 Llama-3.1-8B 结合实现 F1=0.265,比 TF-IDF(F1=0.154)有 71.83% 的相对提升,证明了语用效用在精确 context 选择方面优于词汇相似性。代码和数据可在补充材料中获得。
英文摘要:
Context engineering for large language model (LLM) agents requires distinguishing pragmatically useful information from misleading distractors. We introduce Entropic Context Shaping (ECS), an information-theoretic framework that measures context utility via the shift in the model's answer distribution toward the correct answer. Unlike lexical similarity methods that rely on word overlap, ECS captures pragmatic utility -- whether a passage actually helps answer the question. We formalize utility as the signed change in answer probability and provide theoretical analysis showing that task-irrelevant updates yield near-zero distribution shift. We evaluate on multi-turn context selection tasks using LongMemEval (session-level) and LoCoMo (turn-level) benchmarks. On fine-grained turn selection, ECS with Llama-3.1-8B achieves F1=0.265, a 71.83% relative improvement over TF-IDF (F1=0.154), demonstrating that pragmatic utility outperforms lexical similarity when precise context selection matters. Code and data are available in the supplementary materials.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。