AIToday
Large Language ModelsAI Coding AssistantsZenn AI/MLPublished: Nov 6, 2026, 06:00 JST

Milestone checkpointing cuts agent input tokens 91.9% on gemini-3.8-flash

Send on LINE
Milestone checkpointing cuts agent input tokens 91.9% on gemini-3.8-flash

3 Key Points

  1. What happened

    In a three-milestone coding task run on gemini-3.8-flash, the accumulating-history agent's Turn 3 input hit 17,544 tokens and it failed 2 of 20 tests; the checkpointing agent used 2,922 tokens total and passed 20/20.

  2. Why it matters

    The failures traced to a dropped normalization rule (contract_tier .strip().upper()) buried under past logs, suggesting long chat histories degrade late-turn accuracy, not just cost.

Not sure about something? Ask the AI

Questions and answers are published on this page.

Summaries like this, every morning.

By signing up you agree to the Terms of Service and Privacy Policy.

Context & Analysis

The test isolates a failure mode that shows up specifically in long, multi-step agent work. In the accumulating-history mode, the agent implemented station_id and grid_zone normalization correctly in Turn 1, but by Turn 2 the earlier output plus a 45-line telemetry audit dump had pushed input to 11,769 tokens. The clearing.py spec sitting mid-prompt then got lost, and the generated code omitted the .strip().upper() call entirely — a single missing line that broke two end-to-end cases.

The compaction mode sidesteps this by discarding raw logs at each verification gate and carrying forward only a roughly 120-token SAVE_GAME_COMPACTION_V1 JSON listing completed modules, verified interface contracts, and the next target. Turn 3 input fell to 884 tokens, a 95.0% reduction versus the accumulating run, and the agent implemented the remaining requirements in one pass. Notably, output tokens barely moved, so the gain is on the input side rather than from a chattier or quieter model.

The numbers also point to a compounding cost problem: because past dumps are re-billed every turn, the accumulating mode's per-turn input climbed from 6,556 to 17,544 tokens, while elapsed time and model-call counts stayed essentially equal. AI Labo frames the takeaway as a guideline rather than a product claim — compact at milestone boundaries and keep only verified contracts and the next target in context.

FAQ
How much cheaper was the checkpointing approach?
Estimated API cost was $0.00946 for the milestone-compaction mode versus $0.03401 for full-history accumulation, a 72.2% reduction.
Why did the full-history agent fail two tests?
Its clearing.py dropped a required .strip().upper() normalization on contract_tier, so end-to-end cases using " green " and "hydro" raised ValueError.
Did output quality or speed change?
Output tokens were nearly identical (1,937 vs 1,894), and the compaction run finished in 22.52 seconds versus 24.81 seconds.
Send on LINE

AI news that matters for your work, delivered every morning.

Pick your industry and the AI tools you use, and get news related to your work every day.

By signing up you agree to the Terms of Service and Privacy Policy.

Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →

Ask AI

Ask AI anything about this article. The AI reads this article, earlier AIToday articles, and Wikipedia, and cites its sources. Q&As are published on this page for other readers too.

Questions and answers are published on this page.

Related Articles

Next articleMeta's Muse AI agent adds real-time voice and animated avatars