Grafy News
Try Grafy free

Perdura separates model decision from runtime state management

Researchers have introduced Perdura, a new harness that shifts task state management from the AI model to the runtime to improve efficiency and reliability.

Illustration for the news story: Perdura separates model decision from runtime state managementSource: Grafy Research Lab

AI agents are increasingly capable of executing complex tasks, but they often struggle with the overhead of remembering what has already happened. A new research paper introduces Perdura, a system designed to solve this by shifting the responsibility of maintaining task state from the language model to the underlying runtime environment.

What is the current problem with AI agent harnesses?

Most existing AI agent harnesses operate using a "transcript" method. According to the researchers, these systems simply keep a running text record of every action taken and every observation received. To build the next step, the harness appends new text to this history and feeds the whole transcript back to the model.

This approach forces the language model to perform unnecessary cognitive labor. Because a text transcript only records what was said or seen, it does not inherently understand the current "state" of a task—such as the specific value of a variable, a live browser session, or a pending background process. As a result, the model must constantly re-read, re-calculate, or re-poll the environment to figure out what holds true at the moment. This leads to higher token usage, increased costs, and a higher risk of error if the process is interrupted.

How does the Perdura approach work?

Perdura proposes a clear division of labor: the model provides the judgment, while the runtime manages the facts. The researchers argue that when agents use code to perform actions—a paradigm known as CodeAct—the state of the task is effectively the state of a running program.

Figure 1 shows this architectural shift. Instead of the model wading through a massive text transcript, the Perdura runtime maintains an execution ledger (LL), a persistent namespace (NN) for values and resources, and a work lifecycle (WW) for unfinished tasks. The runtime then provides the model with a "projection" (Π\Pi) of this state. This projection acts as a concise summary of the current environment, allowing the model to make decisions based on the actual state of the program rather than trying to reconstruct it from a history of text.

Figure 1: The model decides; the runtime keeps state. One task at one moment: report when a repository reaches 2,000 stars. In a loop over a transcript, the state is text…
Figure 1. The model decides; the runtime keeps state. One task at one moment: report when a repository reaches 2,000 stars. In a loop over a transcript, the state is text that the model reads back at every step. Perdura’s runtime keeps it as an execution ledger (L) of calls, with the namespace (N) and work lifecycle (W) on it, and shows the model a projection (Π). Figure 1 of “Perdura: The Model Decides, the Runtime Keeps State” by Haoyu Wang, Zhen Wang, Zhiyu Yang et al. (arXiv.org), CC BY 4.0.

What are the benefits of this division of labor?

By moving state management to the runtime, Perdura achieves significant improvements in both efficiency and robustness. The researchers found that for strong models, using a transcript-based harness requires 11% to 38% more cost to maintain the same level of performance compared to Perdura's method.

Furthermore, the system offers better fault tolerance. In traditional harnesses, if the process running the agent dies mid-task, the state is often lost because it only existed within the model's context or the transient transcript. Because Perdura stores the execution ledger, namespace, and work lifecycle together, a runtime that is killed mid-task can resume from its stored state once it is restarted.

How does Perdura perform against existing methods?

The researchers evaluated Perdura against four widely used agent harnesses across various model and benchmark settings. The results, illustrated in Figure 3, demonstrate that Perdura sits on the score-cost Pareto frontier in seven out of eight settings. This means that for a given budget or cost, Perdura typically achieves higher scores, or for a target score, it operates at a lower cost than its competitors.

Figure 3: Perdura lies on the score–cost frontier in seven of eight settings. Score against cost, each the mean of three runs; each panel is one base model and benchmark;…
Figure 3. Perdura lies on the score–cost frontier in seven of eight settings. Score against cost, each the mean of three runs; each panel is one base model and benchmark; the dashed staircase is the score–cost Pareto frontier and the shaded region contains the harnesses that Perdura dominates, those with higher cost and no higher score. Figure 3 of “Perdura: The Model Decides, the Runtime Keeps State” by Haoyu Wang, Zhen Wang, Zhiyu Yang et al. (arXiv.org), CC BY 4.0.

Without the specific state mechanisms provided by Perdura—such as the persistent namespace or the work lifecycle—even powerful models saw their performance drop or their costs rise significantly to compensate for the lack of structured state management.

How can developers apply these concepts?

For developers building agentic workflows, the Perdura research highlights that the "intelligence" of an agent is only one part of the equation; the reliability of the environment it inhabits is equally critical. Building harnesses that treat actions as code and maintain a deterministic state can lead to much more stable and cost-effective AI applications.

While Perdura is a research framework, the principle of separating high-level reasoning from low-level state management is highly relevant to anyone working in AI-assisted programming. For those looking to experiment with AI-driven code execution and development in a structured environment, Grafy Code provides a workspace where AI can interact with code in a functional context.

Frequently asked questions

Does Perdura require a new type of AI model?

No, Perdura does not require a specialized model. It is a harness designed to work with existing large language models. The system changes how the model's environment is managed and how information is presented to the model, rather than changing the underlying architecture of the model itself.

Why is CodeAct important for this method?

CodeAct is important because it ensures that every action the agent takes is an executable piece of code. This allows the runtime to treat the task state as a standard program state. By using code, the system can deterministically track variables, resource handles, and execution history without needing to manually define a state format for every new task.

How does Perdura handle interrupted tasks?

Perdura handles interruptions by using an execution ledger that records every call and its outcome. Because the namespace, work lifecycle, and ledger are saved together as a single state, the runtime can restore the exact condition of the program from the last committed step, allowing the agent to continue its work without starting over.


Source: Grafy Research Lab — Perdura: The Model Decides, the Runtime Keeps State