Harnessing LLMs as Agents: What Does It Cost?
Abstract
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 separation between random and non-speculative sequential access on pointer chasing and an exact single-stack FIFO frontier. Recomputation: bit-reversal DAGs require model calls with context capacity and persistent-memory capacity , 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 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. Project page: https://anonymous1776research.github.io/LAM-ICLR2027/.
The Language Model Agent Machine
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. Existing theory largely characterizes what models or agentic extensions can compute; what it does not characterize is the resource cost of realizing that computation through a harness. 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. Universality is in fact cheap in our model, costing model calls and block movements per simulated Turing-machine step at a constant number of context blocks (Proposition 8, appendix). This paper therefore asks a different 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?
Machine model. The LAM models harness-level execution, the prompt construction, state, memory, tools and verification around a model, not the model’s internal computation. Fix an input size and a finite alphabet ; a semantic block is a fixed-width unit of task-relevant information, an element of . A LAM is a tuple
where is the model interface, the harness controller, the active context (at most blocks available to the next model call), the persistent memory (at most blocks across calls, outside ; a stored block must be retrieved into before a call can use it, the persistent copy staying in place), and and the tool and verifier interfaces. A call to consumes blocks in and inserts its output as a new block of , so a call takes at most argument blocks. A tool returns a semantic block through an explicitly charged operation; a verifier returns a tag only (accept/reject), inserts no block, and may inspect all resident blocks. Each interface is a fixed map of its opcode and argument blocks alone: no interface sees the input, , or a block not passed to it. The controller is a finite control with tag and address registers that see block contents only through returned tags and decoded addresses, plus the occupancy pattern of and public step counters.
Value provenance (Definition 1). To separate harness orchestration from semantic computation, every semantic block must originate from an input, a declared constant, or a charged model or tool call. Copying, movement, and storage preserve this origin, while recomputation creates a new occurrence of the same computational value. The controller may route, copy, store, retrieve, and schedule existing blocks, but it cannot create semantic blocks otherwise. This restriction is load-bearing: it lets differences in execution cost be attributed to harness design rather than to a stronger underlying model.
What an execution is charged for.
| Counter | Meaning |
|---|---|
| Number of model calls; tool and verifier calls are counted separately as , . | |
| , | Total symbols supplied to, and produced by, model calls over the execution. |
| Semantic blocks transferred between and , i.e. symbols of context–memory traffic. | |
| Unit head movements of a sequential interface; zero for random access. is the total number of memory-interface operations. | |
| Observations of input blocks made outside model-call arguments: an address decoded from a block, its use as a tool or verifier argument, or its emission as output. | |
| , | Capacities of the active context and of persistent memory, in blocks. |
| , , , | Per-transition error probability; probability gap between the correct successor and the most likely incorrect one; allowed overall failure probability; weighted cost of one verifier call. |
Prior inference models as LAM parameter settings. The table is descriptive: the rows differ in which resource grows, and the comparison is one of resources rather than of computational power. is the number of reasoning steps.
| Model | Memory | Context | Verifier | Resource that grows |
|---|---|---|---|---|
| Direct inference | – | – | nothing () | |
| Chain of thought | – | – | context | |
| Managed context | – | – | calls only | |
| Memory-augmented | RAM | – | calls, memory I/O | |
| Tool-augmented | any | – | oracle queries | |
| Verifier-assisted | any | yes | verifier queries | |
| LAM (this work) | any | any | optional | all of them, jointly |
Two classical theories anticipate two of these resources: the red–blue pebble game of Hong and Kung lower-bounds the traffic between a small fast memory and a large slow one, and reliable computation from unreliable components anticipates an agent whose transitions are expensive and imperfect. An agent exhibits both at once, and the LAM recovers and sharpens both classical theories: Theorem 1 transfers every Hong–Kung I/O lower bound instancewise to context–memory traffic, and Theorem 6 recovers the Young–Daly checkpoint law with its exact cost, a closed-form optimum and the class of rollback policies in which it holds.
What the LAM abstraction adds. The resource laws 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.
| Resource | Harness-specific obstacle | LAM result |
|---|---|---|
| Communication | A 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 budget region, hence the full discrete call–traffic Pareto frontier. |
| Access | Equal-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 separation on pointer chasing, while FIFO retrieval admits an exact single-stack feasibility and traffic frontier. |
| Recomputation | Only 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 , with an exact feasibility region and a matching linear-transfer construction. |
| Reliability | Errors 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. |
Results
The results isolate four harness costs: communication, access, recomputation and reliability. Each result states a design Problem, its Assumptions and its Conclusion. Comparisons hold the semantic oracle fixed; only the harness changes.
Numbering follows the submitted manuscript. Theorems 1 to 6 appear in the main text; the other results appear in the appendices.
Common definitions
Value provenance (Definition 1). Every semantic block originates from an input, a declared constant, or a charged model or tool call. The controller may route, copy, store, retrieve and schedule blocks, but never manufacture one. Under this axiom, the lower bounds concern the harness rather than the model.
Vertex-granular -evaluation (Definition 2). A vertex-granular evaluation of an -realisable DAG is a provenance-respecting LAM execution that produces the designated sinks of , where each charged semantic call implements at most one declared vertex operation of . The execution may copy, move, store, retrieve, evict and recompute values arbitrarily. Two conventions fix how sources enter:
- Memory-initialized: all source blocks are initially stored in , the context starts empty, and every designated sink is resident in or at termination.
- Input-delivered: each source is instead delivered exactly once through the input port.
Costs and capacities.
| Symbol | Meaning |
|---|---|
| Number of model calls; written when distinguishing model and verifier calls | |
| Input and output symbols over all calls | |
| Blocks moved between context and memory | |
| Unit head movements of a sequential interface | |
| Total memory operations: | |
| Observations of input blocks outside model-call arguments | |
| Context and memory capacities, in blocks | |
| Number of verifier calls and weighted cost of one verifier call |
The weighted model-and-verifier cost is
Communication: replay or persist?
Theorem 1 (red–blue pebbling correspondence).
For memory-initialized vertex-granular evaluations, classical I/O bounds become context–memory traffic bounds, and the two models share the whole feasible resource region.
Problem. How much context–memory traffic is required to evaluate a fixed computation DAG?
Assumptions.
- is an -realisable computation DAG with designated sinks. Consider memory-initialized vertex-granular -evaluations with capacities ; recomputation is allowed.
- Value provenance holds, and all semantic working storage is counted inside .
- A vertex of in-degree requires , so that its arguments and result co-reside.
Conclusion. The correspondence works in both directions:
- Every memory-initialized vertex-granular -evaluation with capacities induces a legal red–blue pebbling with at most red and blue pebbles, exactly one Compute move per model call, and at most one Load or Store move per context–memory transfer.
- Conversely, every such pebbling induces a vertex-granular evaluation on a random-access LAM with no larger call or transfer budget.
Hence the two models have the same feasible call–transfer budget pairs and the same discrete Pareto frontier. In particular,
where is the minimum pebbling load-and-store count, attained by a random-access machine. Every red–blue I/O lower bound therefore lower-bounds context–memory traffic.
The correspondence is instancewise. It preserves every priced optimum
for all (Corollary 9). It also preserves feasibility under every simultaneous call and transfer budget, hence the entire discrete Pareto frontier of (Corollary 10).
The evaluation-to-pebbling direction applies to every memory interface, counting pushes, pops, reads and writes as loads and stores.
Corollary 11 (communication bounds for two DAGs).
The correspondence gives concrete transfer bounds for grid and matrix-multiplication DAGs.
Problem. What traffic bounds follow for two standard computations?
Assumptions.
- The hypotheses of Theorem 1, over memory-initialized vertex-granular -evaluations.
- For the grid DAG: and .
- For the ordinary -operation matrix-multiplication DAG on inputs: , so that all sources fit in memory.
Conclusion. The optimal grid traffic is
For , this simplifies to . A uniform tiled schedule driven by public structural counters attains the bound.
For matrix multiplication,
Both statements concern block transfers for evaluating the prescribed DAG.
Proposition 12 (sequential input traffic).
On dependency-bounded chains, replay incurs a linear-factor input-traffic overhead.
Problem. What does replaying the full history cost compared with supplying only dependencies?
Assumptions.
- An -step chain produces one semantic block of width at each step.
- Replay supplies call with all earlier blocks. Dependency-only prompting supplies the blocks that the step reads.
- The lower bound applies to any LAM evaluating a non-degenerate chain vertex by vertex, each call taking the previous block as an argument.
Conclusion. Replay uses
whereas dependency-only prompting uses
No vertex-wise evaluation of the chain has . Dependency-only prompting is therefore optimal within a constant factor, while replay pays a factor more.
Access: which interface?
Theorem 2 (demand-following pointer chasing).
Demand-following pointer chasing separates random access from sequential access.
Problem. What does direct addressing save when each read reveals the next address?
Assumptions.
- A table of entries holds a uniformly random permutation of . Starting at , the agent follows for steps. One block holds one index.
- For the lower bound, sequential executions are always correct and non-speculative: every read is of or of a cell whose index was previously read into the context. Executions may be deterministic or zero-error randomised.
- The additional -scale lower bound allows speculation and randomisation, but requires always-correct, read-only sequential execution.
Conclusion. A random-access LAM follows the pointers with and :
- At , it needs no model call if the controller decodes each entry.
- At , it needs calls if the model decodes the entries.
For the non-speculative sequential class,
and hence
This gives a gap in memory operations per hop. Expectations include the random permutation and any execution randomness.
For the broader read-only class, the total head movement still satisfies
for (Proposition 14, Corollary 15). This is a total-movement bound, not a per-hop bound.
Theorem 16 (query bandwidth).
Task query complexity lower-bounds the input bandwidth available to a harness.
Problem. How much input must a harness observe, regardless of its interface or adaptive address choices?
Assumptions.
- Value provenance holds and .
- For , let be deterministic worst-case block-query complexity and randomised worst-input expected query complexity at error .
- Each model call exposes at most argument blocks. Every observation of an input block outside those arguments is counted in .
- The output is the block emitted or the tag halted with.
Conclusion. Every deterministic LAM computing has an input on which
Every randomised LAM with error at most on each input satisfies
The relevant quantity is query complexity, not global relevance. For the selector , all inputs are relevant but . Parity of blocks instead has .
Theorem 17 and Corollary 19 (exact one-stack frontier for FIFO).
A single stack has an exact context–storage threshold for reproducing a stream in order.
Problem. What context and traffic does a one-stack implementation of FIFO require?
Assumptions.
- In , blocks arrive one at a time during a write phase and must be emitted in the same order during a read phase.
- The machine has one stack of capacity and context capacity . It makes no model or tool call; verifier calls returning tags are allowed, and finite control may be arbitrarily large.
- The machine must be correct on every input. The block alphabet permits pairwise distinct inputs, and write-phase buffering is unrestricted.
Conclusion. Random access solves with , and .
A one-stack LAM solves it if and only if
Here denotes the positive part of . Every such machine makes at least pushes and pops. A content-blind schedule attains the capacity and traffic bounds, so the frontier is exact.
If the write phase is instead copy-free streaming, is necessary and sufficient.
Recomputation: persist or regenerate?
Theorem 3 (persistence versus recomputation).
On bit-reversal reuse, total semantic capacity controls the minimum call count within the feasible region.
Problem. How many model calls can persistent memory save on reused intermediates?
Assumptions.
- The -realisable bit-reversal DAG , with , consists of two length- chains and , with edges . The second chain reuses the first chain’s results in bit-reversed order.
- For the matching upper bound, consider input-delivered vertex-granular evaluations with , random-access memory of capacity , and .
- The lower bound applies to every input-delivered vertex-granular -evaluation with and .
Conclusion. In the feasible random-access setting, the minimum number of model calls is
The explicit bounds are
Every evaluation in the lower-bound class obeys the first inequality. A random-access LAM attains the upper bound with .
For , an evaluation exists if and only if and . Within this feasible region, exactly when :
- With , the DAG costs calls and transfers, under the memory-initialized convention as well.
- With , it costs calls: a factor more when .
Thus, once feasibility is satisfied, the call bound depends on total semantic capacity rather than its split between context and memory; the split sets the transfer cost.
Reliability: sample, verify or checkpoint?
Consider a chain of semantic transitions. Given a correct state, a model call returns the intended successor with probability ; an undetected error propagates to the end. Let be the probability gap between the correct successor and the most likely incorrect alternative, and let be the allowed overall failure probability.
Each result below states its own independence and feedback assumptions.
Theorem 21 (sampling amplification, upper bound).
Independent sampling and plurality voting can control end-to-end failure.
Problem. How many samples per transition suffice for overall failure probability at most ?
Assumptions.
- Repeated calls at a correct state are independent.
- At most incorrect alternatives have nonzero probability. Each has probability at most , where is the correct block’s probability.
- The harness uses a plurality vote at each transition.
Conclusion. Taking samples per transition gives overall failure at most , using
model calls.
Theorem 4 (stage-local sampling lower bound).
On a hard stage-local family, adaptive sampling still pays a logarithmic overhead.
Problem. Can adaptive sampling avoid the overhead without any correctness signal?
Assumptions.
- The task is a depth- binary-tree family of -separated transition distributions, with , block width , and hidden labels drawn at random.
- The strategy knows the construction but not the labels. It samples only at its current node, may choose sample counts adaptively and aggregate samples arbitrarily, but receives no correctness signal and cannot revise a committed transition.
- It reaches the designated leaf with probability at least , where , over labels, samples and its own randomness.
- Off-path states have the same local sampling law as correct-path states, so later outputs do not reveal an earlier error.
Conclusion. For ,
This is an lower bound. Together with Theorem 21 (the binary family has ), it fixes the order
for sampling without feedback on this stage-local hard family.
Theorem 22 (perfect local verification).
Perfect local feedback gives zero-error execution with linear expected cost at fixed error and verifier cost.
Problem. What does a correctness signal before each commitment save?
Assumptions.
- A perfect local verifier has weighted cost .
- Fresh attempts are independent, with error probability .
- Retries are uncapped: the harness resamples each transition until the verifier accepts.
Conclusion. The execution terminates almost surely with zero error, and
Its expected weighted cost is
which is for fixed and .
On the hard family of Theorem 4, this removes the factor for constant and . The gain comes from feedback, not from more sampling.
Theorem 5 (imperfect local verification, characterised exactly).
Repeated checks trade accepted-error probability against the cost of false rejections.
Problem. How do verifier errors and repeated checks determine reliability and cost?
Assumptions.
- The verifier accepts a wrong candidate with probability and rejects a right candidate with probability , with the same rates for every candidate. The model error satisfies .
- Candidate attempts are independent. The checks of a candidate are conditionally independent given its correctness.
- Every attempt pays for all checks. A candidate is accepted only if all checks accept.
- The exact chain-failure and chain-cost formulas additionally use a stationary attempt law.
Conclusion. Define
At a transition whose earlier accepted transitions are correct, the accepted candidate is wrong with probability . The expected numbers of attempts and model calls are each ; the expected number of verifier calls is . Therefore,
Under the stationary law, the chain-failure probability is exactly
and the expected costs are
The accepted-error odds satisfy
Repeated checks lower these odds if and only if . If , one check makes them zero.
In the regime , the smallest satisfying gives
This is Corollary 25: false rejections drive the call overhead from repeated checking. Corollary 23 extends the law to candidate-dependent acceptance probabilities, and Corollary 24 to an arbitrary batch-acceptance event with dependent checks within an attempt; the candidate-dependent form is motivated by the verifier behaviour observed in the frontier-model experiments.
Theorem 6 (checkpoint law).
Periodic rollback has an exact cost and a closed-form continuous optimum.
Problem. How many transitions should run between expensive checks?
Assumptions.
- Transition errors are independent, with probability . A perfect segment verifier costs .
- The policy verifies every transitions and rolls a rejected segment back to its last accepted checkpoint.
- The displayed cost assumes that divides . Otherwise, the exact cost adds one shorter final segment.
- For the dependent-error extension, every conditional error hazard lies in after every history and rollback; no independence is required within or between attempts.
Conclusion. Under independent errors, the expected weighted cost is exactly
With , its positive-real minimiser is
As ,
If also , then . For optimisation of the cost expression over positive integers, an optimum lies within one of , and a verifier cost linear in returns the optimum to .
This is the Young–Daly checkpointing law in whole-segment form, with an exact cost and closed-form optimum rather than a first-order approximation.
Under the hazard-bounded extension, lies between evaluated at and at (Proposition 28).
Proposition 26 (joint local verification and segment rollback).
Local checking and segment rollback can be priced in one formula.
Problem. Should a harness check each step, check each segment, or combine both?
Assumptions.
- Use the imperfect local verifier of Theorem 5 with unanimous checks per accepted step; means no local check.
- After every accepted steps, an independent perfect segment verifier of cost accepts exactly when all states are correct. Rejection triggers rollback.
- The stationarity and independence assumptions of Theorem 5 hold, and divides .
Conclusion. Let be the expected weighted cost per locally accepted step, and let be its residual error. Then
With , the continuous checkpoint optimum for is
clipped to .
Interior hybrids strictly beat both pure checkpointing and pure local checking in an explicit regime. The exact finite optimum is a small enumeration over integer . Corollary 27 adds a price per semantic block transfer to the same formula.
The frontier-model tournament of Section 8 is a direct instance: its forecast winner and measured winner are both read off these formulas.
Design rules
- Send a step its dependencies, not the history. On chains whose steps read earlier blocks, dependency-only prompting uses linear rather than quadratic input traffic (Proposition 12). The measured frontier-model factors are on the synthetic chain, on development MATH and on held-out MATH.
- Reach state by random access. Pointer chasing has a memory-operation gap over non-speculative sequential access (Theorem 2). The broader read-only result gives an lower bound on total sequential head movement even with speculation (Proposition 14).
- Persist reusable blocks. Bit-reversal reuse gives a model-call gap in the stated sublinear-context regime (Theorem 3); linear call complexity holds exactly when total semantic capacity is linear in .
- Buy feedback, then choose the checkpoint interval. On the stage-local hard family, feedback removes the sampling factor (Theorems 4 and 22). With an imperfect verifier, repeated checks improve accepted-error odds only for ; if , one check suffices (Theorem 5). Use to choose an interval for expensive checks (Theorem 6), or combine local checks with rollback (Proposition 26). The frontier-model tournament selected its policy from these formulas before the run, and the selected policy was the cheapest certified arm on the held-out chains.
Experiments
Although the primary contribution is theoretical, experiments play two roles. All model-based experiments use the same fixed GPT-6 Astra deployment. Held-out tests compare development-derived quantitative predictions or policy choices with disjoint evaluation data, covering communication, checkpointing and reliability. Implementation checks verify that prescribed schedules realize their analytically determined resource accounting; these are reported separately and are not treated as empirical tests of lower bounds. Development or calibration data and held-out evaluation data are disjoint; forecast parameters and policy-selection rules determined from the former remain fixed on the latter. Success rates use Wilson 95% intervals, token means use chain-level bootstrap intervals, and paired comparisons use exact McNemar tests.
Communication
As Proposition 12 predicts, the replay-to-dependency-only ratio of logical input traffic grows linearly with depth. For fixed-width state and record encodings the two policies obey the identities and , with per-step overhead and history-record width , and the measured logical traffic follows them across the evaluated depths.
| Setting | Logical input traffic, replay ÷ dependency-only | With exact-prefix caching |
|---|---|---|
| Synthetic chain, | ||
| Development chained MATH, depth 16 |
Replay prompts share long prefixes, so logical traffic can overstate physical prefill when prefix caching is available; the exact-prefix accounting shows that caching narrows, but does not eliminate, the communication advantage of dependency-aware prompting.
Held-out MATH: traffic, success, and granularity
From the 207 eligible MATH-500 problems we build 100 depth-16 answer-dependent chains following Compositional GSM: chains 1–30 form the development set and 31–100 the held-out compositions. GPT-6 Astra is evaluated under four harness configurations: Direct, using one whole-chain call; full-history replay; dependency-only prompting; and dependency-only prompting with an accept/reject verifier. The routing protocol, traffic intervals and success forecasts are determined from the development chains and held fixed on the held-out compositions.
| Condition (70 held-out chains) | Final answer correct | Every link correct | Input tokens per chain |
|---|---|---|---|
| Dependency-only + verifier | 70/70 | 70/70 | 3,217 |
| Replay | 67/70 | 65/70 | 35,124 |
| Direct (one whole-chain call) | 65/70 | 64/70 | 1,311 |
Dependency-only prompting with verification solves every held-out chain with every link correct, at a reduction in input tokens relative to replay. Direct uses the fewest input tokens, in a single call, with lower observed held-out reliability. Thus dependency-aware routing sharply reduces logical input traffic within stepwise execution, while Direct exposes a complementary granularity tradeoff.
Execution granularity is itself a resource choice. A sufficiently capable model may compress many logical dependencies into one semantic call, simultaneously reducing both call count and input traffic. This does not contradict the vertex-granular frontier: it changes the computational primitive being priced. Conversely, the stepwise conditions expose intermediate state to memory management and verification, yielding higher all-link reliability in the held-out evaluation. The choice of semantic-call granularity therefore determines which communication–reliability tradeoffs are available to the harness, and the vertex-granular theory characterizes the resource frontier of stepwise execution rather than of unrestricted whole-task calls.
Reliability: checkpoint forecasts and held-out policy selection
An arm is a policy of the reliability section on a length-16 modular-affine chain with target failure probability . Forecast quantities are fixed before evaluation and compared against held-out measurements and their 95% intervals. The deployment’s calibrated step error is , and its yes/no check costs solver calls in tokens. On a separate transfer set, unamplified chain success is forecast at and measured at , while the in-chain step hazard is forecast and measured at .
Checkpoint law (controlled check). With a programmatic perfect segment verifier at stipulated prices , checkpoint attempts per segment match the frozen predictions, the cost forecast is reproduced, and the forecast and measured grid minimisers coincide at every price (; panel (c) of the figure above).
| Quantity | Forecast | Measured |
|---|---|---|
| Attempts per segment, | 1.051 | 1.049 |
| Attempts per segment, | 1.222 | 1.208 |
| Attempts per segment, | 2.230 | 2.083 |
| Weighted cost at | 24.4 | 24.2 |
| Cost-minimising at prices 1, 4, 16 | 4 / 8 / 16 | 4 / 8 / 16 |
Wrong-sample rates vary sharply across chain states, so a pooled homogeneous i.i.d. error model does not describe the observed sampling data; a model that preserves the observed state-dependent error structure describes held-out failures substantially better. The predeclared voting arm nevertheless solves chains with wrong plurality decisions. Verifier errors are likewise candidate dependent, which motivates the candidate-dependent formulation of imperfect verification (Corollary 23).
Held-out policy tournament. The tournament compares the principal reliability mechanisms: unverified execution, sampling, local verification, segment rollback, and the joint local-verification–rollback policy. A decision rule calibrated on disjoint data is held fixed on 100 shared held-out chains per arm. At the primary setting , the frozen decision rule selects rollback with . On the held-out chains, is also the cheapest certified policy, with failures and weighted cost , matching the frozen cost forecast of (panel (b)). The segment check composes the public affine constants into outside the priced semantic execution, so the result is a prospective test of checkpoint-policy selection conditional on that implemented interface.
Implementation checks
Bit-reversal schedules with the real model. The bit-reversal DAG is instantiated with fixed semantic vertex operations; each model call receives only the blocks required by its scheduled vertex, and the controller enforces the prescribed context and persistent-memory capacities. Recomputing, persistent and resident schedules are compared together with a one-call Direct reference, with rule-specific error and token costs estimated on disjoint calibration data and held fixed. Every prescribed schedule reproduces its analytically determined call, recomputation and transfer counts exactly, without a capacity violation: persistent execution achieves linear model-call complexity with linear context–memory traffic, resident execution removes the transfer cost when all required state fits in context, and recomputing execution incurs the predicted additional semantic calls when persistent state is unavailable (panel (d)).
Controlled simulators. Deterministic simulators execute the constructive schedules of the communication, access and recomputation sections under the formal context and memory bounds, and a stochastic simulator implements the reliability policies with prescribed error laws. On grid DAGs the tiled schedule exhibits the communication scaling of Corollary 11, whereas row-major execution remains quadratic until a live row fits in context; on sequential chains, replay and dependency-only prompting reproduce the quadratic and linear input-accounting laws of Proposition 12; on pointer chasing, random access incurs one block read per pointer while demand-following sequential access pays for the intervening head movement, consistent with Theorem 2. For checkpointing, simulated retry costs closely follow the exact objective of Theorem 6 and the observed optimum tracks its closed-form minimiser; the square-root approximation is accurate only in its stated asymptotic regime.
Across the tested capacity regimes the checkpoint construction reproduces , its measured counts satisfying within the explicit constants of Theorem 3, with context–memory traffic . With sufficient persistent storage it uses exactly model calls. The check also reproduces the feasibility boundary: at , no-persistence execution fails from insufficient semantic capacity, whereas adding one persistent block makes the schedule feasible.
Conclusion
LAM makes agent-harness architecture a mathematical object whose resource requirements can be bounded, compared, and optimized while semantic capability is held fixed. Across communication, memory access, recomputation, and reliability, the framework yields exact feasible regions, lower bounds, and closed-form resource tradeoffs. The experiments compare frozen predictions with measurements while also exposing the scope of the theory: dependency-aware routing sharply reduces logical input traffic within stepwise execution, whereas held-out chained MATH shows that a whole-task call can use still less input traffic at lower observed reliability, outside the vertex-granular frontier. Together, these results separate semantic capability from the resource cost of realizing that capability through an agent harness. LAM therefore provides a resource theory of agent execution: harness architecture determines which call, memory, communication, and reliability tradeoffs are achievable even when the underlying semantic model is held fixed.
What accompanies the submission
All theoretical results are stated with their assumptions and proved in the appendices: Theorems 1 to 6 in the main text, and the remaining propositions, corollaries and lemmas, including the exact single-stack normal form, the candidate-dependent and batch-acceptance verification laws, the joint verification–rollback policy and the conditional-hazard checkpoint envelope, in Appendices A to E. Appendix F reports the controlled execution checks and Appendix G the GPT-6 Astra protocol, communication and cache accounting, reliability calibration, dependence diagnostics, the held-out tournament and the bit-reversal implementation check. The supplementary material releases the simulation code, the frontier-model harness, the theorem-target problem set, the figure-generation scripts, raw request logs, frozen experimental configurations and result files, together with the protocols, prompts, model settings, datasets, seeds and other parameters needed to reproduce the reported experiments.
BibTeX
@inproceedings{anonymous2027lam, title = {Harnessing LLMs as Agents: What Does It Cost?}, author = {Anonymous Authors}, booktitle = {Submitted to the International Conference on Learning Representations (ICLR)}, year = {2027}, note = {Under review}}