Google DeepMind's gBench Is Great Until It Has to Judge an Answer
I spent the morning reading Google DeepMind's new open-source gBench harness against three practical AI evaluation books. Its chat-template twin checks, scaffold versioning, and open-loop stress tests are genuinely smart. Its five-model Gemini judge cascade is a real blind spot.
Every time a freshly quantised open model feels strangely dim on your own box, there is a decent chance the weights are innocent. Half the time your Jinja chat template dropped a stop token, or your serving layer quietly mangled tool-call formatting. Meanwhile, your throughput script happily reports 90 tokens a second while the model talks nonsense.
That split is the exact annoyance Google DeepMind built google-deepmind/gbench (v0.5.0.post1, Apache-2.0) to kill. Within hours of launching today it was near the top of r/LocalLLaMA, and for good reason: its design manifesto (docs/GOSPEL.md) makes a point anyone who has shipped self-hosted models recognises immediately. Raw speed scripts without capability checks are performance art, and static capability harnesses run offline never catch serving bugs.
I spent the morning reading through the repo and holding it up against the three books we have been using to audit our own evaluation methodology: Evals for AI Engineers (Shreya Shankar and Hamel Husain), Context Engineering with DSPy (Mike Taylor), and AI Evals in Practice (Caio Incau).
My short take: gbench is one of the smartest open-source model-and-serving release gates you can put in front of vLLM or Ollama today. It also has one glaring blind spot buried in its judge plumbing, and a hard edge where release certification stops and real application evaluation starts.
What gBench actually runs
Rather than loading weights directly into Python, gbench talks to any OpenAI-compatible /v1 endpoint (managing local vLLM for you, or pointing --remote-endpoint at an existing vLLM or Ollama server) and organises testing into four layers:
- Serving performance and open-loop stress sweeps (
docs/performance.md,--stress-test): Measures TTFT, ITL/TPOT, and sustainable QPS across six workload shapes (chat-like,agentic,prefill-heavy,decode-heavy,mixed,long-decode) using a merged Poisson arrival schedule. It checks P99 latency SLOs (1000 ms TTFT on chat and decode-heavy, 5000 ms on agentic and prefill-heavy, 100 ms ITL), enforces repeatability below a 5% coefficient of variation (--max-cv-percent), and salts prompts to bust prefix caches. - Tier 1 capability suites (
--evals): 86 canonical Python suites spanning reasoning, competition maths, coding, long context, tool use, and multimodal vision, plus a plugin directory (--eval-plugins-dir) and custom JSONL input (--eval-custom-jsonl). - Tier 2 Golden Set (
--golden-only): 16 fast deterministic checks ingbench/golden_dataset/designed to catch broken templates, tool calls, structured JSON, code execution, refusals, vision, and audio before you burn GPU hours on the big suites. - Tier 3 agentic quality (
--quality-only,docs/quality.md): Multi-turn GemmaClaw and OpenClaw scenarios (tool calls, memory recall, browser actions, MCP routing) running inside a--network none, read-only Docker container (docker/quality.Dockerfile) with a local Unix-socket relay so API keys never enter the sandbox.
Four engineering ideas worth stealing
Before getting into what breaks, credit where it is due. Four parts of gbench put the sharpest recommendations from the eval literature directly into code.
1. Chat Template Sensitivity Pairs
Four of the 16 Golden Set fixtures are paired diagnostics: template_multi_turn paired with template_multi_turn_twin, and template_tool_response paired with template_tool_response_twin. The first sends a real multi-turn or tool-response wire payload; its twin asks for the exact same answer inside a plain single user turn. At runtime, gbench also pulls the served model's own special chat-template tokens from --tokenizer and fails the run if a single control token leaks into the reply.
If the twin passes and the structured case fails, you stop arguing about whether the quant lobotomised the model and go fix your Jinja template. That is a genuinely clever diagnostic.
2. Two-sided checks and adversarial metric tests
In Context Engineering with DSPy (Chapters 3 and 5), Mike Taylor makes a simple rule: before trusting any metric, test it against a clearly good answer, a clearly bad answer, and a lazy shortcut. gbench actually does this in its Golden Set:
- Matchers like
contains_allandrefusalare two-sided, requiringexpected_outputsand enforcingexpected_not_containsso a refusal check cannot pass by printing a disclaimer followed by harmful code. code_canonicalextracts generated Python and runs real unit tests (python_exec), while broader sandboxed runs isolate execution with Bubblewrap (bwrap).structured_jsonenforcesjson_exactand rejects stray Markdown fences.tests/test_golden.pykeeps adversarial regression cases in unit tests so broken outputs are proven to fail on every PR.
3. Splitting what you test from how you test it
Both Evals for AI Engineers (Chapter 2) and AI Evals in Practice (Chapter 3) hammer the same point: mutate a prompt, decode setting, or scorer between runs and your trend line is fiction. docs/scaffold-versioning.md handles this cleaner than almost any open harness I have read. Every run splits 11 tracked fields into two identifiers:
subject_id(2 fields):model_checkpointandquantization.scaffold_id(9 fields):prompt_version,schema_version,scoring_version,tool_permissions,attempts,decode,dataset_snapshot,serving_environment, andload_shape.
In gbench/runners/golden.py, SCORING_VERSION = 4 is guarded by a code fingerprint check so harmless refactors do not invalidate historical hashes, while actual scoring changes force an explicit version bump. It also logs official_sampling whenever your decode flags diverge from upstream defaults, and tracks answer_in_thinking when a reasoning model buries its answer inside reasoning_content.
4. Refusing to turn scorer failures into 0%
In AI Evals in Practice (Chapter 2), Caio Incau points out that a 95% pass rate with 5% scorer errors is not 95%; it is an unknown number. When a judge call fails or returns malformed JSON in gbench, the item is marked JUDGE_FAILED (scoring_excluded: true), counted separately, and kept out of the denominator. In Tier 3, a broken run where nothing could be scored reports pass_rate: null (withheld) instead of a fake zero. More eval tools should copy that rule.
Where it slips: the Gemini judge cascade
Open gbench/runners/eval_suites/base.py around line 962 and the methodological picture changes quickly.
Several flagship Tier 1 suites (including humanitys_last_exam, mcp_bench, toolbench, gaia2, wildclawbench, wildbench, tau2, tau3, and gdpval) rely on LLM judges or simulated users. Upstream, those benchmarks were designed around a mix of GPT-4, Azure o4-mini, and Llama judges. gbench keeps the upstream prompts verbatim, then routes all of them through one five-model fallback tuple:
GEMINI_CASCADE = (
"gemini-3.8-flash",
"gemini-3.7-flash",
"gemini-3.6-flash",
"gemini-3.5-flash",
"gemini-3.1-pro-preview",
)
To DeepMind's credit, the repo does include one standalone judge sanity script, scripts/gdpval_validate_judge.py. It tests the gdpval pairwise judge on two synthetic checks: comparing a gold deliverable against itself in both positions (checking for position bias around 0.5) and comparing the full deliverable against its first 25% (checking that the judge prefers complete work near 1.0). That is a good smoke check.
Held against Evals for AI Engineers (Chapters 5 and 6) and Context Engineering with DSPy (Chapter 5), though, the broader cascade breaks four basic rules of measurement:
- No human-labeled calibration or bias correction. Passing a 25% truncation check on one suite does not tell you how often a swapped judge misses subtle real failures on HLE, WildBench, or MCP-Bench. Shankar and Husain treat every LLM judge as a noisy classifier: validate it on disjoint human-labeled splits, measure its True Positive Rate (TPR) and True Negative Rate (TNR) on held-out cases, and apply the Rogan-Gladen correction
(p_obs + TNR - 1) / (TPR + TNR - 1)with a bootstrap interval. Moving an upstream o4-mini or GPT-4 prompt ontogemini-3.8-flashchanges the judge's error rates with no measured agreement check. - Mid-run judge drift. A five-model fallback chain with retries and key rotation is great for keeping a long overnight job alive, and terrible for clean measurement. If quota limits kick in halfway through a suite and push the second half from
gemini-3.8-flashdown togemini-3.5-flashorgemini-3.1-pro-preview, one headline accuracy figure now blends verdicts from different judges.gbenchdoes log per-model counts underjudge_modelsfor auditing, which helps, yet the summary still merges them. - Same-family judging. Grading Gemma checkpoints with Gemini models walks straight into self-preference bias (Zheng et al., 2023, discussed in Evals for AI Engineers Chapter 5).
- Coupled simulators and judges. Per the docstring at
gbench/runners/eval_suites/base.py:954, the exact sameGEMINI_CASCADEdrives both multi-turn user/API simulators (tau2,tau3,acebench,toolbench) and the judges grading those runs, with no check that simulated user behaviour matches real users.
The easy fix if you run gbench yourself: set GBENCH_JUDGE_MODEL to a single pinned model so a run never silently mixes tiers, and pick a different model family when evaluating Gemma.
The bigger trap: mistaking a release gate for an app eval
Even if you pin the judge, gbench is built for model labs, hardware partners, and serving engineers. If an application team tries to use it to decide whether to switch their production prompt to a cheaper model, three gaps from the three books show up immediately.
1. Custom JSONL only handles reference-based exact matching. Pointing --eval-custom-jsonl (gbench/runners/eval_suites/custom_jsonl.py) at your own dataset requires a gold string on every row and gives you exactly four deterministic matchers: contains, exact, numeric (within 1e-4), and multiple_choice. Great for maths or closed-set classification; unworkable as soon as a task has many valid answers, like support replies, summaries, or product copy (Evals for AI Engineers Chapter 2). For anything subjective, you are back to writing your own Python plugin under --eval-plugins-dir.
2. Strong single-run stats, no comparison CLI. Inside a single run, gbench is careful: Wilson 95% intervals on several suites, Wald half-widths on HLE, pass@k and pass^k via --attempt-count, and CV <= 5% on serving runs. What it lacks is a decision layer. Unlike Google's C++ benchmark repo (compare.py), there is no gbench compare command, no paired McNemar or sign test, no non-inferiority bound for quant swaps (Evals for AI Engineers Chapter 5; DSPy Chapter 11), and nothing stopping someone running --eval-limit 20 from treating a 10-point noise swing as a win.
3. Frozen prompts, GPU speed without unit economics, and no production loop. Freezing prompt_version inside scaffold_id makes sense for fair lab leaderboards, yet Mike Taylor's core lesson in Context Engineering with DSPy (Chapters 2, 6, and 11) is that prompts carry "prompt debt" tuned to whichever model wrote them first. Before rejecting a cheaper open model for your app, you re-optimise the prompt for that candidate on a held-out split. Likewise, gbench reports GPU QPS rather than dollar cost per passing answer (which hurts when --eval-thinking opens up 65536-token reasoning budgets), and it stops completely at deployment: no open coding 50 to 100 real traces to find your actual failure modes, and no async sampling of live traffic for drift (Evals for AI Engineers Chapters 3, 9, and 10).
When to use gBench vs. app-level evals
| Question you need answered | Use gBench? | Right tool for the job |
|---|---|---|
| Did this FP8/GGUF quant or vLLM upgrade break tool calls or chat templates? | Yes (--golden-only) |
gBench Golden Set and Chat Template Sensitivity Pairs |
| How many concurrent users can this GPU hold under a 1000 ms P99 TTFT SLO? | Yes (--stress-test) |
gBench open-loop Poisson serving campaigns |
| How does our fine-tuned open checkpoint score on GPQA, BFCL, RULER, or SWE-bench? | Yes (--evals) |
gBench Tier 1 (pin one judge via GBENCH_JUDGE_MODEL) |
| What is actually failing on our live production prompt? | No | Open-code 50 to 100 real traces first (Evals for AI Engineers Ch 3) |
| Is a cheaper model statistically safe to swap in, and what is cost per passing answer? | No | Paired prompt tests with non-inferiority bounds and prompt adaptation |
| Is our LLM judge agreeing with humans, or inflating pass rates by 10 points? | No | Held-out human labels, TPR/TNR measurement, and Rogan-Gladen correction |
| Did this prompt PR regress edge cases or drift after launch? | No | CI PR gate with flipped-case reruns plus live traffic sampling |
The bottom line
If you self-host open-weight models on vLLM or Ollama, put gbench --golden-only and --stress-test into your release checklist tomorrow. The chat-template twin pairs and P99 SLO sweeps alone will catch real serving regressions that basic tok/s benchmarks miss. Just pin GBENCH_JUDGE_MODEL to a single cross-family model before trusting any judged Tier 1 score.
Keep the boundary clear, though. A green release harness tells you the model and serving stack are healthy in general; it cannot tell you whether your prompt holds up on your customers' actual inputs. For that half of the stack you still need your own test cases, deterministic checks first, a judge measured against human labels, and paired comparisons across models on cost per passing answer. That is the layer we build at Spring Prompt (and you can assemble a stripped-down version yourself with Promptfoo, Python, and a small human-labeled holdout set). The two layers fit together nicely, as long as you do not expect a serving harness to do the job of an app eval.
Quick answers
What is Google DeepMind's gBench?
gBench (google-deepmind/gbench, Apache-2.0) is an open-source benchmarking and release-readiness harness for Gemma and other open-weights models. It tests serving throughput and latency (including open-loop Poisson stress sweeps) alongside 86 capability suites, a 16-case deterministic Golden Set, and containerized agentic scenarios through a single OpenAI-compatible /v1 endpoint.
Is gBench good for testing vLLM and Ollama deployments?
Yes. Its 16-case Golden Set includes chat-template sensitivity pairs (multi-turn and tool-response payloads paired against plain single-turn twins) plus runtime tokenizer token-leak detection. Combined with open-loop P99 TTFT and ITL stress sweeps, it is one of the best open-source release gates for catching broken quantisations or serving templates.
What is the main flaw in gBench's LLM-as-a-judge setup?
For judged suites such as Humanity's Last Exam, WildBench, GAIA-2, ToolBench, and MCP-Bench, gBench swaps upstream judges onto a five-model Gemini fallback cascade (GEMINI_CASCADE in gbench/runners/eval_suites/base.py). There is no human-labeled calibration split, no TPR/TNR or Rogan-Gladen bias correction, same-family judging when evaluating Gemma, and potential mid-run judge switching when rate limits trigger fallback.
Can I use gBench to evaluate my own production app prompts?
Only for narrow reference-based tasks. Its --eval-custom-jsonl mode requires a gold answer on every row and only supports four deterministic matchers (contains, exact, numeric, and multiple_choice). It has no human open-coding flow, calibrated rubric judges, paired comparison CLI, dollar cost-per-passing-answer reporting, or live production drift monitoring.