Skip to content

About

Open LLM evaluation harness (UK AISI Inspect) measuring faithfulness, coverage, misstatements, blinded human-judge agreement (Cohen's kappa), and checking cost.

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

evidence-synthesis-eval

CI Python 3.11 | 3.12 Licence: Apache-2.0

An open-source evaluation harness, built on Inspect, that checks whether AI-written evidence syntheses say what their sources say, cover what matters, avoid misstatements, and how much human checking they need.

Usage is not quality. This measures quality.

The problem

Evidence synthesis means summarising a set of studies or reports to answer a policy or science question. Language models are good at producing fluent syntheses quickly, and that is exactly the risk. The errors that matter are hard to see in fluent prose: a null result left out, a subgroup effect presented as general, a retracted figure repeated, a relative change reported as percentage points, a citation that points to nothing.

Most adoption metrics count usage: how many people used the tool, how many documents it produced. None of that says whether the output was right. The time a person spends checking and fixing the output is rarely measured at all, yet it decides whether the tool saves anything.

What this does

It answers four questions about each synthesis, and compares conditions (for example a single model pass against a draft, critique and revise loop):

Question What is measured How
Faithfulness: does each claim say what its cited source says? Share of cited claims that are supported, partly supported, unsupported or contradicted A judge model sees one sentence and the text of the sources it cites, nothing else, and applies a written rubric
Coverage: which key findings were omitted? Importance-weighted recall of key findings written by a human expert; critical findings missed A judge model checks each key finding against the synthesis
Misstatement: does anything contradict the sources, or invent a citation? Contradicted claims, citations to sources that do not exist, contradicted key findings, known pitfalls triggered Plain code for citations; judge models for the rest
Cost: how much checking and correction did the output need? Generation tokens, plus human minutes checking and correcting and material errors found Inspect's usage records, plus a small effort log that reviewers fill in as they work

What is in the box:

  • Two Inspect tasks, single_pass and critique_revise, runnable by name with any Inspect model provider.
  • A JSONL dataset format with a JSON Schema and a validator.
  • A bundled synthetic dataset of 8 questions about fictional studies (see docs/DATASET.md).
  • Four scorers: citation_integrity (deterministic), and claim_support, coverage and pitfalls (model-graded, with rubrics stored as versioned files).
  • The ese command line for the human side: blinded review packs, effort logging, reviewer agreement (Cohen's kappa with item-clustered bootstrap intervals) and a comparison report with paired bootstrap intervals.

Evaluation scope (synthesis layer, not retrieval). In a retrieval-augmented generation (RAG) or evidence-review pipeline, this harness evaluates the generation, citation grounding, coverage, and human verification layer over supplied or retrieved source documents. It does not perform PDF/table parsing, chunking, embedding, or vector/hybrid retrieval itself.

Quickstart

Requires Python 3.11 or later. Everything in this section runs offline, with no API key.

git clone https://github.com/dsugurtuna/evidence-synthesis-eval.git
cd evidence-synthesis-eval
python -m venv .venv && source .venv/bin/activate
pip install -e .

ese validate      # check the bundled dataset against the schema
ese demo          # run both conditions with a scripted mock model, then write a report

ese demo runs both Inspect tasks on all 8 questions using Inspect's mockllm/model with a scripted responder, writes illustrative effort records, and builds the report. It prints something like:

Demo complete (scripted mock model; the numbers only show the report format).
  log:    ese-demo/logs/<timestamp>_single-pass_<id>.eval
  log:    ese-demo/logs/<timestamp>_critique-revise_<id>.eval
  effort: ese-demo/effort_ILLUSTRATIVE.jsonl (illustrative, not measurements)
  report: ese-demo/report.md
  report: ese-demo/report.html
View transcripts with: inspect view --log-dir ese-demo/logs

Open ese-demo/report.html in a browser, or run inspect view --log-dir ese-demo/logs to read every prompt, response and score in Inspect's log viewer.

Run it with real models

Install the provider package(s), set the API keys, and run each condition. The writer is the model under evaluation (--model); the critic and grader are separate model roles. Using a grader from a different model family than the writer avoids correlated blind spots.

pip install -e ".[anthropic,openai]"
export ANTHROPIC_API_KEY=...        # writer/critic key
export OPENAI_API_KEY=...           # cross-family grader key

inspect eval evidence_synthesis_eval/single_pass \
  --model anthropic/<writer-model> \
  --model-role grader=openai/<grader-model> \
  --log-dir logs

inspect eval evidence_synthesis_eval/critique_revise \
  --model anthropic/<writer-model> \
  --model-role critic=anthropic/<critic-model> \
  --model-role grader=openai/<grader-model> \
  --log-dir logs

ese report logs --out report.html

Notes:

  • Any Inspect provider string works for any role. The report warns when the grader is the writer, shares its provider, or when conditions mix datasets (dataset_sha256), writer/critic/reviser prompts, rubric versions, or graders.
  • If you do not bind critic, Inspect uses the writer, which makes critique_revise a self-critique. If you do not bind grader, the writer grades itself; the report flags this.
  • Useful Inspect options: --limit 2 for a cheap first run, --sample-id ESE-003, --epochs 3 to capture run-to-run variation (the report averages epochs per question before computing intervals, and refuses to treat partially unjudged outputs as misstatement-free), -T judges=false to run only the deterministic citation checks, and -T dataset=path/to/your.jsonl for your own data.
  • Plain --model mockllm/model also works from the Inspect command line, but it returns placeholder text, and mockllm then counts tokens with tiktoken, which downloads an encoding file on first use. ese demo sets token usage itself, so it stays offline.

Run the human check

The human workflow separates roles in the spirit of the UK government AQuA Book and Magenta Book: the Analyst generates the blinded review pack and holds private/key.json, independent Reviewers label claims and log checking minutes blind to condition, and an independent Assurer checks agreement and reproduces ese report from the logs.

ese review-pack logs --out review-pack          # blinded items + claim label template
# Each reviewer labels claims in a copy of claims_template.csv, and after each item:
ese effort log --item R-7KQ2PX --reviewer R1 --checking 12 --correcting 4 \
  --material-errors 1 --file effort_R1.jsonl
ese agreement reviewer_R1.csv reviewer_R2.csv --names R1,R2                      # reviewers
ese agreement reviewer_R1.csv review-pack/private/judge_labels.csv --names R1,judge  # judge vs human
ese report logs --effort effort_R1.jsonl --effort effort_R2.jsonl \
  --key review-pack/private/key.json --out report.html

By default, ese agreement validates labels against supported, partial, unsupported, contradicted so spreadsheet typos do not silently create new categories (pass --allowed-labels to customise or --allowed-labels any for arbitrary labels). The full protocol is in docs/METHOD.md.

Output format (scripted mock demo preview)

No real-model runs or measured judge-human agreement ($\kappa$) baselines are published in this repository. Every number in the table below comes solely from running ese demo offline on the 8 synthetic questions with mockllm/model and illustrative effort records, to preview the report structure, bootstrap interval formatting, and warning behaviour.

In particular, critique_revise (B) wins the citation checks by construction, because the demo writer injects two faults and the demo reviser deletes those exact faults, while the effort minutes are synthetic draws from a single distribution for both conditions.

Dimension Metric A (single_pass, mock) B (critique_revise, mock)
Faithfulness Cited claims fully supported 82% [81%, 83%] 100% [100%, 100%]
Faithfulness Claim sentences with a citation 85% [84%, 85%] 100% [100%, 100%]
Coverage Key findings conveyed (weighted) 50% [35%, 67%] 50% [35%, 67%]
Misstatement Outputs with at least one misstatement 100% [100%, 100%] 0% [0%, 0%]
Cost Generation tokens (writer + critic), per output 601 [570, 638] 2,120 [2,018, 2,236]
Cost Human minutes (check + correct), per output 19.19 [16.75, 21.88] 17.94 [15.31, 20.56]

The full scripted output, including warnings (such as Unclear pitfall checks when the demo pitfall judge answers "unclear"), paired differences and per-question tables, is in docs/example-report.md. Reproduce it locally with ese demo.

How it works

flowchart LR
    D[("JSONL dataset<br/>question, sources,<br/>key findings, pitfalls")]
    subgraph conditions["Conditions (Inspect solvers)"]
        A["single_pass<br/>writer"]
        B["critique_revise<br/>writer, critic, writer"]
    end
    D --> A
    D --> B
    A --> O["Synthesis with<br/>inline citations"]
    B --> O
    O --> S1["citation_integrity<br/>plain code"]
    O --> S2["claim_support<br/>judge vs cited text only"]
    O --> S3["coverage<br/>judge vs key findings"]
    O --> S4["pitfalls<br/>judge vs known errors"]
    S1 --> L[("Inspect logs")]
    S2 --> L
    S3 --> L
    S4 --> L
    L --> P["ese review-pack<br/>blinded items"]
    P --> H["Two reviewers<br/>labels and effort log"]
    H --> K["ese agreement<br/>kappa"]
    L --> R["ese report"]
    H --> R
Loading
  1. Dataset. Each item has a question, sources with ids (S1, S2...), key findings written by a person who knows the material (with importance 1 to 3 and the sources that support them), and optional known pitfalls.
  2. Conditions. Both conditions use the same writer prompt. critique_revise adds a critic call and a revision turn. Each step's model and token usage is recorded in the sample's store.
  3. Scoring. The synthesis is split into sentences in plain code. Citations are checked in code. Each cited sentence is judged against the cited source text only. Each key finding and each known pitfall is judged against the synthesis. Every model-graded score records the rubric version and hash, and the grader model.
  4. Human check. A blinded review pack hides which condition produced which output. Reviewers label claims with the same rubric as the judge, and log their minutes and material errors as they go.
  5. Report. Per-question results, means with bootstrap intervals, paired differences against a baseline, and warnings about anything that weakens the comparison.

Design decisions

  • Built on Inspect. Inspect, from the UK AI Security Institute, gives logs, a transcript viewer, model roles and many model providers. Results are reproducible and every prompt and response can be read, which matters more for trust than any summary number.
  • Synthetic, fictional sources. No licensing risk, and no model can have seen the studies in training, so a model cannot "remember" the answer instead of reading the sources. It also lets the dataset plant specific traps. The cost is realism: real literature is longer and messier. See docs/DATASET.md.
  • Claims are split in code, not by a model. The unit of judgement must be identical across conditions and judges; otherwise differences could come from the splitter. Sentences are crude but stable and testable.
  • The claim judge sees only the cited text. This tests traceability: a claim that is true in the world but not in the cited source is unsupported, which is the standard an analyst is held to.
  • Coverage is weighted by importance. Omitting a critical null result should count for more than omitting a cost figure. Weights are set by the person who writes the key findings, not by the model.
  • The critic is a critic, not a verifier. Its comments are advice to the writer. They are logged but never used as evidence of quality, because agreement between two models is not verification.
  • Rubrics are versioned files. A rubric is part of the measuring instrument. If it changes, scores are not comparable, so each model-graded score records the rubric version and a hash, and the report warns when conditions used different versions.
  • Failures are counted, not guessed. An unparseable judge verdict is a judge failure; an undefined rate is NaN, not zero. Inspect excludes NaN from metrics and counts it as unscored.
  • Human effort is logged in the moment. Effort reconstructed at the end of the week is unreliable, so ese effort log stamps the time and has no backdating option.
  • The report is cautious by default. It always says it is a local operational evaluation, not a causal study, and it pairs conditions by question.

More reasoning, and the hardest questions to ask of this design, are in docs/WHY.md.

Limitations and what this is not

  • Not a benchmark or leaderboard. Eight synthetic questions are enough to exercise the harness and to show method, not to rank models.
  • LLM judges make mistakes. Measure judge-human agreement on your own material (ese review-pack, then ese agreement) before relying on judge scores.
  • Sentence-level claims are crude. A sentence with two claims is judged as a whole; the rubric's "partial" label absorbs some of this.
  • Faithfulness is to the sources, not the world. If the sources are wrong, a faithful synthesis is wrong too.
  • Synthetic sources are cleaner than real ones. Real reports have tables, PDFs and hundreds of pages. This harness evaluates the synthesis generation and citation-grounding layer given supplied source text; it does not yet handle retrieval, chunking, or long-document parsing.
  • Effort timings are local. They describe these reviewers on these outputs, and are affected by familiarity and by being timed. See the threats to validity in docs/METHOD.md.
  • Unofficial. This is not government guidance and does not represent any organisation's policy.

Development and verification

Install dev dependencies and run all checks locally (the test suite blocks outbound sockets in tests/conftest.py so every check runs offline):

pip install -e ".[dev]"
ruff check . && ruff format --check .
mypy
pytest
ese validate
ese demo --out ese-demo

The package includes a PEP 561 py.typed marker for strict type-checking consumers. See CONTRIBUTING.md for versioning and contribution rules.

Roadmap

  • Optional model-based splitting into atomic claims, compared against sentence splitting.
  • Judge panels (Inspect can bind a list of models to a role) with panel agreement in the report.
  • A second dataset built from openly licensed real documents, with provenance and licence per source.
  • More conditions, for example structured extraction before writing, and retrieval over long documents.
  • Scoring the draft as well as the final output, to show what revision changed.
  • A review-pack option that allocates each reviewer only one output per question, to remove familiarity effects from effort timings.

Related projects

Licence

Apache-2.0. See LICENSE. The bundled dataset is synthetic, written for this repository, and released under the same licence.


Personal project by Ugur Tuna. Not affiliated with or endorsed by any employer.

About

Open LLM evaluation harness (UK AISI Inspect) measuring faithfulness, coverage, misstatements, blinded human-judge agreement (Cohen's kappa), and checking cost.

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages