prompt_version_pass_rate

Elixir library and Mix task. Give it a CSV with one row per test case and prompt version: the case id, the version label (v1, v2 and so on) and whether the output passed YOUR check (yes or no). It shows per version the number of cases, how many passed, the pass rate and a 95% Wilson score range for that rate, then compares every other version with a baseline you name.

The Wilson range for k passes out of n cases uses p = k / n and z = 1.96 (fixed): centre = (p + z2 / (2n)) / (1 + z2 / n), half-width = z * sqrt(p (1 - p) / n + z2 / (4 n2)) / (1 + z^2 / n), range = centre minus half-width to centre plus half-width. Pass rates and differences are exact and rounded half up to 1 decimal; the Wilson ends are floating point rounded to 1 decimal. For each version other than the baseline the tool prints the difference in percentage points (version minus baseline, signed) and whether the two ranges overlap, judged on the 1-decimal ends as printed. Versions are sorted by label and labels are compared as written, so v1 and V1 are two versions. A (case_id, version) pair may appear once; the same case id may appear under several versions. Extra columns are ignored. A missing file, a missing column, a passed value that is not yes or no, a duplicate pair, an unknown or missing baseline or no rows stops the run with an error and a non-zero exit.

A small number of cases cannot support a conclusion, and this tool decides nothing: overlapping ranges mean the file cannot tell two versions apart, and ranges that do not overlap are still only a description of the cases in the file. What counts as a pass is your own check.

Part of the OneGTMLab free GTM tools. Background on the idea: large language model.

Install

{:prompt_version_pass_rate, "~> 1.0"}   # in mix.exs deps

Use

CSV columns: case_id, version, passed. Option: --baseline LABEL (required, a version present in the file).

$ mix prompt_version_pass_rate sample.csv --baseline v1
cases read: 50
baseline: v1

version  cases  passed  pass rate %   95% range %
v1          20       6         30.0  14.5 to 51.9
v2          20      16         80.0  58.4 to 91.9
v3          10       5         50.0  23.7 to 76.3

difference in pass rate against baseline v1 (percentage points)
v2: +50.0 points, ranges do not overlap
v3: +20.0 points, ranges overlap: the file cannot tell them apart

Test

mix test

Offline, no network calls, no dependencies beyond the language runtime. MIT licensed.