A New Approach to LLM Agent State Management: Host-Held State Achieves 400/400 Exact Steps

Host-held state keeps an LLM agent exact across all 400 steps, far beyond the 85 of the conventional approach.
The article examines state management for LLM agents, noting that model-maintained state is inherently fragile—only 85 of 400 steps were correct as written. An experiment's "host-held state" approach has an external host record state deterministically and pass it in structured form, leaving the LLM as a state transition function; all 400 steps were exact. The method suits long, high-reliability tasks but adds overhead, and the single-source evidence still needs verification.
When building agents based on large language models (LLMs), state management has always been the key to reliability. Traditional approaches leave state maintenance to the model itself, and the results are often unsatisfactory. Recently, an experiment shared in the Reddit community showed that with "host-held state," an agent achieved exact matches across all 400 steps in a 400-step task, whereas the conventional approach was correct for only 85 steps. This stark contrast in the data reveals a core contradiction in LLM agent design.

Root Cause: The Fragility of Model-Held State
"State" refers to the context an agent needs to remember while executing a multi-step task—for example, completed actions, intermediate results, and pending items. If the LLM is left to maintain this information on its own through prompts on each call, it easily loses key details over long conversations or produces inconsistencies. The Reddit post's title phrase "85 of 400 as written" points directly at this pain point: under the conventional approach, only 85 of 400 steps were accurate.
This fragility stems from an inherent characteristic of LLMs—they are not designed for persistent state, and each generation is an independent probabilistic sampling. As the number of task steps increases and the context window fills up, the model's attention to early information declines, and errors accumulate.

Context Window is the maximum number of tokens an LLM can process in a single call, including the input prompt and the output. As the history of a multi-step agent task keeps growing, the context window gradually fills up. Once it overflows, early information must be truncated or summarized, causing the model to lose critical state; even before overflow, too much information in the window dilutes attention weights and reduces the model's recall of key details. This is the structural reason why "model-held state" is fragile in long tasks—not merely insufficient model capability.
Solution: Host-Held State
The core improvement proposed by the experiment is to strip state out of the model and hand it to a "host" (i.e., the external program running the agent). The host records the exact state at each step and passes it to the model in a structured form when needed. The model only has to make decisions based on the current state and does not need to "remember" history. This architecture turns state management from probabilistic generation into deterministic storage, thereby avoiding the model forgetting or fabricating state.
From an engineering perspective, host-held state is similar to maintaining an explicit state machine in traditional software, with the LLM acting as the state transition function. After each transition, the host updates and persists the state, ensuring that the next action is based on the latest and accurate information. The experimental results show that with this approach, all 400 steps were exact—a sharp contrast to the 85 correct steps under the conventional approach.
State Machine is an abstraction that models system behavior as "states" and "transitions": the system is in a definite state at any moment, external events trigger state transitions, and transition rules are defined by deterministic functions. In the host-held state architecture, the LLM plays exactly the role of the "state transition function"—receiving the current state and action input, and outputting the next state and execution instructions—while the host is responsible for maintaining state storage, triggering transitions, and persisting results. This analogy helps explain why deterministic storage can eliminate probabilistic forgetting: a state machine itself does not rely on memory, only on explicitly defined states and rules.
Architectural Implications and Applicability Boundaries
This result has general reference value for LLM agent architecture design. For scenarios that require long workflows, multiple steps, and high reliability (such as automated workflows and complex task planning), host-held state can significantly reduce error rates. However, this approach also brings additional overhead: the host needs to implement state serialization, storage, and passing logic, and the model still consumes tokens at each step to read the state.
Interestingly, the comparison data in this experiment comes from a single source and has not yet undergone peer review or large-scale reproduction. But the gap between 400 steps and 85 steps is striking enough to prompt a rethink of the state management paradigm. In the future, finding the balance between host-held state and model autonomy may be the next topic in agent engineering.
State Serialization refers to converting state objects in host memory into a format that can be stored or transmitted (such as JSON or YAML), so that they can be passed to the LLM at each step or restored after a process restart. The design of serialization directly affects token overhead and how difficult the state is for the model to understand: overly verbose state descriptions crowd out the context window, while overly concise ones may lose key constraints. In engineering practice, it is usually necessary to design a layered state representation—core state described precisely with structured fields, and auxiliary context summarized as needed—to strike a balance between determinism and token cost.
One-line Summary
Delegating state to deterministic host management enables an LLM agent to be exact across all 400 steps of a task, far exceeding the 85 steps achieved by the conventional approach.
Paragraph Summary
The article focuses on state management for LLM agents, pointing out that having the model maintain multi-step task state through prompts is inherently fragile—each generation is an independent probabilistic sample, and in long tasks, once the context window fills up, the model easily forgets or fabricates information; the conventional approach was correct for only 85 of 400 steps. The experiment's "host-held state" approach strips state out of the model; an external program records it deterministically and passes it to the model in structured form, with the model acting only as a state transition function. The results show all 400 steps were exact. The article argues that this method suits long-workflow, high-reliability scenarios but adds host-side serialization and passing overhead, and the current evidence comes from a single source and still needs reproduction and verification.
Related articles

Gemini 4 Neon Review: Benchmark Scores Rival Carbon, API Pricing and Quota Breakdown
Google Gemini 4 Neon is now live, benchmark scores closely tracking Carbon, API pricing 3/15 at twice Hydrogen's rate. This article compiles Bilibili creator testing: Neon can replace 90% of Carbon scenarios, AntiGravity quota consumption is only one-third of Carbon, plus subscription channel restrictions and 2API ban risks.

Gemini 4 Helium Coming Soon? Signals of Google Loosening Subscription Restrictions
Google team member hints releases will continue; community speculates Gemini 4 Helium (Flash Lite) may be next. Subscription ban controversy gets a response as product lead says "Soon," suggesting restrictions may be lifted. This article covers Gemini developments, OpenAI Coding Agent and risk management, Doubao real-time audio-video API, and compute business dynamics.

AI-Assisted React Development in Practice: Optimizing a Video App and Handling Errors
A 14-year veteran developer demonstrates AI-assisted React video app optimization: compressing video from 80MB to 5MB (~94%) via ImageKit, plus reliable error handling and retry mechanisms. Includes planning, code understanding, and verification methods for working with AI.