arXiv(opens in a new tab)cs.LGOct 2026Cited by 2 papers on PaperVantage

Manuscript Offprint

arXiv:2610.02488

Harnessing LLMs as Agents: What Does It Cost?

Zelin Zhao, Xinyu Guo, Jingyuan Zhang, Yuxuan Zhang, Yongxin Chen

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Zelin Zhao1^{1}, Xinyu Guo1^{1}, Jingyuan Zhang1^{1}, Yuxuan Zhang2^{2}, Yongxin Chen1^{1}

1^{1}Georgia Institute of Technology, 2^{2}Etude AI

Language-model agents increasingly rely on harnesses that manage bounded context, persistent memory, tools, verification, and repeated execution, but existing notions of model capability do not quantify the computational resources these mechanisms consume. We develop a theory of these costs through the Language Model Agent Machine (LAM), a resource-bounded model that fixes the underlying semantic model while explicitly charging harness-level resources. Our theory yields four classes of results. Communication: LAM execution and red–blue pebbling are instancewise equivalent at the level of simultaneous call–transfer budgets, yielding the full discrete resource frontier and transferring classical I/O lower bounds to context–memory traffic. Access: memory interface changes asymptotic cost, including a Θ(n)\Theta(n) separation between random and non-speculative sequential access on pointer chasing and an exact single-stack FIFO frontier. Recomputation: bit-reversal DAGs require Θ(n2/(C+S)+n)\Theta(n^{2}/(C+S)+n) model calls with context capacity C and persistent-memory capacity S, quantifying when stored intermediate state avoids repeated semantic computation. Reliability: we derive tight stage-local sampling bounds, exact imperfect-verification costs, and a Young–Daly-type checkpoint law with a closed-form optimal verification interval. Controlled experiments and held-out evaluations on GPT-6 Astra [1] compare development-derived communication and reliability predictions with measurements, including checkpoint optima and a held-out policy-selection tournament conditional on a programmatic segment check; held-out chained MATH additionally exposes an observed tradeoff between whole-task call granularity, logical input traffic, and reliability. Prescribed-schedule runs are reported separately as implementation checks. Together, these results provide a resource theory for the computational cost of language-model agent harnesses.

Main Contact: zelin@gatech.edu

(a) From deployed LM system to agent system

An LM agent interacts with context, memory, tools, and verifiers to accomplish user tasks.

Figure

(b) LAM formalization

LAM=(L,ctrl,X,M,Otool,Over)LAM = (L, ctrl, X, M, O_{tool}, O_{ver})

Figure

L=model interface

Language model

that maps contexts

to outputs

(next-token oracle).

Figure

ctrl= controller

Routing controller

that orchestrates

calls, tool use,

memory, and

verification.

Figure

X=active context

Active context /

working set.

Bounded model-

facing state used

for the current

operation.

Figure

M=memory

Persistent

memory retaining

blocks across

calls.

Figure

Otool=toolsO_{tool} = \text{tools}

External tools

(e.g., search. code

execution,

databases).

Figure

Over=verifierO_{ver} = \text{verifier}

Verification and

checking (e.g.,

self-critique,

external verifiers,

reward models).

(c) Tracked resources

ResourceDescriptionQuantity (notation)
CallsNumber of calls to each module (model, tools, verifier).Nmodels,Ntools,NverN_{models}, N_{tools}, N_{ver}
TokensInput and output tokens (to/from the language model).Tin,ToutT_{in}, T_{out}
Memory interfaceMemory read/write operations (e.g., blocks retrieved or moved).Qblk,QmoveQ_{blk}, Q_{move}
Capacitiesactive-context capacity, persistent-memory capacity.C, S
ReliabilityAllowed error probability (for wrong outputs or checks).δ

(d) Red--blue pebbling interpretation

A computation can be viewed as placing and removing pebbles on intermediate results.

(i) Computation DAG

Figure

Z depends on A and B.

(ii) Pebble A

Figure

A is stored in persistent memory, represented by a blue pebble.

(iii) Pebble B

Figure

Loading A and B into active context changes their pebbles from blue to red.

(iv) Pebble Z

Figure

With A and B in active context, the model can compute Z, placing a red pebble on Z.

(v) Remove A and B

Figure

A and B may be evicted from active context, while Z may be stored in persistent memory.

Figure 1. Overview of the LAM: (a) an agent with active context, persistent memory, tools and verifiers; (b) the LAM components; (c) the charged quantities (calls N, token traffic TinT_{in} , ToutT_{out} , memory operations, capacities, target failure probability δ\delta ); (d) red–blue pebbling (context blocks red, memory blocks blue, transfers communication).

1. Introduction

Modern language-model agents are computational systems built around a model, not isolated model calls: a harness manages context, persistent state, tools, verification, and repeated execution [2], [3], [4], [5]. Existing theory largely characterizes what models or agentic extensions can compute: additional reasoning steps, external memory, tool access, and verifier interaction can all change computational power [6], [7], [8], [9], [10]. What it does not characterize is the resource cost of realizing that computation through a harness.

Harness architecture is itself a source of computational complexity. Two agents using the same underlying model can have the same semantic capability yet require asymptotically different numbers of model calls, context-memory transfers, memory operations, or verification steps. We therefore ask a different theoretical question: holding semantic capability fixed, what resources must a harness spend to execute a computation, and what is the optimal tradeoff among model calls, context, persistent storage, communication, and verification?

We introduce the Language Model Agent Machine (LAM), a resource theory for model–harness execution. LAM fixes semantic-oracle power and makes context, persistent storage, state movement, model calls, tools, and verification explicit computational resources. Its value-provenance principle allows the harness to move, store, and reuse semantic state but prevents it from creating task-relevant content for free. This separation is essential: it lets us attribute differences in execution cost to harness design rather than to a stronger underlying model.

This viewpoint exposes resource questions that are invisible to computability alone. How much communication is forced by bounded context? Does the interface to the same amount of memory change complexity? When can persistent state replace repeated semantic computation? How expensive is correctness when model transitions are imperfect? Classical complexity theory provides important ingredients for each question, but harness executions introduce complications absent from the classical abstractions: values may be copied or recomputed, only active-context values can directly enter a model call, the controller must not store semantic information for free, and an incorrect model transition may be committed before its error can be detected. We resolve these complications in four resource laws:

• Communication is exactly characterized by pebbling (Section 4). Red-blue pebbling provides the classical abstraction for fast-slow memory communication, but a harness execution contains physical block copies, recomputation, and controller-managed state that do not correspond one-to-one with graph vertices. Using value provenance, we quotient block occurrences by computational origin and prove an instancewise, resource-preserving correspondence: for every L-realisable DAG, memory-initialized vertex-granular LAM evaluations and red-blue pebblings have exactly the same feasible call-transfer budgets. The result therefore preserves the full discrete Pareto frontier, not only an asymptotic I/O lower bound or a single weighted optimum (Theorem 1, Corollary 9 and Corollary 10). Classical pebbling lower bounds consequently become harness-communication lower bounds. On a sequential chain, dependency-only prompting uses Θ(nb)\Theta(nb) logical input symbols, versus Θ(n2b)\Theta(n^{2}b) for full-history replay (Proposition 12).

• The memory interface changes computational complexity (Section 5). Memory capacity alone does not determine harness cost. For FIFO retrieval through a single stack, arbitrary buffering and copying defeat the usual stack-order argument; we prove a single-copy normal form that removes this freedom without increasing context, and from it derive the exact context-storage-traffic frontier, including the precise feasibility region and optimal transfer cost (Theorem 17, Corollary 19). Random access solves the same routing task with constant active context. On pointer chasing, random access follows k pointers in k reads, whereas every always-correct non-speculative sequential execution requires Ω(kn)\Omega(kn) expected head movements; even unrestricted always-correct read-only sequential execution retains an Ω(n)\Omega(n) lower bound (Theorem 2, Proposition 14).

• Persistent state trades directly against semantic recomputation (Section 6). The classical bit-reversal graph has a known call-space tradeoff, but the LAM setting separates active context from persistent storage: only context participates directly in a model call, while stored values must be explicitly recovered, and the input source is delivered only once. We lift the classical tradeoff to this asymmetric execution model and obtain a complete harness-level characterization: optimal model-call complexity Θ(n2/(C+S)+n)\Theta(n^{2}/(C+S)+n), explicit two-sided constants, the exact feasibility region, and a matching schedule with linear context-memory traffic (Theorem 3). In particular, linear model-call complexity is achievable if and only if total semantic capacity C+SC+S is linear in nn; without persistence, the same computation incurs a Θ(n/C)\Theta(n/C) multiplicative recomputation overhead when C=o(n)C=o(n).

• Correctness feedback changes the cost of reliable execution (Section 7). Classical noisy-query bounds describe the cost of distinguishing a correct answer locally, but an agent commits to a sequence of dependent states. We construct a hidden-tree family in which an erroneous commitment produces no later diagnostic signal, allowing adaptive within-stage stopping while making mistakes irreversible. On this family, stage-local sampling without correctness feedback requires

Θ(nγ−2log⁡(n/δ))\Theta(n\gamma^{-2}\log(n/\delta)) model calls, and the order is tight (Theorem 21 and Theorem 4). Perfect local verification removes the logarithmic amplification overhead, while imperfect verification admits an exact accepted-error and retry-cost law (Theorem 5). Classical checkpointing supplies the square-root intuition, but under LAM we derive the exact rollback cost for semantic transitions and a closed-form optimal checkpoint interval k∗k^* (Theorem 6).

What the LAM abstraction adds. The resource laws above do not follow from their classical counterparts by renaming memory or checkpoint variables. Each requires an execution-level bridge between a harness trace and the corresponding mathematical object. Table 1 summarizes the resulting theory.

The theory is also evaluated prospectively on GPT-6 Astra [1], a frontier reasoning model. Quantitative forecasts are determined from development or calibration data and evaluated on disjoint held-out data with the forecast quantities held fixed. Checkpoint-cost forecasts identify the observed optimal interval at every tested verification price, and a separately frozen tournament prospectively tests cost-aware checkpoint-policy selection, conditional on a programmatic segment check that is not priced as a semantic call. Held-out chained MATH confirms the input-traffic advantage of dependency-aware routing within stepwise execution while exposing an important boundary:

Table 1. Harness-level content of the four resource laws. Each row identifies the execution feature that must be handled to obtain an exact resource statement for a fixed semantic model.

ResourceHarness-specific obstacleLAM result
CommunicationA harness may copy, evict, reload, and recompute physical block occurrences while the controller manages state outside the computation DAG.Value provenance yields an instancewise correspondence with red-blue pebbling and equality of the feasible (N,Qblk)(N, Q_{\mathrm{blk}}) budget region, hence the full discrete call-traffic Pareto frontier.
AccessEqual-capacity memories expose different admissible operations, and buffering or copying can invalidate ordinary stack or stream arguments.Random versus non-speculative sequential access has a Θ(n)\Theta(n) separation on pointer chasing, while FIFO retrieval admits an exact single-stack feasibility and traffic frontier.
RecomputationOnly active context participates directly in semantic calls, while persistent state must be explicitly recovered and the input may be delivered only once.Bit-reversal execution has optimal call complexity Θ(n2/(C+S)+n)\Theta(n^2/(C+S)+n), with an exact feasibility region and a matching linear-transfer construction.
ReliabilityErrors occur inside a dependent state trajectory and correctness feedback is itself a priced resource.Stage-local sampling is tight, imperfect verification has an exact error-cost law, and rollback admits a closed-form optimal checkpoint interval.

whole-task model calls can collapse many logical steps into a single call, with substantially lower input traffic but lower observed held-out reliability in our experiment. Prescribed schedules are reported separately as implementation checks rather than empirical tests of lower bounds (Section 8).

References (43)