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

Yin Li

arXiv:2607.18261 · 2026-07-23 공개 · arXiv · PDF

llm-agents json-schema restaurant-ordering schema-validity semantic-reliability fail-closed-execution domain-verification orderbench

Abstract

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.

한국어 요약

한 줄 요약

LLM 에이전트의 JSON 스키마 준수는 의미적 신뢰도를 보장하지 못하며, 도메인 검증이 필수적임을 실증한 연구.

핵심 기여도

핵심 아이디어

LLM 에이전트가 자연어를 기반으로 API 실행 가능한 구조화된 객체를 생성하는 과정에서, JSON 스키마는 형식적 유효성만 보장할 뿐, 의미적 정확성과 안전성은 보장하지 못한다는 점이 핵심 문제이다.
이 연구는 **OrderBench**라는 벤치마크를 통해 **JSON 유효성**, **스키마 유효성**, **상태 정확도**, **정확한 항목 의미**, **제약 보존**, **비안전 수용** 등 6가지 범주를 구분하여 평가한다.
특히, **allergen conflict**, **modifier scope**, **unavailable item** 등 실제 운영 시 문제가 되는 상황을 정확히 평가하기 위해 **hand-coded oracle**을 사용한 **deterministic** 평가가 핵심적이다.

기술적 접근법

주요 결과

의의 및 한계

이 연구는 **JSON 스키마가 형식적 유효성만 보장**하고, **의미적 신뢰도는 별도의 도메인 검증이 필요**하다는 점을 명확히 보여준다.
**OrderBench**는 실제 운영 환경에서 발생할 수 있는 **도메인 경계 문제**를 정확히 평가할 수 있는 **결정적 벤치마크**로, **LLM 에이전트의 신뢰성 평가 기준**을 제시한다.
한계점으로는 **모델별 성능 차이가 크고**, **JSON 스키마 모드가 모든 모델에서 의미적 성공률을 크게 개선하지 못**한다는 점이 언급된다.
또한, **모든 실험은 temperature 0으로 진행**되었기 때문에, **창의적 또는 유연한 응답이 필요한 상황에서는 다른 결과가 나올 수 있음**을 주의해야 한다.

실용적 활용

이 연구는 **LLM 에이전트를 실제 거래 시스템에 적용할 때**, **JSON 스키마를 단순한 인터페이스 레이어로 사용하고**, **도메인 검증과 fail-closed 실행을 별도로 구현**해야 함을 강조한다.
특히, **식품 주문, 여행 예약, 금융 거래 등 안전성이 중요한 시스템**에서 **모델 출력과 도메인 검증 결과를 별도로 로깅하고**, **자동 수리가 아닌 명확한 클리어런스를 요구하는 아키텍처**가 필요하다.