Skip to main content

baseline-increment

Does a detector's score add anything beyond cheap baselines?

Hallucination detectors, uncertainty scores, LLM-judge scores, guardrail classifiers and routers are usually reported as one pooled AUROC. That number often mostly reflects things available without the detector:

  • response length;
  • which task or dataset an item comes from;
  • question difficulty;
  • which model produced it.

baseline-increment takes per-item scores and labels and answers one question: does the score improve held-out prediction beyond those baselines, and by how much? It reports the gain in AUROC with a 95% interval whose coverage has been validated, and gives a PASS / INCONCLUSIVE / FAIL verdict against a minimum gain you declare (default 0). It is built to run as an acceptance test before a detector ships, by hand or in CI.

The gain is measured under the declared baselines and model families, at your sample size: it is predictive, not proof that the score holds information the baselines lack. A separate permutation test of that stronger claim is reported as experimental, because it is unreliable on common data structures (see what is documented as not working).

Install

pip install baseline-increment            # Python 3.10+
pip install "baseline-increment[parquet]" # adds Parquet input

If PyPI serves an older version than the newest release, install the tag instead: pip install "git+https://github.com/Lakshmi-Chakradhar-Vijayarao/baseline-increment@v0.13.0". The CHANGELOG says which version each feature needs.

Quickstart

From Inspect logs of one task, run on a few models:

baseline-increment from-inspect logs/ --list                       # what scorers and fields the logs hold
baseline-increment from-inspect logs/ --label-scorer match --score-scorer judge -o items.csv --lomo
baseline-increment items.csv --score score --label wrong --group group --rank-within model \
    --baselines lomo_share_wrong,model,log_input_words,log_output_words --report audit.html

How this run is set up:

  • The label and the detector: the label comes from one scorer (match), and the detector from another (judge).
  • The baselines: --lomo adds the error rate of the other models on the same item. The length columns come from the adapter.
  • The defaults are the validated preset (2 seeds, the DeLong interval, permutations with early stopping).
  • --report: writes a document that can be filed and signed off.

The decision is the verdict on the gain. PASS when the lower 95% bound exceeds --min-gain (default 0), FAIL when the upper bound is below it, INCONCLUSIVE otherwise. --fail-if-no-increment makes the command exit 1 unless the verdict is PASS, so a CI gate never rests on the experimental test.

What it answers

Question Command Guide
Does this score add information beyond the baselines? baseline-increment data.csv --score ... --label ... --baselines ... audit
Which cheap explanations (difficulty, length, task, model) can it survive? baseline-increment check ... check
Is v2 of the detector better than v1, and did it lose anything? baseline-increment compare --old v1 --new v2 ... compare
Same question for graded labels (severity 0–3) --outcome ordinal outcomes
Is the raw score a good probability? --calibration outcomes
Can I get it from my logs or platform export? from-inspect, from-lm-eval, --map for CSV / Parquet / JSON data
Can I file the result? --report audit.html or .md reports
Can CI enforce it? --fail-if-no-increment, compare --fail-on-regression, action.yml sample workflow

Why trust the verdict

The gain reproduces independent analyses. LettuceDetect and HHEM on RAGTruth and TofuEval, and P(True), log-probability and semantic entropy on TriviaQA across 8 models, were measured earlier by separate code. baseline-increment reproduces every increment within 0.006 AUROC. Grounding checks add +0.08 to +0.13 beyond difficulty; self-uncertainty signals add about +0.04. See docs/validation.md.

Its interval has validated coverage. The 95% interval for the gain (clustered DeLong on out-of-fold predictions) covered the mean estimate in 0.905–0.965 of runs across six pre-registered scenarios, with and without real signal (target 0.85–0.99).

On human-labelled LLM-judge data, cheap baselines are a hard bar. On SummEval, FaithBench and TREC LLMJudge (33 judges), the baselines alone nearly matched or beat raw judge agreement: 0.69 vs the best judge's 0.72 on TREC, 0.78 vs 0.49–0.60 on FaithBench. See docs/judges.md.

Every rule is checked against acceptance criteria written down before the run. The record is CALIBRATION.md, the frozen plans are in docs/prereg/, and every public claim has a test (docs/CLAIMS.md).

What Evidence Result
Interval for the gain (primary verdict) 6 pre-registered scenarios, 200 runs each coverage 0.905–0.965
Power planted signal 0.81 weak, 1.00 moderate and strong
Agreement with independent analyses 7 detectors, 3 benchmarks every increment within 0.006
Omitted-baseline sensitivity (--sensitivity) 24 simulated designs with a real omitted variable no false comfort in 98.0% (each family ≥ 93.8%)
--calibration intervals simulated calibrated scores coverage 0.955 and 0.945

What is documented as not working:

  • The conditional-information test (adds_information, secondary, experimental). It permutes the score's residual given the baselines. It is reported, but it drives no verdict and no gate.
    • When it holds: on simple structures its false-flag rate is 0.05–0.10 (nominal 0.05).

    • When it fails:

      • when a baseline's effect differs by category: 26–58% false flags in simulation, and 33% on real TREC data;
      • when the score is an XOR-like function of the baselines: 75%;
      • when the score is a three-way interaction of the baselines: 100%.

      Stratifying the permutation by the category did not fix the TREC case (29%).

    • Why it cannot be fixed in general: no test can certify "information beyond the baselines" in general (Shah & Peters 2020). See the diagnostic.

  • A gain can be a model-class gain. If a score encodes a function of the baselines that the baseline models cannot learn at your sample size, the gain is real for prediction but is not new information. In simulation a three-way interaction gave +0.115 at 600 items and +0.053 at 3,000. Add such functions as baseline columns when they are plausible, and read the baseline ladder (--ladder).
  • Graded (ordinal) labels have no validated interval yet. Their gain is descriptive, and the CI gate refuses them.
  • The rescaling caveat in compare: when v2 is v1 rescaled per task, the regression check can flag falsely.

The statistics themselves are not new: incremental AUROC under grouped cross-validation, a DeLong-type interval, and a conditional randomisation test (Watson & Wright 2021; Candès et al. 2018). See related work. What the package adds is pre-specified baselines, validated defaults, a documented failure map, and output built for release decisions.

Documentation

Repository layout

baseline_increment/     the package: core (binary engine), compare, ordinal, calibration, checks, validity,
                        adapters (Inspect, lm-eval), tables (CSV/Parquet/JSON + --map), report, cli, data/
tests/                  unit tests; test_golden.py freezes the binary engine's output
simulations/            calibration suites (suite, compare_suite, ordinal_suite, calibration_coverage, ...)
simulations/results/    every calibration output (.json) and log, cited by CALIBRATION.md and the reports
scripts/                build the shipped tables and data/calibration_summary.json
examples/               worked examples and the sample GitHub workflow
validation/             real-data validation: per-item tables (no text), runner, results
docs/                   guides, pre-registrations, examples, related work
action.yml              composite GitHub Action (the gate)

Licence

Apache-2.0. The shipped difficulty tables hold only question hashes and summary statistics; their sources' licences apply (see check, "Read before using a benchmark table").

Metadata

Release files for baseline-increment 0.13.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for baseline-increment 0.13.0
File Size Uploaded Provenance Actions
baseline_increment-0.13.0.tar.gz 476.8 kB Without provenance Details for baseline_increment-0.13.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for baseline-increment 0.13.0
File Interpreter ABI Platform Actions
baseline_increment-0.13.0-py3-none-any.whl Python 3 none any Details for baseline_increment-0.13.0-py3-none-any.whl

Total release size: 945.9 kB

Release files / baseline_increment-0.13.0.tar.gz

Download URL baseline_increment-0.13.0.tar.gz
Size 476.8 kB
Tags Source
SHA-256 checksum
How to use checksums
425677c1985e292d7290ed778e3fa53eeb5b47a6340ab941df76b1acf350926d
BLAKE2b-256 checksum
How to use checksums
c70b13ae385f95248bf168955ae00561e79cfb9ac6f577e3fb1e4d9189efe520
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / baseline_increment-0.13.0-py3-none-any.whl

Download URL baseline_increment-0.13.0-py3-none-any.whl
Size 469.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a328f7ba582b2925e3c108ebb3c9bd80b182da44e48ed6d05fe7d132f0b96b20
BLAKE2b-256 checksum
How to use checksums
d3566564c7fa2cfe175aa825bd161de1d21c93562dee0a27e8790efc50935be5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Security for baseline-increment 0.13.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page