Repository navigation
Compression or a held-state loop for sessions that edit a state step by step? Gemini 3.8 Flash numbers, checked against Google's bill #30483
Replies: 1 comment
|
A follow-up with outside numbers on why I asked question 1. HKUST's study of agentic workloads (arXiv 2608.15127) notes that every call re-sends the full history, that one Claude Code session on a large model can hold up to 11 GB of KV cache, and that in 5 of 10 applications the tools, not the model, dominate or share the latency. For sessions whose work is an exact state, TRAVERSE (Google Research, Google DeepMind, UCLA, NYU; arXiv 2609.17930) finds that after an agent's first mistake it never notices it in 38.5% of runs. That is an argument for a deterministic check at the point where an edit is applied, instead of relying on the conversation to carry the correction. Anthropic's context engineering post describes pinning what must survive in notes outside the context window, which is what GEMINI.md or a file does in Gemini CLI. Question 2 is whether a hook could go one step further and build each call from that state. On the Gemini side of our own tests: a 1,500-step job on Gemini 3.8 Flash ran at 2,824 prompt tokens a step with the held state, against 476,835 a turn on average for the kept chat (169 times fewer), and the median first token was 2.27 s against 9.13 s once the chat's prompt passed 500,000 tokens (test page). The held state was exactly right on 4,000 of 4,000 steps in the longer run, where the raw replies applied as written were wrong on 46 of 4,000 (test page). All of it, with what each paper and test shows: THIRD_PARTY_EVIDENCE.md. Write-up: The best agent finishes 20.6% of long workflows. AXI is a host-side layer; the architecture is Rajnish Choubey's, and I run the tests with an AI assistant as a tool. I'm not affiliated with Google. |
Uh oh!
There was an error while loading. Please reload this page.
Gemini CLI keeps a long session workable by compressing the conversation when it grows. A question about one kind of job: a session that edits a structured state (a schedule, an inventory, a config) one change per step, where later steps need exact values from earlier ones.
For that shape we tried not keeping the conversation at all. The host holds the state as data, the model proposes one change per step in a small strict format, a deterministic check admits or refuses it, and each prompt is rebuilt from the held state. This was Gemini 3.8 Flash through the API, not through Gemini CLI, priced at Google's own rates. On one 400-step job, per verified step: $0.0014 with the held state, $0.0148 with the whole chat kept and the cache warm, $0.0870 with the cache cold. The rates and one day's total match Google's billing report ($29.45 billed against $29.09 logged). On a 1,500-step job the held state stayed exact on 1,500 of 1,500 steps at about 2,824 prompt tokens a step.
Question 1: when a session's work is an exact state (ids, amounts, paths), does compression keep those values over hundreds of steps, or do you pin them outside the conversation (GEMINI.md, a file)?
Question 2: is there a supported way for an extension or a hook to build each model call from a state object instead of the conversation?
The report lines, the arithmetic and a test that recomputes every figure: https://github.com/gaurshalendra2412/axi-runtime/blob/main/docs/BILLING_CHECK.md
AXI is a host-side layer; the architecture is Rajnish Choubey's, and I run the tests with an AI assistant as a tool. I'm not affiliated with Google.
All reactions