# LazyAgent: Demand-Driven Materialization and Physical Optimization of Agentic Programs

DevFeed: [LazyAgent: Demand-Driven Materialization and Physical Optimization of Agentic Programs](<https://devfeed.tech/articles/lazyagent-demand-driven-materialization-and-physical-optimization-of-agentic-programs-111922.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2609.23058>)

Author: Xin Heng

Published: 2026-11-02T05:00:00Z

Content type: article

Language: en

Sources: [arXiv: Artificial Intelligence](<https://devfeed.tech/sources/arxiv-artificial-intelligence.md>)

Topics: [AI Agent](<https://devfeed.tech/topics/ai-agent.md>), [Multi-step AI processes](<https://devfeed.tech/topics/multi-step-ai-processes.md>), [Structured concurrency](<https://devfeed.tech/topics/structured-concurrency.md>), [Large Language Model](<https://devfeed.tech/topics/llm.md>), [LLM optimization](<https://devfeed.tech/topics/llm-optimization.md>)

Tags: [abstract](<https://devfeed.tech/tags/abstract.md>), [agent](<https://devfeed.tech/tags/agent.md>), [agent-runtimes](<https://devfeed.tech/tags/agent-runtimes.md>), [agent-workflows](<https://devfeed.tech/tags/agent-workflows.md>), [agentic](<https://devfeed.tech/tags/agentic.md>), [application](<https://devfeed.tech/tags/application.md>), [arxiv](<https://devfeed.tech/tags/arxiv.md>), [behavior](<https://devfeed.tech/tags/behavior.md>), [benchmarks](<https://devfeed.tech/tags/benchmarks.md>), [bill](<https://devfeed.tech/tags/bill.md>), [build](<https://devfeed.tech/tags/build.md>), [call](<https://devfeed.tech/tags/call.md>), [can](<https://devfeed.tech/tags/can.md>), [candidate](<https://devfeed.tech/tags/candidate.md>), [changes](<https://devfeed.tech/tags/changes.md>), [ci](<https://devfeed.tech/tags/ci.md>), [code](<https://devfeed.tech/tags/code.md>), [cs-ai](<https://devfeed.tech/tags/cs-ai.md>), [demand](<https://devfeed.tech/tags/demand.md>), [materialization](<https://devfeed.tech/tags/materialization.md>), [optimization](<https://devfeed.tech/tags/optimization.md>)

## AI overview

LazyAgent executes a ready workflow step only when the current request needs it, using an exact demanded set computed in one traversal without model calls; the set remains exact as plans change. Its authors report that an eager runtime spent 62.2% of CPU on unneeded work across 303 requests and 154 production workflows. Against that runtime, LazyAgent reportedly cut production-workflow CPU by 42.0%, tied when the request needed the whole graph, and added at most 0.43% overhead. Other reported results include 51.7% and 52.1% less container time on release gates, 12.8% fewer tokens on DataSciBench plans at matched quality, and 24.0% lower cost in a live LangGraph application, with no losses. The known demand cost can also guide workflow choice before execution. The abstract argues current public agent benchmarks cannot reveal these savings because they are designed like eager runtimes.

## Source excerpt

arXiv:2609.23058v2 Announce Type: replace Abstract: Agent runtimes that plan before acting run every step as soon as it is ready. Neither these runtimes nor their benchmarks distinguish a step that is ready from a step the request needs, and the difference is large: across 303 requests on 154 production workflows, an eager runtime that stops once the goal is met spends 62.2% of its CPU on work the request never needed. LazyAgent is, to our knowledge, the first complete formulation of demand-driven execution for agent runtimes. Its rule: run a ready step only if the current request needs it, and keep that answer exact as the plan changes. A demanded set derived from the program decides, in one traversal with no model calls, so LazyAgent spends nothing outside the request. Because demand is defined exactly, its behavior is proved: builders know before any run where demand must save and where it must tie. The bill is known before a plan runs, so LazyAgent can act as a query optimizer to choose among candidate workflows. Measured live against that eager runtime, LazyAgent saves 51.7% and 52.1% of container time on release gates where a frontier LLM writes the patches, 12.8% of tokens on DataSciBench plans at matched quality, and 24.0% of dollars inside a live LangGraph application, with no losses. When the LLM re-plans after real code failures, it solves every solvable goal with 11.7% fewer tokens per goal. On the production workflows it saves 42.0% of CPU, ties exactly where a request needs the whole graph, and adds at most 0.43% overhead. The same set steers every physical operation: projection saves 80-89% of a shared CI step, where the identical eager control saves 0.0%. Public agent benchmarks are designed the same way as eager runtimes, so they cannot show this difference. We compose our test programs from their tasks and call on industry to build benchmarks that measure how efficiently agent workflows run.