Don't Treat AI Delivery as a "Conversation," But as State Machine Transitions
In actual AI Lab deliveries, I have identified one of the most fatal cognitive biases: many teams treat LLM calls as a "conversation." They attempt to make the

Don't Treat AI Delivery as a "Conversation," But as State Machine Transitions
In actual AI Lab deliveries, I have identified one of the most fatal cognitive biases: many teams treat LLM calls as a "conversation." They attempt to make the model "compliant" by optimizing prompts, but they ignore a core fact—in production environments, the essence of AI delivery is **State Transition**.
Conversation Mindset vs. State Machine Mindset
When you build systems with a "conversation mindset," your focus is: *"How do I describe this task so that the model outputs the correct result in one go?"* This leads to excessive prompt stacking and uncontrollable randomness.
However, when you switch to a "state machine mindset," your focus shifts to: *"What is the current input state $S$? After passing through which operator $\text{Op}_n$, should it transition to what kind of structured state $S'$?"*
In Practice: Decomposing Complex Tasks into "Atomic State Transitions"
Take a complex legal contract review pipeline as an example. If you directly ask the AI, "Does this contract have risks?", you get an unpredictable block of text.
My engineering practice is to decompose this process into four explicit state transitions:
1. **$S_0 \rightarrow S_1$ (Structured Mapping)**: Convert unstructured text into a clause list in $\text{JSON}$ format. Assertion: All clauses must be indexed and none omitted.
2. **$S_1 \rightarrow S_2$ (Conflict Detection)**: Compare the clause list against a standard compliance library. The output is a $\text{Conflict\_List}$. Assertion: Conflicting items must be linked to specific clause IDs.
3. **$S_2 \rightarrow S_3$ (Risk Quantification)**: Score based on the severity of conflicts. The output is a $\text{Risk\_Score\_Map}$.
4. **$S_3 \rightarrow \text{Output}$ (Natural Language Synthesis)**: Convert the quantified scores back into a human-readable review report.
Under this architecture, AI is no longer an "all-powerful black box," but a combination of **deterministic operators**. If the final result is incorrect, I can immediately locate which operator failed by checking the snapshots of $S_1, S_2, S_3$.
Why Does This Method Solve "Hallucinations"?
Hallucinations usually occur when a model attempts to make too many logical leaps in a single inference step. By enforcing state transitions, we break down the originally massive logical leap $\Delta L$ into multiple small steps $\delta l_1, \delta l_2, \dots, \delta l_n$.
Each transition is accompanied by **Schema Validation**. If the JSON format of $S_1$ is incorrect, the pipeline triggers a circuit breaker immediately to initiate a retry or human intervention, rather than proceeding to $S_2$ with errors and causing more severe compounded hallucinations.
Recommendations for Delivery Teams
Do not try to find the perfect prompt, because it does not exist. Instead, you should:
- **Define clear state snapshots**: Every intermediate step must have persistent, auditable, structured output.
- **Establish operator-level monitoring**: Monitor the success rate and latency of each state transition node, rather than just looking at end-to-end success rates.
- **Embrace deterministic orchestration**: Use code (Python/TypeScript) to control flow logic, letting the LLM handle only local, unstructured information processing and conversion.
The only path to transforming AI delivery from an "art" into an "engineering discipline" is to turn conversations into state machines.
Comments
Share your thoughts!
Loading comments…