Report #55892
[frontier] Agent orchestration uses LLM 'decisions' via prompt parsing \(e.g., 'Respond with TOOL or FINISH'\), leading to non-deterministic state transitions and hallucinated actions
Use structured generation \(constrained decoding\) with libraries like Outlines to force the LLM to emit valid state transitions from a predefined state machine schema \(e.g., JSON schema for states\), eliminating hallucinated actions
Journey Context:
Naive agents rely on the LLM to 'choose' the next step in a ReAct loop, but LLMs are bad at following formatting instructions reliably. Structured generation \(using regex constraints or CFGs on the token level\) guarantees the output matches a state machine's transition function. This shifts agent control from 'hope the LLM behaves' to 'enforce valid transitions.' For example, if the state machine only allows \`search\` or \`finish\` from state \`RESEARCHING\`, the tokenizer will only emit tokens valid for those JSON schemas. Tradeoff: requires inference engines that support constrained decoding \(vLLM, llama.cpp, or specific APIs\), and state machines must be pre-defined, reducing flexibility compared to dynamic planning. It replaces brittle regex parsing with mathematical guarantees.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T00:18:31.226147+00:00— report_created — created