CS2680 Modern AI Systems: Agents and System Optimizations
Readings

The “Why read it” summaries are generated by AI. However, the readings themselves are selected and curated by the instructor.

Oct 7 Advanced agent design I: Cost and performance

Paper Year Why read it
Cost-effective agent design
cost and performance on Claude PlatformReducing cost and improving performance with Claude Platform (Anthropic) 2026

Background. The agent-memory readings from the Sep 28 meeting decide what goes into the window. The provider bills for what arrives there, so the same choices that shape context also set the invoice, namely what the prefix looks like from one request to the next, how the instructions are written, and how long the model is allowed to deliberate.

Problem. Cost reduction is assumed to be paid for in accuracy, so it gets deferred until the bill forces it and is then answered with a smaller model. Prompt text also ages badly. Instructions written to prop up an older model, such as verification rituals, emphasis boosters, mandatory procedures, and rules that contradict one another, survive the migration to a newer one, where they are charged on every request and make the output worse rather than safer.

Key idea. Three levers, each measurable on its own. First, keep the prefix byte-identical across requests and place volatile values such as timestamps and session identifiers after that prefix rather than inside it, so the cache is read rather than rewritten, with explicit breakpoints and a request that generates no tokens to warm it. Second, audit the instructions and delete the anti-patterns instead of adding more text to compensate for them. Third, set the effort level per task, because deliberation a task does not need is billed and can lower accuracy.

Findings. Anthropic reports that removing instruction anti-patterns while migrating from Opus 4.8 to Opus 5 decreased cost by 14.6% and increased accuracy by 5.3% on average. Its automated optimizer cuts spend at matched accuracy by about 58% on LegalBench, 73% on tau2-bench retail, 52% on OfficeQA Pro (from $136.20 to $64.87), and 55% on SWE-bench Verified, where the median number of steps per task falls from 29 to 17. Effort remains a real tradeoff rather than free savings: on FrontierCode Diamond, Fable 5 scores 11.5% at low effort for $5.35 per task and 30.9% at maximum effort for $19.00.

Why it matters. It puts a price on the agent-design decisions of the earlier meetings. A prompt written for an earlier model, a prefix that changes one byte per request, and an effort setting nobody revisited are each a recurring charge, and the first two are corrected without changing what the agent can do. The caching advice is also the application side of the prefix-cache meeting later in the course, where the same reuse is a property of the serving system rather than of how you assembled the request. Treat the numbers as vendor-reported and as evidence that cost and accuracy do not always trade against each other, not as a rate to plan against.

RouteLLMLearning to Route LLMs with Preference Dataalso Nov 30 2024

Background. An agent may call a model many times in one run. Paying for the strongest model at every step adds up, while using a cheaper model throughout can put weak answers into the trajectory.

Problem. The agent has to choose a model before seeing either answer. A fixed split between cheap and expensive models cannot send the requests that need the stronger model to it.

Key idea. Learn from human preferences between strong- and weak-model responses to predict when the stronger model is likely to win. A threshold chooses one model per request and can be adjusted to trade response quality against cost.

Findings. On the paper's evaluated benchmarks, the learned routers cut cost by more than 2x in some settings without a measured drop in response quality. Routing performance also transfers to model pairs outside the training set.

Why it matters. Model choice becomes a per-call budget decision alongside prompt caching and effort settings. The paper measures request-level quality, so an agent still needs an end-to-end test: an inexpensive wrong answer early in a run may change every step that follows. The later model-routing meeting examines this mechanism in more detail.

tool-use inefficiencyBeyond Accuracy: Unveiling Inefficiency Patterns in Tool-Integrated Reasoning 2026

Background. Tool-integrated reasoning is scored on accuracy, and its cost is reported in tokens. A token count treats every token as equally expensive and says nothing about what the machine did between them.

Problem. The expensive part of a tool call is the pause. A blocked request can have its KV cache evicted and recomputed on resume, and a bloated tool response is charged as prefill; neither appears in a token total.

Key idea. Introduce Prefill Token Equivalents, a hardware-aware efficiency metric that charges tool-call pauses and response bloat, then use it to name four recurring inefficiency patterns across five tool-use benchmarks.

Findings. In a 256-request experiment running DeepSeek-V3.2 on eight H200 GPUs, PTE correlates with model-generation latency at r = 0.9253 across 100 samples, while output-token count correlates at r = -0.3750. Efficiency rankings remain stable across simulated hardware profiles, with Spearman correlations above 0.95.

Why it matters. It puts cost and accuracy in the same unit, so an agent design can be argued down on efficiency without treating accuracy as free. The unit is hardware work, which is what the operator actually pays for.

software factory at Uber scaleRunning a Software Factory Efficiently at Uber Scale (Uber) 2026

Background. The three cost readings above use benchmark and single-run evidence. Uber reports the same design decisions running as production infrastructure for a whole engineering organization, where more than 70% of pull requests are attributed to local or cloud agents and engineers have built over 3,600 agent skills that execute more than 30,000 times a day.

Problem. Adoption and spend move together. Between February and August 2026 weekly active users across Uber's agentic offerings grew 7× and weekly agentic requests grew 9.4×, so every per-request inefficiency was multiplied by a workload that grew almost tenfold in six months. Waiting for model prices to fall does not close that gap, because usage outruns the price curve.

Key idea. Decompose the bill into factors that different teams can own, namely users, sessions per user, turns per session, requests per turn, tokens per request, and price per token, and give each factor its own mechanism. Mounting over 1,000 MCP servers would add 50,000-70,000 tokens of schema to the initial prompt, so a gateway routes them instead of loading them. Code mode batches tool calls into one executed script rather than paying a model turn per call. Cache policy is written against the vendor's TTL tiers, where a five-minute entry costs 1.25× to write and a one-hour entry 2×.

Findings. Cost per 1,000 model requests is down almost 34% from its peak and cost per session is down 52% from its June peak, over the same months in which usage grew 7×. Code mode reduces tokens by 55%, 58%, 59%, 71%, and about 100% on the reported query types.

Why it matters. The multiplicative decomposition is what turns this meeting's design choices into a budget. A second agent, a longer trajectory, and another mounted tool are each a term in the same product, so the equation tells you which one is worth attacking rather than which one is easiest to change. It is also the reading that prices the fan-out argument at organizational scale, where unit cost and adoption are measured separately and a design is only efficient if it holds while usage grows.