File size: 6,013 Bytes
04ad0f3
 
 
 
 
 
 
 
 
 
b947870
04ad0f3
b947870
04ad0f3
b947870
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Audit validation: method note

Purpose. Check that the cross-condition audit statistics behave as the pairwise decomposition predicts, on runs where the truth is known (a null re-render) or can be set (injected shift).

Design. Models llama3.1:8b-instruct-q4_K_M and qwen3:4b-instruct-2507-q8_0 (Ollama 0.35.1, default sampling, retry policy `same`, attempt logs). Sixteen vignettes (set v2), five model-call steps, R=12 replicates, three conditions per replicate: reference (`ref_white_man_private`), null (`rerender_control`, descriptor character-identical to the reference) and one demographic contrast (`black_woman_medicaid`). Within each replicate the three conditions run back to back in a counterbalanced order fixed before any call (`experiments/audit_cb_schedule.json`, written by `harness/scripts/audit_cb_schedule.py`, seed 20261013): each of the six orders is used twice, so each condition occupies each position four times; every step is time-stamped in `experiments/audit_cb_order_log.jsonl`. Rendered prompts and the dispatch instruction are byte-identical for reference and null across all 16 x 5 cells (`experiments/audit_render_diff.json`); for the demographic arm only the `Patient:` line differs. Driver: `experiments/run_audit_cb.sh`; outputs `experiments/audit_cb_<model>_<condition>/rep01..rep12`. The superseded first run (fixed order reference, null, demographic; R=10; `experiments/run_audit_val.sh`, `experiments/audit_val_*`) is analysed with `--prefix audit_val`, which writes `audit_validation_audit_val.json`.



Quantities (per vignette v and action k, pooled as ratios of summed counts). Within-condition floor f_i = n_i(R_i - n_i)/C(R_i,2). Cross-condition discordance d = [n0(R1-n1) + n1(R0-n0)]/(R0 R1). Exact identity for true rates: d = (f0 + f1)/2 + delta^2, with delta = p1 - p0. The estimator excess = d - (f0 + f1)/2 is unbiased for delta^2 and is algebraically equal to the plug-in squared shift (p1_hat - p0_hat)^2 minus p0_hat(1-p0_hat)/(R0-1) minus p1_hat(1-p1_hat)/(R1-1); the plug-in alone is biased upward by p0(1-p0)/R0 + p1(1-p1)/R1. The file reports `identity_gap_excess_minus_corrected` (zero to machine precision) as a code check. Under the null arm the expectation of excess is 0 and of the mean signed shift is 0.

Tests and intervals. Mean signed shift: mean over vignettes (and, pooled, over the five actions) of p1_hat - p0_hat; exact two-sided sign-flip permutation test over the 16 vignette-level shifts (65,536 patterns). Intervals: crossed vignette x replicate bootstrap (`crossed_boot.py` machinery), B=5000, seed 42; shared vignette draws, independent replicate draws per arm; within-condition floors use the off-diagonal U-statistic (a replicate is never paired with itself). Pooled estimates cover admit, escalate_icu, high_acuity, referral, any_opioid; cs_caution is reported per action only.

Known-truth simulation (replaces the earlier injection into observed null-arm draws, whose truth was a plug-in). `harness/scripts/audit_sim.py` draws every dataset from known Bernoulli probabilities (16 vignettes, five actions, R=12 per arm) calibrated to each model's observed reference rates or to homogeneous designs with expected floor 0.02, 0.10 or 0.22; scenarios: no effect, same-sign shift d (p capped at 1-d so the achieved shift is d everywhere), opposing +-d with exactly zero mean, sparse shifts on admission in 1, 2 or 4 vignettes, and population scenarios (vignettes redrawn from the calibrated rows; a self-consistency check). 2000 datasets per scenario, crossed bootstrap of 1000 per dataset, seed 42; reports bias, vignette-level and replicate-paired sign-flip rejection rates, the rate at which the excess interval lies above zero, and interval coverage. Output `experiments/audit_sim.json`.

Reproduce. `python harness/scripts/audit_validation.py` (real data, writes `experiments/audit_validation.json`; the injection study is no longer run (`--no-inject`); see `audit_sim.py`; `--standin` for a run on `floor16v3_*` split data, which writes `audit_validation_standin.json`). Run after all `audit_cb_*` replicates finish; it uses whichever complete replicates exist (at least two per arm). Order and elapsed-time check: `python harness/scripts/audit_order_check.py` (writes `experiments/audit_order_check.json`).

Status of results. Computed (`audit_validation.json`, counterbalanced run of 2026-10-13, 16 vignettes, R=12 per condition, pooled over the five defined actions; 5760 prompts, no retries, no final failures). Null vs reference: llama3.1:8b excess 0.001 (crossed 95% CI -0.015 to 0.021), mean shift -0.004 (CI -0.050 to 0.041; sign-flip p=0.82); qwen3:4b excess -0.001 (CI -0.005 to 0.003), mean shift -0.001 (CI -0.016 to 0.015; p=1.00). Demographic vs reference: llama3.1:8b excess -0.001 (CI -0.018 to 0.020), mean shift 0.026 (CI -0.019 to 0.076; p=0.08); qwen3:4b excess 0.004 (CI -0.002 to 0.016), mean shift 0.017 (CI 0.001 to 0.042; p=0.12). The qwen3:4b demographic mean-shift interval excludes zero while the exact sign-flip test does not reject; no effect is claimed. Pooled reference floors: llama3.1:8b 0.221, qwen3:4b 0.016. Order check (permutation of position and start-time labels within condition, 5000 permutations): llama3.1:8b p=0.75 (position), 0.53 (time); qwen3:4b p=0.96, 0.11. Sign-flip tests: on qwen3:4b only 4 of 16 vignette-level shifts are non-zero, so the vignette-level test cannot go below p=0.125. A replicate-paired sign-flip test (post hoc; replicate r of each arm ran in the same window) gives p=0.001 for the qwen3:4b demographic contrast and 0.16 on llama3.1:8b, against 1.00 and 0.78 for the null controls; post hoc evidence of a descriptor effect on qwen3:4b for these vignettes, no confirmatory or disparity claim. Simulation results: `audit_sim.json`. These are properties of this simulation design and two local models, not of the audit in general. The superseded fixed-order run (R=10) gave qualitatively the same results (`audit_validation_audit_val.json`).