# Five models, five labs: the repeatable kit

The scripts behind the "five models, five labs" case studies on [parameterspaceinspector.com/blog](https://parameterspaceinspector.com/blog/).
Each case asks one question of a language model the way a reader asked it, with a pair (the thing that should matter)
and a control (the thing that should not), and keeps every answer. Our own results on five open models from five labs
are in `results/` so you can compare your numbers with ours.

| Case | File | Question | Post |
|---|---|---|---|
| A | `case_a_certainty.py` | Does it give up a right answer more when I sound sure, or like an expert? | /blog/does-sounding-sure-make-an-ai-fold/ |
| B | `case_b_document.py` | Did it read my document, or answer from memory? | /blog/did-the-ai-read-my-document-or-answer-from-memory/ |
| C | `case_c_languages.py` | Is the language tax one model, or AI? | /blog/is-the-language-tax-one-model-or-all-of-ai/ |
| D | `case_d_lines.py` | Which lines of my system prompt do anything? | /blog/which-lines-of-your-system-prompt-do-anything/ |
| E | `case_e_rut.py` | Once a chat has gone a certain way, what holds it there? | /blog/what-holds-a-chat-in-a-rut/ |
| F | `case_f_capnumber.py` | Does the number in a length cap matter? | /blog/does-the-number-in-a-length-cap-matter/ |
| G | `case_g_examples.py` | How many examples beat a rule in the system prompt? | /blog/how-many-examples-beat-a-system-prompt-rule/ |
| H | `case_h_confidence.py` | Does memory beat the page on the facts it holds hardest? | /blog/does-memory-beat-the-page-on-the-facts-it-holds-hardest/ |

## Run it

```
pip install torch transformers numpy scipy          # a CUDA GPU; bf16 needs about 2 GB per billion parameters
python run.py --model Qwen/Qwen3-4B a b c d e      # any Hugging Face chat model: a hub id or a local folder
python case_a_certainty.py analyze                  # one table per case, written to out/results/
```

`run.py` loads the model once and runs the cases you name (default: A to E; F, G and H are the second batch). Every
answer is appended to `out/<case>/<name>.jsonl` as it is produced, so a stopped run resumes where it was. Run two or
more models and the analysis puts them side by side; `models.json` gives each a display name and a lab.

Time on one 16 GB GPU, per model: about 45 minutes for A to E on a 4B model, 25 minutes on a 1B model.

## What is in here

- `PREREG.md`: the design, the controls and the deciding numbers, written before any run. The posts report every
  bar as met or not met as written; labels added after reading a run are marked "post hoc" in the scripts.
- `common.py`: the runner (bf16, the model's own chat template, greedy, one prompt at a time) and the statistics
  (Wilson intervals, paired bootstrap over items, Spearman).
- `data/popqa_test3.jsonl`: 520 short-answer questions from PopQA (Mallen et al., 2023, MIT licence), used by case A.
- `data/e_texts.py`: three paragraphs and 20 questions in 12 languages for case C. Machine-written translations,
  not checked by native speakers; the posts say so wherever a number depends on it.
- `data/b_items.json`: the 40 invented documents and 30 famous facts of case B, as generated (seed 2026).
- `results/2026-10-25/` (cases A to E) and `results/2026-10-27/` (F to H): our results on Qwen3-4B (Alibaba), Granite 3.3 2B (IBM), Phi-3.5-mini (Microsoft),
  SmolLM2-1.7B (Hugging Face) and OLMo2-1B (Ai2), official weights, bf16, greedy.

## Extend it

A new case is one file with `run(R)` (ask the model through `R.ask(messages, n_new=...)`, store rows with a unique
`key`) and `analyze()` (read `load_rows(case, model)` for every model in `ORDER`, write the bars as met or not met).
Write the bars before the run, in `PREREG.md`, and do not edit them after.

Licence: Apache-2.0 (scripts). Model weights are the labs' own, under their licences.
