arXiv:2606.25605cs.CL2026-06被引 3

开启结构化输出约束后,大模型会自动屏蔽工具调用,影响实际应用。

Constraint Tax in Open-Weight LLMs: An Empirical Study of Tool Calling Suppression Under Structured Output Constraints

论文配图:Constraint Tax in Open-Weight LLMs: An Empirical Study of Tool Calling Suppression Under Structured Output Constraints
图 1 · 摘自论文原文
  • 通过控制实验发现,结构化约束会导致工具调用被抑制。
  • 在多模型测试中,工具调用率下降至0%,但格式合规率仍超95%。
  • 提出双阶段执行方案,恢复工具调用且不破坏格式要求,适合生产部署者。

现代Agent系统的核心能力之一是工具调用与结构化输出,但二者在联合部署下的交互机制尚不明确。本文在生产级Agent系统中观察到可复现现象:当同时启用工具调用与JSON Schema约束时,多个开源大模型虽保持高格式合规性(>95%),却停止调用工具。我们称之为工具抑制(Tool Suppression)。通过跨模型家族与部署环境的对照实验,确认该现象在联合约束下持续存在,而独立评估时工具调用与格式合规均正常。进一步分析表明,JSON Schema约束被编译为基于语法的令牌掩码,导致工具调用令牌在解码过程中无法访问。据此提出约束优先级倒置(CPI)假说,认为在多重约束下格式满足可能主导动作选择行为。为缓解问题,提出透明双阶段执行策略,将工具执行与受约束生成解耦。实验显示该方法恢复工具调用,同时保持结构化输出保证,无需重训练。研究提示:单独评估工具使用与结构化输出可能遗漏关键可靠性风险。

原文摘要 · Abstract (English)

Tool Calling and Structured Output are two core capabilities of modern Agent systems, yet their interaction under joint deployment conditions remains insufficiently understood. This paper reports a reproducible phenomenon observed in a production Agent system: when Tool Calling and JSON Schema constraints are simultaneously enabled, multiple open-weight models cease invoking tools despite maintaining high schema compliance. We refer to this behavior as Tool Suppression. Through controlled experiments across multiple model families and deployment settings, we consistently reproduce Tool Suppression under joint constraints, while tool execution and schema compliance remain functional when evaluated independently. Further analysis reveals that JSON Schema constraints are compiled into grammar-based token masks, causing tool-call tokens to become unreachable during decoding. This provides an implementation-level explanation for the observed behavior. To interpret the phenomenon, we formulate the Constraint Priority Inversion (CPI) hypothesis, which suggests that schema satisfaction may dominate action-selection behavior under multiple simultaneous constraints. We present CPI as a behavioral hypothesis consistent with the observed evidence rather than a verified internal mechanism. To mitigate the problem, we propose Transparent Two-Pass Execution, an inference-time strategy that decouples tool execution from schema-constrained response generation. Experimental results show that this approach restores tool invocation while preserving structured output guarantees without requiring model retraining. These findings suggest that evaluating tool use and structured output separately may overlook important reliability issues in production Agent systems. Code, data, and docs will be released at https://github.com/Fzsama/Constrain-Tax-26-06.git.

大模型工具调用约束抑制Agent系统

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