SamePinout v0: 204 questions, preregistered evaluation of 20 models, raw runs, audit, scripts
1b2c3dd verified Download src/render_tables.py from shimmerhuang/same-pinout: direct link, hf CLI and curl.
- Browser
- Download file 3.41 kB
-
https://huggingface.co/datasets/shimmerhuang/same-pinout/resolve/main/src/render_tables.py
- Command line
-
hf download hf://datasets/shimmerhuang/same-pinout/src/render_tables.py
-
curl -L -o render_tables.py https://huggingface.co/datasets/shimmerhuang/same-pinout/resolve/main/src/render_tables.py
3.41 kB
| #!/usr/bin/env python3 | |
| """把 score.py --json 的输出排成数据卡里用的 Markdown 表。只排版,不算分:每个数都原样取自判分结果。 | |
| 用法:score.py <questions> <runs_dir> --audit <audit.tsv> --json | render_tables.py | |
| """ | |
| import json | |
| import sys | |
| CH = {"api": "Direct API", "claude-cli": "Claude CLI, tools off", "codex-cli": "Codex CLI, tools off"} | |
| ORDER = ["api", "claude-cli", "codex-cli"] | |
| def pct(x): | |
| return "—" if x is None else f"{100 * x:.1f}" | |
| def status(c): | |
| if c["confirmatory"]: | |
| return "valid" | |
| why = "; ".join(c.get("not_confirmatory_because") or []) | |
| if not c["complete"]: | |
| return f"incomplete ({204 - c['missing_of_full_set']}/204)" | |
| if c.get("void"): | |
| return "void (format failures > 20%)" | |
| return f"exploratory: {why}" | |
| def rows(cols, setting): | |
| cs = [c for c in cols if c["setting"] == setting] | |
| return sorted(cs, key=lambda c: (ORDER.index(c["channel"]), not c["confirmatory"], -(c["judge_acc"] or 0), c["model"])) | |
| def main(): | |
| d = json.load(sys.stdin) | |
| cols = d["columns"] | |
| n = d["scored_questions"] | |
| base = cols[0]["base_rate_different"] | |
| print(f"Scored on {n} questions (1 of 204 excluded by the datasheet audit). " | |
| f"Base rate of the positive class (\"different arrangement\"): {pct(base)}%, so always answering one way scores about 50% judgement accuracy.\n") | |
| for setting, title in (("closed", "Closed book (part numbers only)"), ("open", "Open book (both pin tables given)")): | |
| print(f"### {title}\n") | |
| print("| Model | Channel | Judgement acc. | Precision (different) | Recall (different) | Whole-question correct | Pin-set F1 | Format failures | Truncated | Status |") | |
| print("|---|---|---|---|---|---|---|---|---|---|") | |
| for c in rows(cols, setting): | |
| name = f"`{c['model']}`" | |
| if not c["complete"]: # 没考完的栏不报数:缺的题会被当成错,数字没有意义 | |
| print(f"| {name} | {CH[c['channel']]} | — | — | — | — | — | — | — | {status(c)} |") | |
| continue | |
| print(f"| {name} | {CH[c['channel']]} | {pct(c['judge_acc'])} | {pct(c['diff_precision'])} | {pct(c['diff_recall'])} | " | |
| f"{pct(c['full_correct'])} | {pct(c['a_set_f1'])} | {pct(c['format_fail'])} | {pct(c['truncated'])} | {status(c)} |") | |
| print() | |
| h = d["hypotheses"] | |
| print("### Pre-registered hypotheses\n") | |
| print("| | Hypothesis | Result | Holds? |") | |
| print("|---|---|---|---|") | |
| h1, h2, h3 = h["H1_closed_best_judge_acc"], h["H2_open_best_full_correct"], h["H3_small_open_full_correct"] | |
| yn = lambda x: "not tested" if x is None else ("yes" if x else "no") | |
| print(f"| H1 | Closed book: the best valid column stays below 80% judgement accuracy | best = `{h1['model']}` at {pct(h1['value'])}% | {yn(h1['holds'])} |") | |
| print(f"| H2 | Open book: the best valid column reaches at least 95% whole-question correct | best = `{h2['model']}` at {pct(h2['value'])}% | {yn(h2['holds'])} |") | |
| small = ", ".join(f"`{m}` {pct(v)}%" for m, v in h3["values"].items()) | |
| print(f"| H3 | Open book: every small model (4B parameters or fewer) stays below 80% whole-question correct | {small} | {yn(h3['holds'])} |") | |
| print(f"\nValid columns: {h['confirmatory_columns']} of {h['of_expected']} planned.") | |
| if __name__ == "__main__": | |
| main() | |