arXiv:2605.26165cs.SEcs.AI2026-05

压缩工具定义可让受限上下文下的智能体RAG系统恢复正常运行。

Tool-Schema Compression Enables Agentic RAG Under Constrained Context Budgets

  • 用保守压缩策略减少工具定义的令牌数,缓解上下文冲突。
  • 在8K上下文下,压缩后准确率提升20.5个百分点,恢复生成能力。
  • 适合资源受限场景中部署复杂工具链的智能体系统开发者。

具备数十至数百个工具定义的智能体RAG系统面临核心资源冲突:工具定义占用与检索增强生成相同的上下文窗口。本文首次系统研究这一工具-上下文权衡,在6,566次受控API调用中评估了14个模型(1.5B-32B参数本地模型及一个前沿API模型),覆盖三个上下文预算(8K、16K、32K)和28个工具定义。采用TSCG保守型压缩(节省44%-50%令牌),观察到二元启用效应:在8K上下文中,原始JSON-schema完全溢出,精确匹配率仅2.6%;而压缩后所有八种模型平均提升20.5个百分点(六种实现完全启用者达24.7个百分点)。在32K时两者均容纳,五种模型差异≤1个百分点,证实效应由预算驱动。外部验证在HotpotQA(50个多跳问题)中显示相同溢出场景下准确率提升48个百分点。前沿扩展测试表明,原始格式在约494个工具时溢出,而压缩版本可持续支持超过800个工具。结果确立工具定义压缩是受限上下文部署智能体RAG的必要基础设施。所有代码、数据与检查点均已公开。

原文摘要 · Abstract (English)

Agentic RAG systems that equip language models with dozens to hundreds of tool definitions face a critical resource conflict: tool schemas consume the same context window needed for retrieval-augmented generation. We present the first systematic study of this tool-context trade-off, evaluating 14 models spanning 1.5B-32B local models plus one frontier API model across 6,566 controlled API calls at three context budgets (8K, 16K, 32K) with 28 tool definitions. Applying TSCG conservative-profile compression (44-50% schema token savings), we observe a binary enablement effect: at 8K tokens, JSON-schema tool definitions overflow the context window entirely, yielding near-zero EM (2.6% average), while compressed schemas restore RAG functionality with +20.5 pp average exact-match lift across all eight models (+24.7 pp among the six exhibiting full enablement). At 32K -- where both formats fit -- four of five tested models show delta <= 1 pp, confirming the effect is purely budget-driven. External validation on HotpotQA (50 multi-hop questions) shows +48 pp EM under the same overflow scenario. Frontier scaling tests demonstrate that JSON schemas overflow at ~494 tools while compressed schemas remain operational beyond 800 tools. Our results establish tool-schema compression as a necessary infrastructure layer for agentic RAG in constrained-context deployments. All code, data, and checkpoints are publicly available.

智能体RAG压缩上下文

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。