1 00:00:01,000 --> 00:00:09,300 [Hal Turing] Alrighty! Thanks for tuning in! Hello AI world! I am your host, Hal Turing, and my co-host is Dr. Ada Shannon. 2 00:00:09,300 --> 00:00:46,325 [Hal Turing] Today we're looking at "Agentic Coding in the Wild: Characterizing GitHub Copilot at Production Scale." The first author is Banruo Liu at UIUC, working with Haoran Qiu, Íñigo Goiri, Rodrigo Fonseca and Esha Choukse at Microsoft Azure Research, and Ricardo Bianchini at Microsoft Azure. The claim is that a coding agent is a different workload from a chatbot. The cache that serves it behaves differently too: roughly 90% reuse inside a turn, about 55% after the user pauses, and almost nothing after a model switch. 3 00:00:46,325 --> 00:01:08,075 [Dr. Ada Shannon] The stakes are simple. Most LLM serving infrastructure was built for independent, stateless chat requests. If agent traffic is session-shaped, then request-level scheduling and plain LRU eviction waste a lot of work. The paper tries to measure how much, using sampled client-side telemetry from the first week of June 2026. No prompt text or code was collected, and it covers US regions only. 4 00:01:08,075 --> 00:01:13,375 [Hal Turing] Start with what an agent actually does. I type one prompt, and then what? 5 00:01:13,375 --> 00:01:58,474 [Dr. Ada Shannon] A loop, in the ReAct style. The model reads the context and emits a tool call, say read a file or run the tests. The harness executes it, appends the output to the prompt, and calls the model again. That repeats until the agent decides it's done. So GPU inference alternates with CPU and I/O work, and one prompt can become dozens of LLM calls. The paper gives that a vocabulary. A session is the whole lifetime of one agent session. A turn is one user prompt plus the entire autonomous chain that follows it. A step is a single LLM call or tool call. Every turn starts with exactly one user-initiated LLM call, and everything after that is agent-initiated. They find 87% of LLM calls are agent-initiated, and LLM calls and tool calls come in roughly a one-to-one ratio. 6 00:01:58,474 --> 00:02:02,174 [Hal Turing] So the human shows up only at turn boundaries. 7 00:02:02,174 --> 00:02:23,125 [Dr. Ada Shannon] Right, and that's the first mismatch with chat. A chat request is short and independent. Here, the next step cannot start until the current tool finishes. The prompts are also enormous and nearly identical from call to call. The median call carries about 68,000 prompt tokens and produces 247 output tokens. That's over 275 to 1, input to output. 8 00:02:23,125 --> 00:02:29,150 [Hal Turing] That's where the KV cache comes in. Remind me what it does and why it matters here. 9 00:02:29,150 --> 00:03:05,475 [Dr. Ada Shannon] For every token the model has processed, attention keeps key and value tensors. If you store them, you don't recompute the prompt on the next call. Prefix caching goes further: if a new request starts with exactly the same tokens as a cached one, the engine reuses those tensors and only processes the new tail. In an agent loop, each call is the previous prompt plus a bit more, so reuse should be very high. But it only works while the cached entries survive. The paper defines hit rate as the share of prompt tokens served from cache. It infers that the serving side evicts entries after a timeout. That's inferred from client telemetry. The authors never see the server. 10 00:03:05,475 --> 00:03:10,575 [Hal Turing] And the other two events from the top, model switch and compaction? 11 00:03:10,575 --> 00:03:34,325 [Dr. Ada Shannon] A KV cache belongs to one model's weights. Switch models between turns and the cache is simply useless. Compaction is the harness summarizing older history when the context nears the window limit. It rewrites the start of the prompt, so the old prefix no longer matches and the next call is a cold start. It also costs an extra LLM call to write the summary. Those are two separate ways to lose the cache, and a serving engine only sees a mysterious drop in hits. 12 00:03:34,325 --> 00:03:39,325 [Hal Turing] What about the idle side? You said the human appears only at boundaries. 13 00:03:39,325 --> 00:04:01,050 [Dr. Ada Shannon] Two clocks. Container idle is the gap between consecutive tool calls, while the sandbox waits. KV-cache idle is the gap between consecutive LLM calls. Inside a turn these are seconds. Across a turn boundary, where the agent has finished and the user is reading or typing, they're minutes. That's why the boundary is a natural place to reclaim resources, which is the second half of the paper's argument. 14 00:04:01,050 --> 00:04:07,076 [Hal Turing] Is any of this new, though? Systems people have thought about caching for agents before. 15 00:04:07,076 --> 00:04:27,626 [Dr. Ada Shannon] On agents specifically, the closest work is CacheTTL, by Hanchen Li, Azalia Mirhoseini and Ion Stoica, 2025, titled "Efficient Agentic LLM Inference with KV Cache Retention." It keeps KV across tool-call gaps, but it was evaluated on synthetic SWE-bench-style traces, not a record of what developers actually do. 16 00:04:27,626 --> 00:04:29,851 [Hal Turing] And the idle-time part? 17 00:04:29,851 --> 00:04:49,151 [Dr. Ada Shannon] That follows "Serverless in the Wild," by Mohammad Shahrad and colleagues, 2020, at USENIX ATC. It used per-application idle-time histograms to decide when to unload and pre-warm. The recipe is the same: production trace, then predictor, then orchestration policy, now applied to agent sessions. 18 00:04:49,151 --> 00:04:51,926 [Hal Turing] What scale are we talking about? 19 00:04:51,926 --> 00:05:14,201 [Dr. Ada Shannon] Table 3 gives 13.5 million sessions, 95.1 million turns, 760.5 million LLM calls and 774.7 million tool calls. A caveat before we lean on any of that: some totals in this paper don't agree with each other, including the abstract. We'll audit that in the last part. For now, treat the structure as the finding, and the exact magnitudes as provisional. 20 00:05:14,201 --> 00:05:23,451 [Hal Turing] Fair. Structure first, then the numbers. Before the cache numbers, what exactly was recorded? They never saw the code or the prompts, right? 21 00:05:23,451 --> 00:05:44,101 [Dr. Ada Shannon] Right. The telemetry has timestamps, durations, token counts without reasoning tokens, model and tool names, and success or failure. It has no prompt text, no file contents, and nothing from the server side. Identifiers are anonymized but still linkable, so they can rebuild a session. That matters later, because everything about the cache is inferred from the client. 22 00:05:44,101 --> 00:05:47,727 [Hal Turing] And the loop itself? You said the calls pair up. 23 00:05:47,727 --> 00:06:10,802 [Dr. Ada Shannon] Close to one to one. Execution is also mostly serial. The median parallelism in a turn is 1.15, and 93% of tool batches contain a single tool. Turns differ a lot, though. About 9% of turns are what they call deep-loop-with-failures. A build fails, the agent reads the error, retries, and the turn runs around 36 LLM calls, roughly four times the median. That's a long-tail pattern, not typical behavior. 24 00:06:10,802 --> 00:06:14,452 [Hal Turing] Where do the tokens come from in those long prompts? 25 00:06:14,452 --> 00:06:34,652 [Dr. Ada Shannon] Mostly the agent's own past. Conversation history plus tool output is over 75% of prompt tokens. On time, tools are mostly quick, with a median call of 166 milliseconds, but builds and terminal commands average around 70 seconds. And in multi-turn sessions, the user being idle is about 80% of wall clock. 26 00:06:34,652 --> 00:06:38,278 [Hal Turing] So that's the setup. What happens to the cache? 27 00:06:38,278 --> 00:07:00,803 [Dr. Ada Shannon] Inside a turn it's excellent. About nine of every ten prompt tokens come from cache. The cache then breaks at three events. The first is a same-model turn boundary. The last call before the boundary hits about 81%, and the first call after hits 55%. That's a 26-point drop. The second is a model switch. It goes from 75% to 8%, because one model's cache is useless to another. The third is compaction. 28 00:07:00,803 --> 00:07:04,128 [Hal Turing] Is the boundary drop smooth or abrupt? 29 00:07:04,128 --> 00:07:24,278 [Dr. Ada Shannon] Abrupt, which is the interesting part. For gaps under two minutes the median hit rate stays at or above 95%. Between two and ten minutes it falls to about 70% with a huge spread. Beyond ten minutes it's near zero. That shape looks like a timeout-based eviction on the serving side. But the authors can't see the server, so the timeout is an inference. 30 00:07:24,278 --> 00:07:27,904 [Hal Turing] Fine. And compaction is the third cliff. 31 00:07:27,904 --> 00:07:47,730 [Dr. Ada Shannon] The median compaction event drops 72.8% of prompt tokens. The rewritten prefix shares little with the old one, so the median first-call hit rate falls by 66.1 points. The summarization call itself takes about 22% of that turn's time at the median. So that's two costs: one extra call and one nearly cold cache. 32 00:07:47,730 --> 00:07:51,855 [Hal Turing] Now the idle side. You said the gaps are bimodal. 33 00:07:51,855 --> 00:08:10,655 [Dr. Ada Shannon] Inside a turn, the KV cache sits unused for a median of 1.2 seconds. Across a turn boundary it's 172 seconds, about 140 times longer. More than 90% of idle gaps are the short kind. So the boundary tells you when a session is parked, but not for how long. 34 00:08:10,655 --> 00:08:13,630 [Hal Turing] Which is where the predictor comes in. 35 00:08:13,630 --> 00:08:45,980 [Dr. Ada Shannon] Yes. It doesn't output one number. It outputs a survival curve, the probability that the idle gap exceeds t seconds. A scheduler can choose its own threshold. Once t0 seconds have already passed, it divides S of t by S of t0 to update. Under the hood it's twelve LightGBM quantile models trained on log idle time, 400 trees each. The whole thing is about 2 megabytes and runs in under 3 milliseconds per boundary. The most important features were accumulated average idle time and turn index, together over half of importance. Token counts barely mattered. 36 00:08:45,980 --> 00:08:48,105 [Hal Turing] How well does it work? 37 00:08:48,105 --> 00:09:23,430 [Dr. Ada Shannon] For predicting whether a gap exceeds 60 seconds, ROC-AUC is 0.73. The previous-gap heuristic gets 0.58, and always-positive gets 0.5. They trained on 150,000 sessions and tested on 50,000 from the following week. That's a real gain, but modest, and the authors say model variants barely changed it. Accuracy also decays as the threshold grows, from about 80 to 88% at 30 seconds to 25 to 43% at 30 minutes. Yet captured idle time stays at 86 to 90%. 38 00:09:23,430 --> 00:09:26,855 [Hal Turing] Why would one decay while the other holds? 39 00:09:26,855 --> 00:09:48,855 [Dr. Ada Shannon] Captured idle time is the share of total idle seconds that falls in gaps the model correctly flags as long. A few multi-hour gaps contain most of those seconds. So it's a different question from per-gap accuracy. It's also easy to score well on, and the paper reports no always-reclaim-at-the-boundary baseline to compare against. I wouldn't read 86 to 90% as strong evidence yet. 40 00:09:48,855 --> 00:09:53,705 [Hal Turing] Suppose the prediction is good enough. What would a system do with it? 41 00:09:53,705 --> 00:10:14,855 [Dr. Ada Shannon] Keep the cache on the GPU within a turn. At the boundary, deprioritize it or move it to DRAM or disk. Where the provider has a fixed retention window, such as the 300 seconds the paper cites for Claude prompt caching, send a cheap keep-alive just before the deadline if the predictor says the user is about to return. On the tool side, put the container to sleep across the boundary and keep it warm inside the turn. 42 00:10:14,855 --> 00:10:18,205 [Hal Turing] Do all users need the same treatment? 43 00:10:18,205 --> 00:10:43,630 [Dr. Ada Shannon] The paper clusters users into five archetypes. Readers are the largest at 41.7% and Coders are 30.4%, with Terminal, Deep-loop and Chat-only users making up the rest. Median tokens per turn run from 23,000 for Chat-only to 1.1 million for Deep-loop, about 50 times apart. So a cache miss costs a re-prefill of 1.1 million tokens for one group and 23,000 for another. That argues for archetype-aware retention. 44 00:10:43,630 --> 00:10:50,930 [Hal Turing] Part of the paper's pitch is a headline scale. Do those numbers hold up when you check them against the tables? 45 00:10:50,930 --> 00:11:12,155 [Dr. Ada Shannon] Not to precision. The abstract says 95 trillion tokens. Table 3 gives 44.9 trillion prompt tokens plus 39.3 billion completion tokens. The 95.1 million in that table is the turn count, so the abstract looks like a unit slip. The abstract also says 13 million sessions, and the tables say 13.5 million. 46 00:11:12,155 --> 00:11:16,680 [Hal Turing] Those sound like typos. Do they touch anything that matters? 47 00:11:16,680 --> 00:11:59,055 [Dr. Ada Shannon] The per-turn figures are the bigger problem. Section 4.2 gives medians of 160.2K prompt tokens, 265 completion tokens and 3 LLM calls per turn. Table 4 gives 227.6K, 1.9K and 4.5. Table 2's "15 median calls" matches Table 4's per-session median, not a per-turn one. My own arithmetic from Table 3 gives about 8.0 LLM calls per turn and 7.0 turns per session, while Table 4's means are 6.6 and 6.1. The paper doesn't reconcile these. Different tables may use different sampling subsets, but that's a guess. The qualitative structure survives either way. I wouldn't quote the totals or the per-turn magnitudes to precision. 48 00:11:59,055 --> 00:12:11,380 [Hal Turing] Now the compaction number. Sessions with a compaction are 7.8% of sessions but 44.2% of tokens. That sounds like compaction is expensive. 49 00:12:11,380 --> 00:12:34,430 [Dr. Ada Shannon] It isn't evidence of that. Compaction only fires once a session has filled roughly half or more of the context window. So those sessions are heavy by construction, and the 44% mostly says long sessions are long. To separate cause from selection you'd compare against length-matched sessions that never compacted. The paper doesn't do that. What it does measure is real: an extra summarization call, about a fifth of the turn's time at the median, and a near-total cache reset. 50 00:12:34,430 --> 00:12:40,930 [Hal Turing] And the cache drops themselves? Is 55% after a turn boundary all eviction? 51 00:12:40,930 --> 00:13:03,080 [Dr. Ada Shannon] The paper can't say, and that's a main weakness. It sees only client-side telemetry, and there are more than 27 models behind it. The 2-to-10-minute cliff reads like a timeout, but it's inferred, and the boundary drop could also bundle eviction with changes to the prompt prefix. Also, hit rate is a ratio of tokens, not latency or cost. The 8% left after a model switch is odd too, since another model's cache shouldn't be reusable, and the paper doesn't explain the residue. 52 00:13:03,080 --> 00:13:06,605 [Hal Turing] So the harness may own part of the problem. 53 00:13:06,605 --> 00:13:21,705 [Dr. Ada Shannon] Plausibly. Prompt layout and compaction design are client choices. A prefix-preserving compaction would append the summary rather than rewrite the history. The paper never estimates how much of the loss a cache-aware harness would avoid. 54 00:13:21,705 --> 00:13:26,580 [Hal Turing] What about the idle side? You said the predictor has a weak headline. 55 00:13:26,580 --> 00:13:53,980 [Dr. Ada Shannon] Captured idle time of 86 to 90% is hard to read. A policy that reclaims at every turn boundary would capture all of the idle time, and the number says nothing about sessions reclaimed that returned seconds later. The more honest metric is AUC, 0.73 against 0.58 for the previous-gap rule. That's modest. There's no per-user histogram baseline, the Shahrad-style approach, and no replay of GPU-memory-seconds saved or tail latency. So "enables proactive decisions" is untested. 56 00:13:53,980 --> 00:13:58,255 [Hal Turing] The idle numbers also disagree with each other, right? 57 00:13:58,255 --> 00:14:31,780 [Dr. Ada Shannon] Cross-turn medians are about 3 to 4 minutes in Table 8, but Section 9.3 quotes about 25 minutes, which is the user-idle median in Fig 32b. The paper doesn't reconcile the two, and an operator sizing a tier needs to know which distribution applies. There's a similar split on time: Takeaway 6 says LLM calls take 85.4% of wall clock, while Fig 12b shows a median of 13.7%, which counts user idle time differently. Again, unreconciled. 58 00:14:31,780 --> 00:14:35,830 [Hal Turing] And the 4x amplification from tool failures? 59 00:14:35,830 --> 00:14:53,856 [Dr. Ada Shannon] That's the deep-loop cluster, about 9% of turns, against the overall median. Failing turns are probably harder tasks, so it's a description of that cluster, not a counterfactual about what failures cost. And the whole study is one product over one week, with no quality or task-success signal. 60 00:14:53,856 --> 00:14:57,231 [Hal Turing] Given all that, what should practitioners do? 61 00:14:57,231 --> 00:15:20,006 [Dr. Ada Shannon] Pin sessions to a model, stage the cache before an unavoidable switch, make compaction incremental, and treat the turn boundary as a reclaim trigger with a survival-curve threshold. The survival curve could set the TTL in the CacheTTL work. That work used synthetic traces, so this is the first real-trace look at its assumptions. Be careful with archetype tiers, though. Nothing here tests them, and a casual user who returns a minute late would pay a full re-prefill. 62 00:15:20,006 --> 00:15:22,906 [Hal Turing] What would settle the open questions? 63 00:15:22,906 --> 00:15:42,931 [Dr. Ada Shannon] Server-side telemetry, a length-matched compaction study, a joint quality and cost analysis, and per-user histogram and always-evict baselines against the LightGBM model. The promised sanitized trace release should let others check the numbers. Quality matters in particular. Without a success signal, efficient and worse look identical. 64 00:15:42,931 --> 00:16:06,856 [Hal Turing] So the paper shows that agent traffic is session-structured, that cache loss concentrates at three predictable events, and that turn boundaries are a usable reclaim signal. The limits are a client-side view of one product over one week, headline totals that don't reconcile, and a predictor whose benefit over simple policies isn't shown. Thanks for listening, everyone.