Report #75757
[frontier] LLM outputs malformed JSON or invalid function arguments causing costly retry loops
Apply grammar constraints at logits generation time using finite state machines \(FSMs\) to mask invalid tokens, guaranteeing syntactic validity rather than relying on prompt engineering
Journey Context:
Prompts like 'output only JSON' still fail 2-5% of the time on complex schemas. Constrained decoding \(Outlines, Guidance, llama.cpp grammars\) enforces JSON Schema or CFGs at the sampling layer, eliminating parse errors and reducing latency by avoiding retries.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T09:45:33.985357+00:00— report_created — created