◉GEMINI LABJP
●ARGON — gemini-4-argon is generally available as of 10/13, aimed at complex coding, agents, math and science●DEEP RES — deep-research-pro-preview-12-2025 shuts down 10/23, 6 days left. Move to deep-research-preview-04-2026●NANO — gemini-nano-banana-2.1 is GA (10/06). gemini-3.1-flash-image is deprecated with no shutdown date yet●MCP — One write-up cut an 85,000-token tool result to 310 tokens by wrapping it in an ADK FunctionTool●FLASH — gemini-3.7-flash and 3.5-flash now route automatically to newer Flash models (10/08)●NEW — Stop Re-Reading Every Crash Report: Gre…●ARGON — gemini-4-argon is generally available as of 10/13, aimed at complex coding, agents, math and science●DEEP RES — deep-research-pro-preview-12-2025 shuts down 10/23, 6 days left. Move to deep-research-preview-04-2026●NANO — gemini-nano-banana-2.1 is GA (10/06). gemini-3.1-flash-image is deprecated with no shutdown date yet●MCP — One write-up cut an 85,000-token tool result to 310 tokens by wrapping it in an ADK FunctionTool●FLASH — gemini-3.7-flash and 3.5-flash now route automatically to newer Flash models (10/08)●NEW — Stop Re-Reading Every Crash Report: Gre…
Articles/Dev Tools
⟐ Dev Tools/2026-09-02Intermediate

An agreement-rate gate approves the model swap, then your category shares move

Swapping the model behind an image classification batch can pass a golden-set agreement gate while category shares quietly shift. I measured the sample sizes each check really needs and rebuilt the gate as a paired comparison.

Gemini API249Image Classification5Batch Processing6Model Migration8Quality Monitoring3

✦ Premium Article

The week after I promoted a new classification model in my wallpaper app, the categories sitting near the top of the browse list had shifted a little.

No individual label was wrong. Looking at images one by one, every assignment was defensible. Yet the landscape shelf had thickened, and the small categories at the bottom had thinned out.

The promotion decision had been made with an agreement rate against a golden set — the share of images where the new model produced the same label as the old one. That check passed. It passed, and the shares moved anyway.

What follows is how I pinned down the reason with numbers, and how I rebuilt the gate so the shift shows up before promotion rather than after. The statistical figures come from a simulation I ran locally over a skewed 30-category distribution built to resemble the real one. The operational problem is from the classification batch I run for a wallpaper app I develop on my own. It ships on both the App Store and Google Play, and the browse ordering on each is assembled from the same classification output, so checking only one side proves nothing — an assumption that shapes everything below.

What a 92% agreement rate was hiding

I started by confirming that agreement and composition are genuinely different quantities.

Thirty categories, with a Zipf-like skew (19.8% for the top one, 11.1% second, 7.8% third, 32.7% for the bottom twenty combined). On top of that I imposed a specific confusion pattern: the new model returns the same label 92% of the time, and of the 8% that disagree, roughly 70% land in one of the top three categories. Errors are not scattered uniformly — they get absorbed by the dominant categories. Running 200,000 items gave this:

CategoryOld modelNew modelRelative change
1st19.78%21.18%+7.1%
2nd11.06%11.87%+7.3%
3rd7.80%8.40%+7.7%
4th6.13%5.71%-6.9%
Bottom 20 combined32.73%31.72%-3.1%

Effective agreement came out at 91.9%, with a total variation distance of 2.81%.

A gate that only reads agreement will wave this through if the threshold sits at 90%. Meanwhile the top categories have gained 7% and the bottom twenty have lost 3% between them. A few percent is exactly the range where browse ordering and the "new arrivals" shelf start to look different.

Agreement counts how many labels changed. Composition depends on where the changed ones went. Obvious once stated, but folding both into a single gate is how the distinction got lost.

Watching production output finds it far too late

The natural follow-up is to monitor the output distribution after promotion. This is where my expectation was furthest off.

Assume a chi-square goodness-of-fit test over the 30 shares (29 degrees of freedom, 5% significance, critical value 42.557). Against the sub-2% TVD drift above, the power came out like this:

Items used for the decisionPower
5009.5%
1,20019.2%
2,00039.8%
4,00079.2%

For a batch handling a few hundred images a day, accumulating 4,000 takes one to two weeks. Throughout that window power sits near 20%, which means most of the "nothing to report" readouts were reporting a shortage of data rather than an absence of drift.

I assumed narrowing to a single category would fix it, so I measured that too:

ItemsTop category (19.78%→21.18%)Third category (7.80%→8.40%)
1,80031.4%16.7%
3,00047.6%24.0%
6,00076.8%41.8%
15,000—76.3%

Better than the omnibus test, but the order of magnitude does not change. Watching a 7.8% category takes 15,000 items.

The reason lies in where the variance comes from. When you observe the production distribution, most of the wobble comes from which images arrived that day. The model's contribution is a thin layer on top of that, buried under input variation, and the only lever you have is piling up more items.

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦You will be able to confirm that category shares have not moved before you promote a new classification model, even when the agreement gate is green
✦You will be able to choose between watching production output and running a paired new-versus-old comparison, based on the sample size each one actually requires
✦You will understand why a 30-category goodness-of-fit test still reaches only 79% power at 4,000 items, and redesign your monitoring around test granularity
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Gemini Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

⟐ Dev Tools2026-09-10
Matching name variants in a print catalog: normalize first, then ask Gemini for candidates
When the same artist appears under three spellings, asking Gemini whether two names are the same person quietly merges different generations. Here is the two-layer alternative — deterministic normalization first, model-generated candidates second — with working code and a cost estimate.
⟐ Dev Tools2026-09-06
Icon-Only Buttons Can Stay Silent for Screen Readers, Even When Every Translation Is in Place
A fully translated app can still read as silence. Here is how I collect icon elements and labels from iOS and Android, settle everything mechanical locally, and send only the wording to Gemini — with the actual output from each stage.
⟐ Dev Tools2026-08-30
Why Shipped Clients Deserve a Refusal, Not a Silent Model Substitution
A model can retire, but the apps already on people's phones cannot. This is how I built a sunset ledger keyed on output contracts, and how I now back-date my own deadline from the version residue curve.