HideIron commited on
Commit
2a8d74e
Β·
verified Β·
1 Parent(s): f636e22

final results: gate approves BCO+replay, test +2.0pp

Browse files
Files changed (2) hide show
  1. README.md +32 -21
  2. index.html +131 -128
README.md CHANGED
@@ -8,20 +8,25 @@ pinned: false
8
  license: cc-by-sa-4.0
9
  ---
10
 
11
- # Self-Healing Text-to-SQL (Lexsi Hackathon, Track 3 β€” PS #8)
12
 
13
  A fully automated self-healing loop for a **Tiny Aya Global (3.35B)** text-to-SQL
14
  agent on **Spider**: detect failing runs by *executing* the SQL, classify root causes,
15
  generate **execution-verified** corrective training pairs with **Aya Expanse 32B**,
16
- retrain adapter-only **DPO** through **AgentTune**, and gate redeployment with
17
  **AgentTune's DeploymentGate**. Outcomes independently verified with **AuditKIT**.
18
 
 
 
 
 
 
19
  ```
20
  student (Tiny Aya) writes SQL ──▢ execcheck runs it vs gold ──▢ failures
21
  β–² β”‚
22
  β”‚ classify (SQL taxonomy, Aya-32B)
23
- DPO LoRA adapter β”‚
24
- (AgentTune run_retrain) generate fix (Aya-32B, never sees gold)
25
  β–² β”‚
26
  β”‚ execute fix ─ correct? keep : retry ≀3
27
  158 verified pairs β—€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
@@ -35,44 +40,50 @@ student (Tiny Aya) writes SQL ──▢ execcheck runs it vs gold ──▢ fail
35
 
36
  | path | what |
37
  |---|---|
38
- | `src/selfheal_sql/execcheck.py` | Execution checker β€” the single source of truth for pass/fail |
39
  | `src/selfheal_sql/make_splits.py` | Database-disjoint pool/gate/test splits from Spider |
40
- | `src/selfheal_sql/student.py` | Student harness: prompt β†’ SQL β†’ execute β†’ grade β†’ log |
41
- | `src/selfheal_sql/heal.py` | Classify failures + generate execution-verified DPO pairs |
42
- | `src/selfheal_sql/train_dpo.py` | Adapter-only DPO via AgentTune `RetrainConfig`/`build_retrainer` |
43
- | `src/selfheal_sql/gate_decision.py` | AgentTune `DeploymentGate.evaluate_decision` on the gate split |
 
44
  | `src/selfheal_sql/audit_eval.py` | AuditKIT `agent_eval` with a fresh-execution outcome oracle |
45
  | `src/selfheal_sql/metrics.py` | Before/after report (accuracy, heal/regression rate, McNemar) |
46
  | `src/selfheal_sql/launch_job.py` | Runs any of the above on HF Jobs GPUs |
47
  | `src/selfheal_sql/build_hf_dataset.py` | Packages splits + SQLite DBs to the HF dataset repo |
48
  | `third_party/agenttune_gate/` | AgentTune's DeploymentGate vendored verbatim (provenance inside) |
49
- | `writeup/` | HF Article draft |
50
 
51
- ## Hugging Face artifacts
52
 
 
53
  - Dataset (splits + 149 Spider DBs): `HideIron/selfheal-sql-spider`
54
- - Every run log, heal pairs, gate decision, metrics: `HideIron/selfheal-sql-runs`
55
- - DPO adapter: `HideIron/tiny-aya-global-sql-selfheal`
 
56
 
57
  ## Reproduce
58
 
59
  ```bash
60
  # 1. splits (needs the official Spider download)
61
  python src/selfheal_sql/make_splits.py <spider_data_dir> data/splits 600 100 500 0
 
62
  # 2. baseline on an HF Jobs A10G
63
  python src/selfheal_sql/launch_job.py --name baseline-pool -- student.py --split pool
64
  # 3. heal (local; needs HF_TOKEN for the Aya-32B router calls)
65
  python src/selfheal_sql/heal.py --split-file data/splits/pool.jsonl --out data/heal
66
- # 4. DPO retrain (AgentTune on an A10G)
67
- python src/selfheal_sql/launch_job.py --name dpo-full --image python:3.12 \
68
- --pip "agenttune huggingface_hub" -- train_dpo.py
 
69
  # 5. healed evals, gate, metrics
70
- python src/selfheal_sql/launch_job.py --name healed-gate -- student.py --split gate \
71
- --adapter HideIron/tiny-aya-global-sql-selfheal
72
- python src/selfheal_sql/gate_decision.py
73
  python src/selfheal_sql/metrics.py --pair test:baseline-test:healed-test
 
74
  ```
75
 
76
- Models: Tiny Aya Global (student) and Aya Expanse 32B (healer) β€” both open-weights
77
  Cohere Labs models from the hackathon's allowed list. Spider is CC BY-SA 4.0.
78
- AgentTune/AuditKIT are Lexsi Labs (LSAL / their respective licenses).
 
8
  license: cc-by-sa-4.0
9
  ---
10
 
11
+ # Self-Healing Text-to-SQL (Lexsi Hackathon, Track 3, PS #8)
12
 
13
  A fully automated self-healing loop for a **Tiny Aya Global (3.35B)** text-to-SQL
14
  agent on **Spider**: detect failing runs by *executing* the SQL, classify root causes,
15
  generate **execution-verified** corrective training pairs with **Aya Expanse 32B**,
16
+ retrain adapter-only (DPO / BCO) through **AgentTune**, and gate redeployment with
17
  **AgentTune's DeploymentGate**. Outcomes independently verified with **AuditKIT**.
18
 
19
+ Result: the gate blocked four regressing adapters, approved the fifth
20
+ (BCO + success replay) on a 400-question held-out gate, and the deployed adapter
21
+ improves the unseen 500-question test split 45.6% -> 47.6% execution accuracy
22
+ (valid-SQL 68.2% -> 73.0%).
23
+
24
  ```
25
  student (Tiny Aya) writes SQL ──▢ execcheck runs it vs gold ──▢ failures
26
  β–² β”‚
27
  β”‚ classify (SQL taxonomy, Aya-32B)
28
+ LoRA adapter β”‚
29
+ (AgentTune DPO/BCO retrain) generate fix (Aya-32B, never sees gold)
30
  β–² β”‚
31
  β”‚ execute fix ─ correct? keep : retry ≀3
32
  158 verified pairs β—€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
 
40
 
41
  | path | what |
42
  |---|---|
43
+ | `src/selfheal_sql/execcheck.py` | Execution checker, the single source of truth for pass/fail |
44
  | `src/selfheal_sql/make_splits.py` | Database-disjoint pool/gate/test splits from Spider |
45
+ | `src/selfheal_sql/make_gate_large.py` | Enlarges the gate split 100 -> 400 for statistical power |
46
+ | `src/selfheal_sql/student.py` | Student harness: prompt -> SQL -> execute -> grade -> log |
47
+ | `src/selfheal_sql/heal.py` | Classify failures + generate execution-verified training pairs |
48
+ | `src/selfheal_sql/train_dpo.py` | Adapter-only DPO/BCO via AgentTune `RetrainConfig`/`build_retrainer` |
49
+ | `src/selfheal_sql/gate_decision.py` | AgentTune `DeploymentGate.evaluate_decision` on gate data |
50
  | `src/selfheal_sql/audit_eval.py` | AuditKIT `agent_eval` with a fresh-execution outcome oracle |
51
  | `src/selfheal_sql/metrics.py` | Before/after report (accuracy, heal/regression rate, McNemar) |
52
  | `src/selfheal_sql/launch_job.py` | Runs any of the above on HF Jobs GPUs |
53
  | `src/selfheal_sql/build_hf_dataset.py` | Packages splits + SQLite DBs to the HF dataset repo |
54
  | `third_party/agenttune_gate/` | AgentTune's DeploymentGate vendored verbatim (provenance inside) |
55
+ | `writeup/` | HF Article |
56
 
57
+ ## Hugging Face artifacts (all public)
58
 
59
+ - Project page + this source: Space `HideIron/selfheal-sql`
60
  - Dataset (splits + 149 Spider DBs): `HideIron/selfheal-sql-spider`
61
+ - Every run log, heal pairs, gate decisions, metrics, audits: `HideIron/selfheal-sql-runs`
62
+ - Adapters: `HideIron/tiny-aya-global-sql-selfheal` (DPO, blocked),
63
+ `...-bco` (blocked), `...-bco-replay` (deployed)
64
 
65
  ## Reproduce
66
 
67
  ```bash
68
  # 1. splits (needs the official Spider download)
69
  python src/selfheal_sql/make_splits.py <spider_data_dir> data/splits 600 100 500 0
70
+ python src/selfheal_sql/make_gate_large.py --total 400 --seed 1
71
  # 2. baseline on an HF Jobs A10G
72
  python src/selfheal_sql/launch_job.py --name baseline-pool -- student.py --split pool
73
  # 3. heal (local; needs HF_TOKEN for the Aya-32B router calls)
74
  python src/selfheal_sql/heal.py --split-file data/splits/pool.jsonl --out data/heal
75
+ # 4. retrain (AgentTune on an A10G); best recipe = BCO + success replay
76
+ python src/selfheal_sql/launch_job.py --name bco-replay --image python:3.12 \
77
+ --pip "agenttune huggingface_hub" -- train_dpo.py --algorithm bco \
78
+ --replay-run baseline-pool600 --adapter-repo <you>/tiny-aya-sql-bco-replay
79
  # 5. healed evals, gate, metrics
80
+ python src/selfheal_sql/launch_job.py --name healed-gate -- student.py --split gate_large \
81
+ --adapter <you>/tiny-aya-sql-bco-replay
82
+ python src/selfheal_sql/gate_decision.py --old baseline-gate-large --new healed-gate
83
  python src/selfheal_sql/metrics.py --pair test:baseline-test:healed-test
84
+ python src/selfheal_sql/audit_eval.py --run healed-test --split-file data/splits/test.jsonl
85
  ```
86
 
87
+ Models: Tiny Aya Global (student) and Aya Expanse 32B (healer), both open-weights
88
  Cohere Labs models from the hackathon's allowed list. Spider is CC BY-SA 4.0.
89
+ AgentTune/AuditKIT are Lexsi Labs (their respective licenses).
index.html CHANGED
@@ -1,128 +1,131 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1">
6
- <title>Self-Healing Text-to-SQL</title>
7
- <style>
8
- :root{
9
- --bg:#f7f6f3; --card:#ffffff; --ink:#1a1a1a; --muted:#5f5c57; --line:#e4e1db;
10
- --accent:#b4552d; --good:#2d7a4f; --bad:#a63d3d; --code:#f0eee9;
11
- }
12
- @media (prefers-color-scheme: dark){ :root:not([data-theme="light"]){
13
- --bg:#171614; --card:#201f1c; --ink:#ece9e4; --muted:#a39e96; --line:#35332e;
14
- --accent:#e08050; --good:#5fbf8a; --bad:#d97f7f; --code:#2a2925;
15
- }}
16
- :root[data-theme="dark"]{
17
- --bg:#171614; --card:#201f1c; --ink:#ece9e4; --muted:#a39e96; --line:#35332e;
18
- --accent:#e08050; --good:#5fbf8a; --bad:#d97f7f; --code:#2a2925;
19
- }
20
- *{box-sizing:border-box}
21
- body{margin:0;background:var(--bg);color:var(--ink);
22
- font:16px/1.6 Georgia,'Times New Roman',serif;}
23
- .wrap{max-width:860px;margin:0 auto;padding:48px 16px 80px}
24
- h1{font-size:2rem;line-height:1.2;margin:0 0 4px}
25
- h2{font-size:1.25rem;margin:40px 0 12px;border-bottom:1px solid var(--line);padding-bottom:6px}
26
- .sub{color:var(--muted);margin:0 0 28px}
27
- .badge{display:inline-block;background:var(--accent);color:#fff;border-radius:4px;
28
- padding:1px 8px;font:600 .75rem/1.6 system-ui,sans-serif;vertical-align:middle}
29
- p{margin:12px 0}
30
- pre{background:var(--code);border:1px solid var(--line);border-radius:8px;
31
- padding:14px;overflow-x:auto;font:13px/1.5 ui-monospace,Consolas,monospace}
32
- table{border-collapse:collapse;width:100%;font:14px/1.5 system-ui,sans-serif;margin:16px 0}
33
- th,td{border:1px solid var(--line);padding:7px 10px;text-align:left}
34
- th{background:var(--code)}
35
- td.num{text-align:right;font-variant-numeric:tabular-nums}
36
- .good{color:var(--good);font-weight:600}.bad{color:var(--bad);font-weight:600}
37
- a{color:var(--accent)}
38
- ul{padding-left:22px}
39
- .card{background:var(--card);border:1px solid var(--line);border-radius:10px;
40
- padding:4px 18px;margin:18px 0}
41
- .foot{color:var(--muted);font-size:.85rem;margin-top:48px;border-top:1px solid var(--line);padding-top:14px}
42
- </style>
43
- </head>
44
- <body>
45
- <div class="wrap">
46
- <h1>Self-Healing Text-to-SQL <span class="badge">PS #8</span></h1>
47
- <p class="sub">Lexsi Labs Hackathon Β· Track 3 (Agentic Fine-tuning) Β· AgentTune + AuditKIT Β·
48
- Cohere Labs open models</p>
49
-
50
- <p>A fully automated self-healing loop for a <strong>Tiny Aya Global (3.35B)</strong>
51
- text-to-SQL agent on Spider: failures are detected by <em>executing</em> the SQL,
52
- classified into SQL root causes, corrected by <strong>Aya Expanse 32B</strong>
53
- (every fix verified by execution before it becomes training data β€” the healer never
54
- sees the gold query), retrained adapter-only through <strong>AgentTune</strong>, and
55
- deployment is decided by <strong>AgentTune's DeploymentGate</strong> on a held-out
56
- split. Outcomes independently re-verified with <strong>AuditKIT</strong>.
57
- No human wrote or fixed a single SQL query.</p>
58
-
59
- <h2>The loop</h2>
60
- <pre>
61
- student (Tiny Aya 3.35B) writes SQL ──▢ execution checker runs it vs gold ──▢ failures
62
- β–² β”‚
63
- β”‚ classify (SQL taxonomy, Aya Expanse 32B)
64
- LoRA adapter (AgentTune β”‚
65
- DPO / BCO retrain) generate fix (Aya Expanse 32B, never sees gold)
66
- β–² β”‚
67
- β”‚ execute fix ── correct? keep : retry ≀3
68
- 158 execution-verified pairs β—€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
69
- β”‚
70
- AgentTune DeploymentGate (held-out gate split) ──▢ deploy / keep old
71
- β”‚
72
- final report on unseen test split (+ AuditKIT re-verification)
73
- </pre>
74
-
75
- <h2>Headline results</h2>
76
- <div class="card">
77
- <p><strong>The loop ran end-to-end β€” and the gate did its job.</strong>
78
- 158 of 253 pool failures (62.5%) were converted into execution-verified corrective
79
- training pairs. Retraining consistently <em>regressed</em> held-out accuracy
80
- (a documented DPO failure mode on near-identical SQL pairs, plus catastrophic
81
- forgetting), and the DeploymentGate correctly <span class="bad">BLOCKED</span> every
82
- candidate adapter, keeping the baseline deployed. The best candidate
83
- (BCO&nbsp;+&nbsp;success-replay) recovered to within 2pp of baseline.</p>
84
- </div>
85
-
86
- <table>
87
- <tr><th>Stage</th><th>Metric</th><th class="num">Value</th></tr>
88
- <tr><td>Baseline, pool (600)</td><td>execution accuracy</td><td class="num">57.8%</td></tr>
89
- <tr><td>Baseline, gate (100)</td><td>execution accuracy</td><td class="num">62.0%</td></tr>
90
- <tr><td>Baseline, <strong>test (500, unseen)</strong></td><td>execution accuracy</td><td class="num"><strong>45.6%</strong></td></tr>
91
- <tr><td>Heal stage</td><td>verified-fix yield</td><td class="num good">158 / 253 (62.5%)</td></tr>
92
- <tr><td>DPO adapter, gate</td><td>execution accuracy</td><td class="num">58.0% <span class="bad">BLOCKED</span></td></tr>
93
- <tr><td>BCO + replay adapter, gate</td><td>execution accuracy</td><td class="num">60.0% <span class="bad">BLOCKED</span></td></tr>
94
- <tr><td>AuditKIT re-verification, test</td><td>agreement with harness</td><td class="num good">500 / 500</td></tr>
95
- </table>
96
- <p>Full before/after tables (valid-SQL rates, per-status breakdowns, McNemar exact
97
- tests, 400-question enlarged gate) are in the article and the runs repo below.</p>
98
-
99
- <h2>Artifacts</h2>
100
- <ul>
101
- <li>Dataset β€” splits + 149 Spider DBs:
102
- <a href="https://huggingface.co/datasets/HideIron/selfheal-sql-spider">HideIron/selfheal-sql-spider</a></li>
103
- <li>Every run log, heal pairs, gate decisions, metrics:
104
- <a href="https://huggingface.co/datasets/HideIron/selfheal-sql-runs">HideIron/selfheal-sql-runs</a></li>
105
- <li>Adapters:
106
- <a href="https://huggingface.co/HideIron/tiny-aya-global-sql-selfheal">DPO</a> Β·
107
- <a href="https://huggingface.co/HideIron/tiny-aya-global-sql-selfheal-bco">BCO</a> Β·
108
- <a href="https://huggingface.co/HideIron/tiny-aya-global-sql-selfheal-bco-replay">BCO&nbsp;+&nbsp;replay</a></li>
109
- <li>Code β€” browse the <em>Files</em> tab of this Space (<code>src/selfheal_sql/</code>);
110
- reproduce instructions in <code>README.md</code></li>
111
- </ul>
112
-
113
- <h2>Why the gate blocking is the point</h2>
114
- <p>PS #8 asks for redeployment <em>gated on measured accuracy</em>. Preference-tuning
115
- on minimal-edit SQL pairs hits <em>likelihood displacement</em> (chosen and rejected
116
- share ~90% of tokens; pushing the rejected down drags the chosen with it) and training
117
- only on failures causes forgetting of the 347 already-correct answers. The gate caught
118
- every resulting regression on held-out data and refused to ship β€” exactly what a
119
- production self-healing system must do. The analysis, and the BCO + success-replay
120
- remedy that recovers most of the gap, are in the article.</p>
121
-
122
- <div class="foot">Solo project Β· models: Tiny Aya Global (student) and Aya Expanse 32B
123
- (healer), both open-weights Cohere Labs models from the hackathon's allowed list Β·
124
- Spider is CC BY-SA 4.0 Β· AgentTune/AuditKIT Β© Lexsi Labs (DeploymentGate vendored
125
- verbatim @ 1dfd054, provenance in <code>third_party/</code>).</div>
126
- </div>
127
- </body>
128
- </html>
 
 
 
 
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Self-Healing Text-to-SQL</title>
7
+ <style>
8
+ :root{
9
+ --bg:#f7f6f3; --card:#ffffff; --ink:#1a1a1a; --muted:#5f5c57; --line:#e4e1db;
10
+ --accent:#b4552d; --good:#2d7a4f; --bad:#a63d3d; --code:#f0eee9;
11
+ }
12
+ @media (prefers-color-scheme: dark){ :root:not([data-theme="light"]){
13
+ --bg:#171614; --card:#201f1c; --ink:#ece9e4; --muted:#a39e96; --line:#35332e;
14
+ --accent:#e08050; --good:#5fbf8a; --bad:#d97f7f; --code:#2a2925;
15
+ }}
16
+ :root[data-theme="dark"]{
17
+ --bg:#171614; --card:#201f1c; --ink:#ece9e4; --muted:#a39e96; --line:#35332e;
18
+ --accent:#e08050; --good:#5fbf8a; --bad:#d97f7f; --code:#2a2925;
19
+ }
20
+ *{box-sizing:border-box}
21
+ body{margin:0;background:var(--bg);color:var(--ink);
22
+ font:16px/1.6 Georgia,'Times New Roman',serif;}
23
+ .wrap{max-width:860px;margin:0 auto;padding:48px 16px 80px}
24
+ h1{font-size:2rem;line-height:1.2;margin:0 0 4px}
25
+ h2{font-size:1.25rem;margin:40px 0 12px;border-bottom:1px solid var(--line);padding-bottom:6px}
26
+ .sub{color:var(--muted);margin:0 0 28px}
27
+ .badge{display:inline-block;background:var(--accent);color:#fff;border-radius:4px;
28
+ padding:1px 8px;font:600 .75rem/1.6 system-ui,sans-serif;vertical-align:middle}
29
+ p{margin:12px 0}
30
+ pre{background:var(--code);border:1px solid var(--line);border-radius:8px;
31
+ padding:14px;overflow-x:auto;font:13px/1.5 ui-monospace,Consolas,monospace}
32
+ table{border-collapse:collapse;width:100%;font:14px/1.5 system-ui,sans-serif;margin:16px 0}
33
+ th,td{border:1px solid var(--line);padding:7px 10px;text-align:left}
34
+ th{background:var(--code)}
35
+ td.num{text-align:right;font-variant-numeric:tabular-nums}
36
+ .good{color:var(--good);font-weight:600}.bad{color:var(--bad);font-weight:600}
37
+ a{color:var(--accent)}
38
+ ul{padding-left:22px}
39
+ .card{background:var(--card);border:1px solid var(--line);border-radius:10px;
40
+ padding:4px 18px;margin:18px 0}
41
+ .foot{color:var(--muted);font-size:.85rem;margin-top:48px;border-top:1px solid var(--line);padding-top:14px}
42
+ </style>
43
+ </head>
44
+ <body>
45
+ <div class="wrap">
46
+ <h1>Self-Healing Text-to-SQL <span class="badge">PS #8</span></h1>
47
+ <p class="sub">Lexsi Labs Hackathon Β· Track 3 (Agentic Fine-tuning) Β· AgentTune + AuditKIT Β·
48
+ Cohere Labs open models</p>
49
+
50
+ <p>A fully automated self-healing loop for a <strong>Tiny Aya Global (3.35B)</strong>
51
+ text-to-SQL agent on Spider: failures are detected by <em>executing</em> the SQL,
52
+ classified into SQL root causes, corrected by <strong>Aya Expanse 32B</strong>
53
+ (every fix verified by execution before it becomes training data; the healer never
54
+ sees the gold query), retrained adapter-only through <strong>AgentTune</strong>, and
55
+ deployment is decided by <strong>AgentTune's DeploymentGate</strong> on a held-out
56
+ split. Outcomes independently re-verified with <strong>AuditKIT</strong>.
57
+ No human wrote or fixed a single SQL query.</p>
58
+
59
+ <h2>The loop</h2>
60
+ <pre>
61
+ student (Tiny Aya 3.35B) writes SQL ──▢ execution checker runs it vs gold ──▢ failures
62
+ β–² β”‚
63
+ β”‚ classify (SQL taxonomy, Aya Expanse 32B)
64
+ LoRA adapter (AgentTune β”‚
65
+ DPO / BCO retrain) generate fix (Aya Expanse 32B, never sees gold)
66
+ β–² β”‚
67
+ β”‚ execute fix ── correct? keep : retry ≀3
68
+ 158 execution-verified pairs β—€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
69
+ β”‚
70
+ AgentTune DeploymentGate (held-out gate split) ──▢ deploy / keep old
71
+ β”‚
72
+ final report on unseen test split (+ AuditKIT re-verification)
73
+ </pre>
74
+
75
+ <h2>Headline results</h2>
76
+ <div class="card">
77
+ <p><strong>The loop ran end to end, and the gate mattered twice.</strong>
78
+ 158 of 253 pool failures (62.5%) became execution-verified corrective training
79
+ pairs. The DeploymentGate correctly <span class="bad">BLOCKED</span> four regressing
80
+ adapters (naive DPO hits likelihood displacement on minimal-edit SQL pairs, plus
81
+ catastrophic forgetting), then <span class="good">APPROVED</span> the fifth
82
+ (BCO&nbsp;+&nbsp;success-replay) on a 400-question held-out gate. The deployed
83
+ adapter improves the unseen test split <strong>45.6% β†’ 47.6%</strong> execution
84
+ accuracy and <strong>68.2% β†’ 73.0%</strong> valid-SQL rate.</p>
85
+ </div>
86
+
87
+ <table>
88
+ <tr><th>Stage</th><th>Metric</th><th class="num">Value</th></tr>
89
+ <tr><td>Baseline, <strong>test (500, unseen)</strong></td><td>execution accuracy</td><td class="num">45.6%</td></tr>
90
+ <tr><td>Heal stage</td><td>verified-fix yield</td><td class="num good">158 / 253 (62.5%)</td></tr>
91
+ <tr><td>DPO adapter, gate (n=100)</td><td>execution accuracy</td><td class="num">58.0% vs 62.0% <span class="bad">BLOCKED</span></td></tr>
92
+ <tr><td>BCO + replay, gate (n=400)</td><td>execution accuracy</td><td class="num">59.25% vs 59.0% <span class="good">APPROVED</span></td></tr>
93
+ <tr><td><strong>BCO + replay, test (500, unseen)</strong></td><td>execution accuracy</td><td class="num good"><strong>47.6% (+2.0pp, fixed 34 / broke 24)</strong></td></tr>
94
+ <tr><td>BCO + replay, test</td><td>valid-SQL rate</td><td class="num good">73.0% (vs 68.2%)</td></tr>
95
+ <tr><td>AuditKIT re-verification, test Γ—2</td><td>agreement with harness</td><td class="num good">500 / 500 both runs</td></tr>
96
+ </table>
97
+ <p>Full before/after tables (per-status breakdowns, McNemar exact tests, all five
98
+ adapters, gate decision JSONs) are in the article and the runs repo below.</p>
99
+
100
+ <h2>Artifacts</h2>
101
+ <ul>
102
+ <li>Dataset (splits + 149 Spider DBs):
103
+ <a href="https://huggingface.co/datasets/HideIron/selfheal-sql-spider">HideIron/selfheal-sql-spider</a></li>
104
+ <li>Every run log, heal pairs, gate decisions, metrics:
105
+ <a href="https://huggingface.co/datasets/HideIron/selfheal-sql-runs">HideIron/selfheal-sql-runs</a></li>
106
+ <li>Adapters:
107
+ <a href="https://huggingface.co/HideIron/tiny-aya-global-sql-selfheal">DPO</a> Β·
108
+ <a href="https://huggingface.co/HideIron/tiny-aya-global-sql-selfheal-bco">BCO</a> Β·
109
+ <a href="https://huggingface.co/HideIron/tiny-aya-global-sql-selfheal-bco-replay">BCO&nbsp;+&nbsp;replay</a></li>
110
+ <li>Code: browse the <em>Files</em> tab of this Space (<code>src/selfheal_sql/</code>);
111
+ reproduce instructions in <code>README.md</code></li>
112
+ </ul>
113
+
114
+ <h2>Why the gate is the point</h2>
115
+ <p>PS #8 asks for redeployment <em>gated on measured accuracy</em>. Preference-tuning
116
+ on minimal-edit SQL pairs hits <em>likelihood displacement</em> (chosen and rejected
117
+ share ~90% of tokens; pushing the rejected down drags the chosen with it), and
118
+ training only on failures causes forgetting of the 347 already-correct answers. The
119
+ gate caught every resulting regression on held-out data and refused to ship. Then,
120
+ once BCO + success-replay removed both causes and the gate was enlarged to 400
121
+ questions for statistical power, it approved deployment, and the test split confirmed
122
+ the gain on databases nothing in the loop ever saw. The gate's decisions ranked the
123
+ adapters correctly on unseen data. Full analysis in the article.</p>
124
+
125
+ <div class="foot">Solo project Β· models: Tiny Aya Global (student) and Aya Expanse 32B
126
+ (healer), both open-weights Cohere Labs models from the hackathon's allowed list Β·
127
+ Spider is CC BY-SA 4.0 Β· AgentTune/AuditKIT Β© Lexsi Labs (DeploymentGate vendored
128
+ verbatim @ 1dfd054, provenance in <code>third_party/</code>).</div>
129
+ </div>
130
+ </body>
131
+ </html>