Eval harness · legal RAG
Does the cited opinion support the claim?
Strict citation prompting lifted citation precision from 0.981 to 0.994 on 25 questions; recall stayed at 0.760 because retrieval, not the model, was the limit. CrossSource is the open harness behind that number: when a legal RAG system cites a court opinion, does the opinion support the claim?
0.981 → 0.994
citation precision
v0.1 · n = 25
0.760
citation recall, both prompts
capped by retrieval
15 / 15
judge vs hand-grade
blind, stratified
§1 · Why
Invented citations get lawyers sanctioned.
In Mata v. Avianca, lawyers were sanctioned for filing a brief full of citations an AI invented. Citation hallucination is the failure legal and tax AI most has to stop before a practitioner relies on an answer. It is the same failure I work on in production. CrossSource is the public, reproducible version of that work: a dataset where every item traces to an exact passage in a public opinion, a written labelling protocol, and an evaluation pipeline anyone can run.
§2 · Method
Five stages, question to verdict.
v0.1 pipeline: two configurations, baseline (citation formatting only) and strict (explicit citation-discipline rules).
- 01
Golden set
25 human-authored questions · verified ground-truth chunks
- 02
Corpus
22 public-domain US opinions · 16 Supreme Court, 2 federal circuit, 4 state · ~350-word chunks
- 03
Retrieve
BM25 · top-5
- 04
Generate
Claude · mandatory inline doc_id:chunk_id cites
- 05
Judge
claim-level precision, recall, faithfulness, relevance · LLM judge, validated by hand
- v0.3 dataset
- 150 items: 75
qa_citation, 75 citation_check: over 45 public US opinions from CourtListener (27 federal circuit, 18 state supreme court, 2018 or later), across 15 legal topics. - Provenance
- Every item carries its opinion ID, URL, the exact passage and the cited authority.
- Labelling
- A written protocol,
LABELING_PROTOCOL.mdv1.1. Items are model-drafted and model-checked; no human labelled every item. - Agreement
- Two blind, independent model raters: Cohen's kappa 0.98 on citation_check, 0.84 on qa_citation.
- Adjudication
- Every disagreement plus a 10% audit sample, 30 items in all, adjudicated by me with a third independent model rater. 27 of 30 matched the recommended label.
- v0.1 corpus
- 22 public-domain US court opinions (16 Supreme Court, 2 federal circuit, 4 state), sourced from Harvard Law School's Caselaw Access Project, chunked to ~350 words.
- v0.1 retrieval
- BM25, top-5.
- v0.1 generation
- Claude with mandatory inline citations in
doc_id:chunk_idformat. - v0.1 golden set
- 25 human-authored questions with verified ground-truth supporting chunks.
- v0.1 configurations
- baseline (citation formatting only) vs strict (explicit citation-discipline rules in the prompt).
- v0.1 scoring
- claim-level citation precision and recall, faithfulness, and answer relevance: scored by an LLM judge, validated by hand (below).
§3 · Findings
Prompting bought precision, not recall.
Flip the prompt. Precision and wrong-passage failures move. Recall and missing authority do not: they belong to retrieval.
Fig. 1Which layer owns the failure
Citation precision
0.994
axis starts at 0.970
Failures · one square each
7 failures · strict
wrong passage · promptmissing authority · retrievalabsent under strict
0.760
citation recall
unchanged · retrieval cap
1.000
faithfulness
both prompts
0.960
answer relevance
baseline 0.980
3 → 1
wrong-passage cites
baseline → strict
| Dimension | Baseline | Strict |
|---|---|---|
| Citation precision | 0.981 | 0.994 |
| Citation recall | 0.760 | 0.760 |
| Faithfulness | 1.000 | 1.000 |
| Answer relevance | 0.980 | 0.960 |
| Error type | Baseline | Strict |
|---|---|---|
| Right document, wrong passage | 3 | 1 |
| Missing authority | 6 | 6 |
| Wrong document | 0 | 0 |
| Unsupported claim | 0 | 0 |
| Model | Citation precision | Citation recall | citation_check accuracy |
|---|---|---|---|
| claude-sonnet-5-5 | 0.919 | 0.718 | 1.00 |
| gpt-5-mini | 0.763 | 0.718 | 0.93 |
Citation-discipline prompting buys precision: wrong-passage citations drop 3 → 1, precision rises 0.981 → 0.994. It cannot buy recall: 0.760 in both configurations, capped by retrieval, because every missing-authority failure traces to retrieval, not generation. Knowing which layer owns the failure is the entire point of separating the metrics.
§4 · The judge
Checking the judge exposed a bug.
In v0.1, I hand-graded a blind, stratified sample of the judge's citation-precision verdicts: 100% agreement (15/15). That validation pass also surfaced a genuine harness defect: consecutive citations produced punctuation-only claim spans that the judge initially mislabeled as failures. Fixing it changed the metrics.
Fig. 2One answer through the harness
5 steps · click through
The model answers a legal question and cites its sources inline.
The spans drawn are placeholders, not real answer text.
v0.1 validation pass: stratified blind sample, hand-graded.
That is the lesson worth paying for: an unvalidated eval reports wrong numbers with full confidence, precisely the failure mode the eval exists to catch.
§5 · Limits
What the numbers cannot carry.
- 01
n = 25. The v0.1 finding rests on 25 questions over 22 opinions.
- 02
Table 1 is a sanity run on a 30-item v0.3 sample, not a full run.
- 03
No human labelled every item. v0.3 items are model-drafted and model-checked.
- 04
Adjudication covers 30 items: every disagreement plus a 10% audit. 27 of 30 matched.
§6 · For any agent step
The same discipline, anywhere.
The same discipline I use on production systems and on anything I build:
- 01
Instrument the pipeline
- 02
Keep provenance for every item, so any score traces back to a passage
- 03
Build a failure taxonomy instead of a single score
- 04
Check the judge against people before trusting it
- 05
Separate precision from recall, so you know whether to fix the prompt or the retrieval
§7 · Code and data
Read the code, run the harness
Released 20 Oct 2026