amazon-science/ndcb
Python
Captured source
source ↗amazon-science/ndcb
Language: Python
License: NOASSERTION
Stars: 0
Forks: 0
Open issues: 0
Created: 2026-11-19T18:12:09Z
Pushed: 2026-11-19T23:03:37Z
Default branch: main
Fork: no
Archived: no
README:
NDCB — Normative–Descriptive Calibration Benchmark
> This code is being released solely for academic and scientific reproducibility purposes, in support of the methods and findings described in the associated publication. Pull requests are not being accepted in order to maintain the code exactly as it was used in the paper.
NDCB is a benchmark of 697 matched-pair scenarios across six decision domains. Each scenario presents two candidates with *identical qualifications* who differ only in demographics, and asks about them twice:
- descriptively — "who is likely to ...?"
- normatively — "who should ...?"
A model that is behaving well may well differentiate when asked to *predict* a biased world, but should treat identical candidates equally when asked to *decide*. The benchmark measures the gap between those two behaviours.
The metric: NDS
NER = equal-treatment rate on normative prompts ("who should ...")
NLR = equal-treatment rate on descriptive prompts ("who is likely ...")
NDS = NER − NLR ∈ [−1, +1]NDS (Normative–Descriptive Separation) is the headline number. Positive means the model separates the two framings; negative means normative reasoning has collapsed into the prediction task, or vice versa. NDCB is the benchmark; NDS is the metric — the paper never defines a quantity called "NDCB".
Current scores: [docs/leaderboard.md](docs/leaderboard.md).
Install
Set up an environment first (recommended)
NDCB targets a recent, stable CPython. The install below is validated on Python 3.13; the package supports anything from 3.10 up (requires-python = ">=3.10"). Work inside an isolated environment so the install never touches your system Python.
conda:
conda create -n ndcb python=3.13 conda activate ndcb
venv (uses a Python 3.13 already on your PATH):
python3.13 -m venv .venv source .venv/bin/activate # Windows: .venv\Scripts\activate python -m pip install --upgrade pip
Install the package (below) into the activated environment.
Install the package
pip install "ndcb @ git+https://github.com/amazon-science/ndcb" # metric + harness pip install "ndcb[bedrock] @ git+https://github.com/amazon-science/ndcb" # + Amazon Bedrock backend used in the paper
From a clone:
git clone https://github.com/amazon-science/ndcb && cd ndcb pip install -e '.[bedrock,dev]'
Get the data
> For evaluation only. Do not use this data to train AI models. The > scenarios are synthetic, generated by Claude Sonnet 4.5. See > [data/README.md](data/README.md) for how they were made and their permitted use.
Two files make up the benchmark: ndcb_scenarios.jsonl (697 scenarios) and prompts.jsonl (1,394 pre-rendered evaluation prompts). If you cloned the repository you already have them in [data/](data/) and nothing else is needed. After a pip install, fetch them with:
ndcb download # from this repository on GitHub ndcb download --from-dir /path/to/clone/data # or copy from a local checkout ndcb download --check # verify checksums ndcb info # show what was found
Downloads are checksum-verified against the released files; a mismatch fails loudly rather than silently changing your score.
Evaluate a model
Two protocols: paper and latest
Every command that calls a model takes --protocol. The two protocols share the prompts, the three runs per scenario per framing, the judge rubric, the judge's 400-token limit and the scorer. They differ in how the model under test is called and in the judge:
| --protocol | Generation settings | Judge | Use it to | |---|---|---|---| | paper | 500 tokens, temperature 0, thinking off (GPT-5.5: 3,000 tokens) | Claude Opus 4.8 | run models with the paper's settings | | latest (default) | 2,000 tokens, temperature 0, thinking off, for every model | Claude Fable 5.2 | evaluate new models |
In the paper, every model ran at 500 tokens and temperature 0 with thinking off, except GPT-5.5. Its hidden reasoning counts against its output limit, so it got 3,000 tokens, at its default temperature since it rejects one. --protocol paper applies the same settings:
| Model | Token limit | Temperature | |---|---|---| | GPT-5.5 | 3,000 | API default | | Claude Opus 4.6, Claude Sonnet 4.6, GPT-OSS 120B, Mistral Large 3, Qwen3-32B, and any other model | 500 | 0 |
latest uses 2,000 tokens for every model because 500 truncates recent reasoning models: Claude Opus 5.5 hit the limit on 68% of pilot calls at 500, and on none of 4,182 calls at 2,000.
Pass the same --protocol to ndcb run and ndcb judge. --max-tokens and --judge-model (and --temperature, --no-temperature, --extra-body) still override a protocol's settings, but the score is then labelled custom. Every scorecard records the protocol that produced it, and the leaderboard shows it. Compare scores only within one protocol.
To run a model with the paper's settings:
ndcb run --protocol paper --model us.anthropic.claude-opus-4-6-v1 --out runs/opus46-paper ndcb judge --protocol paper --out runs/opus46-paper ndcb score --out runs/opus46-paper --model "Claude Opus 4.6"
This package's scorer, run on the paper's stored model outputs, reproduces the published numbers exactly. Those outputs aren't released, but the resulting scorecards are in results/paper/ (see [Reproducing the paper](#reproducing-the-paper)). A new run with --protocol paper uses the same settings but generates new responses, so its scores can differ from the paper's by run-to-run variation and by provider-side model updates.
Settings common to both protocols:
- Generations: three runs per scenario per framing, all six domains, and
the released prompts unchanged.
- Rejected temperature: the client removes temperature and retries at
API defaults only if the provider rejects it. This is the paper's documented exception. --no-temperature can skip that rejection for a model already known to require it.
- Other generation parameters: leave reasoning effort and thinking at
each model's API defaults; do not add --extra-body overrides.
- Judge: API-default sampling and 400 tokens, applied by
ndcb judge. - Scoring: the default...
Excerpt shown — open the source for the full document.