Gemini agent vs production: 40-question benchmark
Rettsdata AI · run 23 September 2026 · production = main @ 01b8224 · candidate = staging @ f0e07c1
What was compared
| Production (today) | Candidate (staging) | |
|---|---|---|
| Pipeline | Fixed: generate queries → search each (topK 50) → evaluate → Cohere rerank to 20 → answer | Agent loop: model calls search (topK 30, parallel) and expand as it sees fit, then answers |
| Model | GPT-4.1 on Azure | Gemini 3.7 Flash on Vertex AI, medium thinking, Priority PayGo |
| Prompt | Langfuse answer (production) | Langfuse answer-v2 (label gemini, v5) |
| Citations | [n] index into the 20 reranked chunks | <citation ids="…"/> with chunk ids, repaired by middleware |
Both systems ran their real code paths from the respective commits, headless (no database writes), same machine, same concurrency (3 at a time each, interleaved), same 40 questions.
Answer quality
Blind pairwise preference
Each judge saw both answers as A and B in a randomised order, with citations renumbered to the same [k] style so the format didn't reveal the system. The two judges picked the same winner on 90% of questions.
| Set | Candidate wins | Production wins | Ties |
|---|---|---|---|
| Gold (15 questions × 2 judges) | 29 | 1 | 0 |
| Real production questions (25 × 2 judges) | 47 | 3 | 0 |
Judge self-preference check: GPT-5.5 preferred the candidate 37 of 40 times and Gemini 3.1 Pro 39 of 40, so the Gemini judge was not meaningfully more favourable to the Gemini answers.
Accuracy on 15 gold questions
Settled questions with a fixed answer key (deadline, amount or age plus the governing provision). Score = share of key facts stated correctly (partial = half), averaged over both judges. ⚑ = number of judges that flagged at least one incorrect legal statement elsewhere in the answer.
| Question | Production | Candidate | Candidate preferred | Prod time | Cand. time |
|---|---|---|---|---|---|
| Hva er oppsigelsesfristen når en arbeidstaker er ansatt på prøvetid? | 63% ⚑2 | 100% | 2/2 | 11.1 s | 19.6 s |
| Hvor lang kan en prøvetid maksimalt være etter arbeidsmiljøloven? | 100% | 100% | 2/2 | 20.2 s | 17.1 s |
| Hva er den alminnelige foreldelsesfristen for fordringer i norsk rett? | 100% | 100% | 2/2 | 9.4 s | 14.3 s |
| Hva er den absolutte reklamasjonsfristen ved forbrukerkjøp? | 100% ⚑1 | 100% ⚑1 | 2/2 | 13.8 s | 16.1 s |
| Hvor stort depositum kan en utleier kreve ved leie av bolig? | 100% ⚑1 | 100% | 2/2 | 12.0 s | 15.4 s |
| Hva er oppsigelsesfristen for leie av bolig når ikke annet er avtalt? | 100% | 100% | 2/2 | 6.6 s | 17.3 s |
| Hva er minstekravet til aksjekapital i et aksjeselskap (AS)? | 100% | 100% | 2/2 | 11.2 s | 10.0 s |
| Hva er klagefristen for enkeltvedtak etter forvaltningsloven? | 100% | 100% | 2/2 | 12.6 s | 13.3 s |
| Hva er ankefristen for dommer i sivile saker etter tvisteloven? | 100% ⚑2 | 100% | 1/2 | 7.8 s | 17.8 s |
| Hvor mange feriedager har en arbeidstaker krav på etter ferieloven? | 100% ⚑1 | 100% ⚑1 | 2/2 | 7.8 s | 13.0 s |
| Hva er alminnelig arbeidstid etter arbeidsmiljøloven? | 100% ⚑2 | 100% | 2/2 | 10.7 s | 17.7 s |
| Hvor stor er pliktdelsarven til livsarvinger etter arveloven? | 100% | 100% | 2/2 | 10.7 s | 12.9 s |
| Hva er strafferammen for tyveri etter straffeloven? | 100% ⚑1 | 100% ⚑1 | 2/2 | 8.2 s | 15.5 s |
| Hva er den kriminelle lavalderen i Norge? | 100% | 100% | 2/2 | 9.5 s | 11.5 s |
| Når blir man myndig i Norge? | 63% ⚑2 | 100% ⚑1 | 2/2 | 8.1 s | 11.5 s |
Incorrect-statement rate (answers flagged by a judge): production 40%, candidate 13%. Production's flags were mostly wrong sub-sections (e.g. the wrong ledd of aml. § 15-3) and invented exceptions (e.g. a one-week appeal deadline in tvl. § 29-5); the candidate's were imprecise side remarks.
Grounding and hallucination
Each judge listed up to 15 material legal claims per answer and checked each against the text of the source it cites (not against its own knowledge). “Unsupported” means the cited source does not say it, which is the closest measurable proxy for hallucination. 854 claims graded for production, 879 for the candidate.
| Citation metric | Production | Candidate |
|---|---|---|
| Citations per answer | 5.2 | 7.9 |
| Citation ids that resolve to a retrieved source | 100.0% | 98.8% |
| Claims with no citation | 14.1% | 4.6% |
| Unsupported claims, GPT-5.5 judge | 11.9% | 7.6% |
| Unsupported claims, Gemini 3.1 Pro judge | 10.1% | 6.0% |
| Answers with no citations at all | 0 | 0 |
kapittel/15/paragraf/15-3, which repeat across laws, so the model glued the document id on. Those citations would not have resolved in the chat UI. Ids are now documentId/section (or documentId#hash for case law), and whole-document citations resolve to that document's first chunk. The candidate numbers above are from the run after the fix (commit f0e07c1, now on staging).Speed
Wall-clock from sending the question. “First text” is the first visible answer token. The candidate shows its search steps in the UI before that, production shows status text.
The candidate is slower mainly because it reads more: 66 retrieved chunks and 73k input tokens per answer vs 20 chunks and 20k, plus ~920 thinking tokens, and it writes longer answers (median 2545 vs 1721 characters).
Behaviour and cost
| Metric (mean per answer) | Production | Candidate |
|---|---|---|
| Search calls | 10.0 generated queries | 2.6 (parallel) |
| Expand calls | n/a | 0.0 |
| Chunks the model read | 20 | 66 |
| Input / output tokens (answer model) | 20,182 / 493 | 73,149 / 2214 |
| Est. model cost, standard pricing | $0.046 | $0.063 |
| Est. with Priority PayGo (as deployed) | n/a | $0.118 |
| Est. with priority after the 1 Jan 2027 price rise | n/a | $0.237 |
| Errors / truncated / empty answers | 0 / 0 / 0 | 0 / 0 / 0 |
Prices: GPT-4.1 $2 / $8 per 1M tokens plus ~$0.002 per Cohere rerank; Gemini 3.7 Flash $0.75 / $3.75 (introductory, doubling on 1 Jan 2027), Priority PayGo taken as +87.5% (Google quotes 75–100%). Production's cost covers only the answer call; its query-generation and evaluation calls were not counted, so production is somewhat understated.
Method and caveats
- Questions: 15 gold questions with a written answer key, and 25 real questions sampled from production traffic (not shown here because they are customer data). Standalone first messages only; no conversation history.
- Judges: GPT-5.5 (Azure) and Gemini 3.1 Pro (Vertex), temperature 0, results averaged. Using two vendors limits self-preference; the Gemini judge was not noticeably kinder to the Gemini system.
- Single run per question. Both systems are non-deterministic; with 40 questions small differences (e.g. ±5 points on a percentage) are within noise. The quality gap is far larger than that; the latency gap is consistent across the p50 and p90.
- The answer key was written for this benchmark and covers settled rules, so it measures basic correctness, not hard legal reasoning. The real-question comparison covers the harder end.
- Grounding is judged against cited chunk text only, truncated to 2,500 characters per source. A claim that is true but cited to the wrong chunk counts as unsupported.
- The expand tool was never called on these 40 questions, so it is not what drives the difference.