arXiv:2607.18261cs.AI2026-07

结构化输出不能保证语义正确,模型仍会生成格式对但内容错的订单。

When JSON Is Not Enough: Semantic Reliability of Schema-Constrained LLM Ordering Agents

  • 设计新基准OrderBench,分离评估输出的语法、语义与安全等维度
  • 4个开源模型在100%符合Schema时,语义成功率仍仅约80%
  • 强调必须用领域验证和闭合执行来防范模型误判

大模型代理正被用于将自然语言意图转化为可执行的结构化对象。尽管JSON Schema和厂商提供的结构化输出模式能避免大量解析错误,但无法确保输出的安全性和准确性。本文提出OrderBench,一个针对餐厅订餐代理的确定性基准,独立评估语法有效性、Schema合规性、状态决策、项目语义精确性、约束保持性及不安全接受情况。在2,400次Nebius Token Factory调用中,四个开放模型在仅提示和JSON Schema模式下测试发现:即使输出100%符合Schema,语义错误率依然显著;最强模型语义成功率达近80%,弱模型出现双位数的格式正确但不安全接受。结论表明:结构化输出是必要接口层,而非替代领域验证与闭合执行的方案。

原文摘要 · Abstract (English)

LLM agents are increasingly used as transaction compilers: a user states an intent in natural language, and the model emits a structured object that an API can execute. JSON Schema and provider-level structured-output modes are useful because they remove a large class of parse failures, but they do not by themselves decide whether the object is a safe, faithful transaction. We introduce OrderBench, a deterministic benchmark for restaurant ordering agents that separates syntactic validity, schema validity, status decisions, exact item semantics, constraint preservation, and unsafe acceptances. Across 2,400 Nebius Token Factory calls to four open models in prompt-only and JSON-schema modes, we find that schema-valid output can still have large semantic error rates. In the strongest model, both modes achieve 100% schema validity, yet semantic success remains near 80%; in weaker models, schema-valid unsafe acceptances occur in double digits. The result is a concrete engineering warning: structured output is a necessary interface layer, not a substitute for domain verification and fail-closed execution.

大模型应用结构化输出可靠性评估

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