arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2606.08151cs.AI

决策感知记忆卡:用于工具使用LLM智能体的反事实启发式上下文选择与压缩

Decision-Aware Memory Cards: Counterfactual-Inspired Context Selection and Compression for Tool-Using LLM Agents

Alibaba Group(阿里巴巴集团)

Xinyu Guan, Qianyang Zhao, Yuming Deng

AI总结:

提出CICL决策感知上下文层,通过构建上下文图、评分单元效用并打包为记忆卡,提升工具使用LLM智能体在行动时的证据选择与压缩能力,在SWE-bench验证集上实现检索命中率提升。

摘要:

使用工具的LLM智能体失败的原因往往不是缺少相关文本,而是在行动时未能选择、压缩或呈现决定性证据。我们提出CICL,一个决策感知上下文层,它将实例证据转化为上下文图,通过共享的八字段模式路由确定性、Opus辅助、Qwen、Codex/GPT-5.5和Qwen-QLoRA判断,根据行动偏移、结果提升、必要性和负迁移风险对单元评分,并将高效用证据打包为类型化记忆卡供预算有限的智能体使用。该设计将测量到的决策信号与判断模型分离,使得前沿标注、局部代理和轻量级排序器可以在一个可审计协议下进行比较。实验上,CICL在公开基准测试中取得了具体提升,同时暴露了其局限性。在50个SWE-bench Verified文件检索实例上,直接使用Qwen3.6-plus对BM25前50候选进行重排序,将hit@1从0.58提升至0.78,MRR@10从0.634提升至0.790,且所有2500个判断均可解析。受控诊断显示了行动关键性:在预算120时,CICL在v1上达到F1 0.620,在v3上达到F1 0.425,而移除最高效用的语义v3单元导致F1降至0.000。补充检查包括Qwen-QLoRA在710个候选上的一致性、一个小的200标签真实代码Opus辅助信号,以及一个三实例补丁烟雾测试验证检索到补丁的流程,但不声称官方SWE-bench成功。RepoBench-R摘要仍优于记忆卡,紧凑型排序器尚未取代启发式方法。CICL贡献了一个可复现的测量和选择层,用于决策关键上下文,而非端到端编码智能体修复声明。

英文摘要:

Modern large language model (LLM) agents do not simply need longer contexts; they need decision-relevant evidence at the moment of action. We study decision-aware context selection: ranking retrieved files, tests, traces, rules, and memories by their expected effect on an agent's next action rather than by semantic similarity alone. We present the Counterfactual-Inspired Context Layer (CICL), which builds an instance context graph, estimates decision-oriented utility for candidate units, and compresses selected evidence into typed memory cards. The same schema can be instantiated with hosted LLM judges, local surrogates, or lightweight rankers, making the selection protocol auditable across model choices. On 50 SWE-bench Verified file-retrieval instances, Qwen3.6-Plus reranking of BM25 top-50 candidates improves hit@1 from 0.58 to 0.78 and MRR@10 from 0.634 to 0.790, with all 2,500 judgments parseable. Controlled diagnostics show that CICL identifies action-critical evidence: removing the top-utility semantic unit reduces F1 from 0.245 to 0.000. In selected-then-compressed mode, memory cards save 44.93 tokens per query while preserving selected evidence. CICL provides a practical layer for measuring, ranking, and compressing decision-critical context for tool-using agents. Code is available at https://github.com/stephen-guan-researcher/CICL.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑