Skip to content

Commit af4e182

Browse files
JuliaEdomclaude
andcommitted
eval+docs: stress-test v10 on Arcwise-Plat corrected gold
Re-score v10 predictions (HEAD d0cd792, 80.5% on BIRD original gold) against Jin et al. CIDR/VLDB 2026 corrected artefacts (arXiv:2601.08778). 199/200 of our qids overlap with Arcwise-Plat. Results: - BIRD original gold: 80.5% (161/200) - Arcwise-Plat-SQL (SQL-only fixes): 67.34% (134/199) - Arcwise-Plat full (SQL+question+evidence+schema): 61.81% (123/199) Net transitions vs original (sql_only): - 6 GAINED — qids 672, 1029, 1144, 1247, 1251, 1254. Our pred catches real BIRD annotation bugs: missing DISTINCT, ASC-vs-DESC inversion, extra id column in projection, wrong operator precedence, unnecessary joins. - 32 LOST — mostly Arcwise tightening gold with quality fixes (rtype='S' filter, NOT NULL guards, DISTINCT in both numerator/denominator, tie-handling via MIN(date) vs LIMIT 1). Portfolio framing now a triplet, not a single number: 1. 80.5% on published BIRD (leaderboard-comparable) 2. 67.34% on Arcwise-Plat-SQL (honest noise-floor estimate) 3. +6 auditable cases where our pred beat BIRD's wrong gold (signal) Artefacts: - docs/corrected_gold_evaluation.md — methodology + per-qid audit - scripts/rescore_arcwise.py — re-execution + comparison harness - data/arcwise_plat_{sql_only,full}.json — corrected gold (Jin et al.) - eval/reports/2026-05-17/arcwise_rescored.json — per-record output Gates: 270 pytest pass, ruff/mypy strict clean (55 src files). No HF redeploy needed — this is a measurement-only change; pred stack and live demo unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent cde3978 commit af4e182

9 files changed

Lines changed: 11381 additions & 6 deletions

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ data/**/*
8686
# `scripts/build_fewshot_index.py` to populate the cross-db fewshot
8787
# pool. Source: huggingface.co/datasets/xu3kev/BIRD-SQL-data-train.
8888
!data/bird_train.parquet
89+
# Arcwise-Plat corrected-gold artefacts (Jin et al., CIDR/VLDB 2026,
90+
# arXiv:2601.08778). ~300 KB each. Used by scripts/rescore_arcwise.py to
91+
# stress-test our EA on annotation-error-corrected BIRD.
92+
!data/arcwise_plat_sql_only.json
93+
!data/arcwise_plat_full.json
8994
# Chroma vector store. Committing the prebuilt index so the deployed
9095
# app can serve queries without first re-embedding via the Mistral
9196
# API. Local rebuilds via build_index.py overwrite this directory.

data/arcwise_plat_full.json

Lines changed: 3805 additions & 0 deletions
Large diffs are not rendered by default.

data/arcwise_plat_sql_only.json

Lines changed: 3569 additions & 0 deletions
Large diffs are not rendered by default.

docs/NEXT_SESSION.md

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@
33
> Один лист, без воды. Берёшь, делаешь, обновляешь `SESSION_HANDOFF.md`,
44
> удаляешь этот файл (или переписываешь под следующий sprint).
55
6-
## Контекст на 2026-05-17 late-night (v10)
7-
8-
- HEAD `d0cd792` + v10 sprint (см. SESSION_HANDOFF.md)
9-
- BIRD Mini-Dev n=200: **80.5% EA** (161/200), per tier 92.5/76.8/67.6 (v10 = v9 + M-Schema retry +1 rescue qid 1525 simple)
10-
- **Live demo:** <https://liovina-nl-sql.hf.space> RUNNING, headline 80.5% / 200
6+
## Контекст на 2026-05-17 next-day (post-corrected-gold)
7+
8+
- HEAD `d0cd792` + corrected-gold sprint (см. SESSION_HANDOFF.md, top section)
9+
- BIRD original gold n=200: **80.5% EA** (161/200), per tier 92.5/76.8/67.6
10+
- Arcwise-Plat-SQL (corrected gold, 199/200 overlap): **67.34%** (134/199), per tier 80.6/65.3/47.1
11+
- Arcwise-Plat full: **61.81%** (123/199), per tier 73.1/60.2/44.1
12+
- Transitions vs BIRD original (sql-only): **+6 gained / -32 lost**
13+
- Methodology doc: `docs/corrected_gold_evaluation.md`
14+
- Rescore artefacts: `scripts/rescore_arcwise.py`, `eval/reports/2026-05-17/arcwise_rescored.json`
15+
- **Live demo:** <https://liovina-nl-sql.hf.space> RUNNING (нет redeploy — rescore чисто на измерении, pred stack unchanged)
1116
- 270 pytest pass, ruff + mypy strict clean (55 source files)
1217
- M-Schema render: `render_m_schema()` в `src/nl_sql/agent/nodes/_support.py`, gated env `NLSQL_M_SCHEMA=1` (default OFF; глобально ломает baseline на ~25pp т.к. парсер теряет null/distinct/flags — использовать ТОЛЬКО на residue retry layer поверх voting stack)
1318
- BIRD SOTA research → `docs/bird_sota_research.md` (top-10 leaderboard, free-tier ceilings, Jin et al. annotation-error finding)
@@ -23,6 +28,22 @@
2328
- shot C: EN→RU toggle
2429
- **Источник: live URL** (`https://liovina-nl-sql.hf.space`), не localhost — memory `feedback_real_product_over_mockup`.
2530

31+
## P1.5 — corrected-gold портфолио narrative (just-closed)
32+
33+
Stress-test на Arcwise-Plat (Jin et al., CIDR/VLDB 2026) выполнен. Три числа
34+
для портфолио (см. `docs/corrected_gold_evaluation.md`):
35+
36+
- 80.5% on published BIRD (leaderboard-comparable)
37+
- 67.34% on Arcwise-Plat-SQL (honest noise-floor)
38+
- +6 qids (672, 1029, 1144, 1247, 1251, 1254) где наш pred правильнее BIRD gold
39+
40+
**Что делать дальше с этой темой:**
41+
- Можно опционально загрузить в HF Space UI «Methodology» tab или README block,
42+
но без чрезмерной детализации (резюме + ссылка на docs/).
43+
- Можно сравнить наши 67.34% с published corrected-gold числами 16 систем из
44+
Jin et al. — но они опубликовали только график (`materials/ex.png`), не
45+
таблицу. Если найдём числа — добавим в `docs/corrected_gold_evaluation.md`.
46+
2647
## P2/P3 — quality push past 80.5% ($0 budget)
2748

2849
Остаток **39 фейлов** (после v10). M-Schema +1 (qid 1525 simple). Кандидаты на дальнейший lift (CHASE-SQL/XiYan technique stack из `docs/bird_sota_research.md`):

docs/SESSION_HANDOFF.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,32 @@
1-
# NL_SQL — Session Handoff (2026-05-17 late-night: 80.5% BIRD via M-Schema XiYan retry)
1+
# NL_SQL — Session Handoff (2026-05-17 next-day: corrected-gold stress test on v10)
2+
3+
> **Tl;dr 2026-05-17 next-day:** v10 stack rescored against Arcwise-Plat
4+
> corrected gold (Jin et al., CIDR/VLDB 2026, arXiv:2601.08778).
5+
>
6+
> - **BIRD original gold:** 80.5% n=200 (unchanged)
7+
> - **Arcwise-Plat-SQL** (SQL-only corrections): **67.34%** (134/199)
8+
> - **Arcwise-Plat full** (SQL + question + evidence + schema): **61.81%** (123/199)
9+
> - Net transitions vs original (sql-only): **+6 gained / -32 lost**.
10+
> GAINED are cases where our pred catches a BIRD annotation bug (qid 672, 1029,
11+
> 1144, 1247, 1251, 1254 — DISTINCT-missing, ASC-vs-DESC, extra-id-column,
12+
> wrong-precedence, unnecessary-joins). LOST are mostly Arcwise tightening
13+
> gold (rtype='S', NOT NULL, DISTINCT, tie-handling).
14+
>
15+
> New portfolio framing — three numbers, not one:
16+
> 1. 80.5% on published BIRD Mini-Dev (leaderboard-comparable)
17+
> 2. 67.34% on Arcwise-Plat-SQL (honest noise-floor estimate)
18+
> 3. +6 auditable cases where our pred beat BIRD's wrong gold (signal)
19+
>
20+
> Methodology + per-qid audit in `docs/corrected_gold_evaluation.md`; rescore
21+
> script `scripts/rescore_arcwise.py`; per-record output
22+
> `eval/reports/2026-05-17/arcwise_rescored.json`.
23+
>
24+
> 270 pytest pass, ruff + mypy strict clean. No HF redeploy needed (rescore is
25+
> measurement-only — pred SQLs and prod stack unchanged).
26+
27+
---
28+
29+
# Previous: 2026-05-17 late-night (80.5% BIRD via M-Schema XiYan retry)
230

331
> **Tl;dr 2026-05-17 late-night (v10, HEAD `d0cd792`):** P0 closed (live HF),
432
> P2.B closed (+1 selective fewshot → 77.5%), P3 cross-Groq (+3 → 79.0%),

docs/bird_sota_research.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,24 @@ Jin et al. ([arXiv:2601.08778](https://arxiv.org/abs/2601.08778), CIDR/VLDB 2026
127127
2. If chasing one more bump: **M-Schema + pairwise Sonnet tournament on residue** (highest-EV combo, ~3 hours, plausible 82%).
128128
3. **Package the result around methodology, not the raw number**: we beat free-tier published ceilings (Arctic 71.83%, CSC 73.67%, XiYan 75.63%) and approach paid SOTA (81.95%) without fine-tuning or paid APIs. That's the headline. Pushing 80% → 82% is marginal; pushing the *story* is high-EV.
129129

130+
### Update 2026-05-17 next-day: recommendation #1 executed
131+
132+
Arcwise-Plat artefacts (`arcwise_plat_sql_only_with_diff.json`, `arcwise_plat_full_with_diff.json`) downloaded from Jin et al.'s repo; 199/200 of our v10 qids overlap.
133+
134+
**Results** (scoring v10 predictions against corrected gold; see `docs/corrected_gold_evaluation.md`):
135+
136+
| Gold variant | EA | Δ vs original |
137+
|---|---:|---:|
138+
| BIRD original (published) | 80.5% (161/200) ||
139+
| Arcwise-Plat-SQL (SQL-only fixes) | **67.34%** (134/199) | **−13.2pp** |
140+
| Arcwise-Plat full (SQL + question + evidence + schema) | **61.81%** (123/199) | **−18.7pp** |
141+
142+
Net transitions vs original (sql_only): **+6 gained / −32 lost**. Gained cases are auditable proof our pred catches BIRD annotation bugs (missing DISTINCT, ASC-vs-DESC, extra-id-column, wrong-precedence, unnecessary-joins). Lost cases mostly reflect Arcwise tightening gold with quality fixes (rtype filters, NOT NULL guards, DISTINCT corrections, tie-handling).
143+
144+
**Implication for portfolio:** publish a triplet, not a single number — "80.5% on published BIRD; 67.34% on Arcwise corrected; +6 cases where our pred beats BIRD's wrong gold". Triplet differentiates from leaderboard-only entries and directly addresses the Jin et al. credibility critique.
145+
146+
Reproduce: `uv run python scripts/rescore_arcwise.py --report eval/reports/2026-05-17/hybrid-vote-critique-selfcon-sonnet-fewshot5-groq4-mschema-v10.json --sql-only data/arcwise_plat_sql_only.json --full data/arcwise_plat_full.json --out eval/reports/2026-05-17/arcwise_rescored.json` (~90s, no LLM calls).
147+
130148
---
131149

132150
## Sources

docs/corrected_gold_evaluation.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Corrected-Gold Evaluation — v10 on Arcwise-Plat
2+
3+
**Date:** 2026-05-17
4+
**Question being answered:** how much of our 80.5% BIRD Mini-Dev score is *real* and how much is BIRD's own annotation noise?
5+
6+
## TL;DR
7+
8+
| Gold variant | EA | Simple | Moderate | Challenging |
9+
|--------------|---:|---:|---:|---:|
10+
| **BIRD original** (published) | **80.5%** (161/200) | 92.5% (62/67) | 76.8% (76/99) | 67.6% (23/34) |
11+
| **Arcwise-Plat-SQL** (SQL-only fixes) | **67.34%** (134/199) | 80.6% (54/67) | 65.3% (64/98) | 47.1% (16/34) |
12+
| **Arcwise-Plat (full)** (SQL + question + evidence + schema) | **61.81%** (123/199) | 73.1% (49/67) | 60.2% (59/98) | 44.1% (15/34) |
13+
14+
Source data:
15+
- Predictions: `eval/reports/2026-05-17/hybrid-vote-critique-selfcon-sonnet-fewshot5-groq4-mschema-v10.json` (HEAD `d0cd792`, our shipped v10 stack).
16+
- Corrected gold: <https://github.com/uiuc-kang-lab/text_to_sql_benchmarks> (Jin et al., CIDR 2026 / VLDB 2026, arXiv:2601.08778). 199/200 of our questions appear in Arcwise-Plat-SQL.
17+
- Re-execution script: `scripts/rescore_arcwise.py`.
18+
- Per-record audit: `eval/reports/2026-05-17/arcwise_rescored.json`.
19+
20+
## Why this matters
21+
22+
Jin et al. found 52.8% of BIRD Mini-Dev questions have annotation errors. They re-evaluated the top 16 leaderboard agents on a 100-case corrected subset and observed EA shifts of **−7% to +31% (relative)** and rank changes of up to ±9 positions. CHESS jumped from 62% to 81% on corrected gold.
23+
24+
Our shift is **−16% relative** (80.5 → 67.34) on the SQL-only correction and **−23% relative** on the full correction. This is honest signal — most of our −13pp absolute drop comes from Arcwise stiffening gold SQLs with quality fixes (rtype filters, NOT NULL, DISTINCT corrections, schema sanitisation) rather than reinterpreting the question.
25+
26+
The fact that we drop more than we gain doesn't mean our system is weaker. It means our prompt stack, like most BIRD-trained agents, **converged on BIRD's wrong-gold patterns** for those cases. That's the whole point of Jin et al.'s critique of the leaderboard.
27+
28+
## Transition analysis (Arcwise-Plat-SQL)
29+
30+
| | Simple | Moderate | Challenging | Total |
31+
|--------|---:|---:|---:|---:|
32+
| **Gained** (Arcwise corrected, our pred now matches) | 2 | 3 | 1 | **6** |
33+
| **Lost** (BIRD gold matched, Arcwise gold does not) | 10 | 14 | 8 | **32** |
34+
| Net | -8 | -11 | -7 | -26 |
35+
36+
(199 scored; 1 v10 qid is not in the Arcwise set.)
37+
38+
### Gained qids — 6 cases where our prediction was *more* correct than BIRD's published gold
39+
40+
| qid | tier | db | What BIRD got wrong | Our pred |
41+
|----:|---|---|---|---|
42+
| 672 | moderate | codebase_community | gold missed `COUNT(DISTINCT ...)` for unique-user count over join | uses DISTINCT |
43+
| 1029 | moderate | european_football_2 | gold sorted `ASC` for "highest" question | `DESC` |
44+
| 1144 | simple | european_football_2 | gold projected `id, finishing, curve` (extra id column) | only `finishing, curve` |
45+
| 1247 | challenging | thrombosis_prediction | gold's WHERE has wrong operator precedence (`A OR B AND C`) | parenthesised |
46+
| 1251 | simple | thrombosis_prediction | gold added an irrelevant Examination JOIN | direct Laboratory query |
47+
| 1254 | challenging | thrombosis_prediction | same family of unnecessary-join | direct query |
48+
49+
These are *signal* — our pipeline produces SQLs that survive expert auditing.
50+
51+
### Lost qids — 32 cases where Arcwise tightened gold and our pred doesn't conform
52+
53+
Loss buckets:
54+
55+
| Bucket | Count | Example |
56+
|---|---:|---|
57+
| Arcwise added `rtype = 'S'` filter on `satscores` | 2 | qid 36, 50 |
58+
| Arcwise added `is not null` quality filter | 1 | qid 48 |
59+
| Arcwise rewrote projection / grouping | most | qid 115 (added `GROUP BY A4`), qid 634 (added aggregate to projection), qid 671 (handles ties with `MIN(date)` instead of `LIMIT 1`) |
60+
| Arcwise materially rewrote semantics | rest | qid 260 (different join structure), qid 352 (added DISTINCT in both numerator/denominator), … |
61+
62+
The "Arcwise rewrote" cases are mostly **legitimate question-interpretation fixes** — e.g. qid 671 asks "who got Autobiographer first?" and BIRD's `LIMIT 1` silently picks one of 12 tied users; Arcwise returns all 12. We're not "less smart" on those cases; we conform to BIRD's interpretation.
63+
64+
## Portfolio framing
65+
66+
Three numbers tell different parts of the story:
67+
68+
1. **80.5% on published BIRD Mini-Dev** — the leaderboard-comparable number. Beats every published free-tier-no-FT system (Arctic 71.83%, CSC 73.67%, XiYan 75.63%) and sits 1.5pp below the #1 paid system (AskData + GPT-4o at 81.95%).
69+
2. **67.34% on Arcwise-Plat-SQL** — the *honest* number after SQL-only annotation fixes. Conservative estimate of real reasoning quality.
70+
3. **+6 cases where our pred catches BIRD's annotation bugs directly** — auditable proof the system reasons rather than memorises.
71+
72+
This triplet differentiates our portfolio from leaderboard-only entries. The hard claim is "80.5% with $0 budget and no fine-tuning"; the credibility claim is "we measured the noise floor and reported it".
73+
74+
## Reproducibility
75+
76+
```bash
77+
# Download corrected gold (commit-locked artifacts in Jin et al.'s repo):
78+
curl -fsSL "https://raw.githubusercontent.com/uiuc-kang-lab/text_to_sql_benchmarks/main/data/arcwise_plat_sql_only_with_diff.json" -o data/arcwise_plat_sql_only.json
79+
curl -fsSL "https://raw.githubusercontent.com/uiuc-kang-lab/text_to_sql_benchmarks/main/data/arcwise_plat_full_with_diff.json" -o data/arcwise_plat_full.json
80+
81+
# Re-execute and re-score:
82+
uv run python scripts/rescore_arcwise.py \
83+
--report eval/reports/2026-05-17/hybrid-vote-critique-selfcon-sonnet-fewshot5-groq4-mschema-v10.json \
84+
--sql-only data/arcwise_plat_sql_only.json \
85+
--full data/arcwise_plat_full.json \
86+
--out eval/reports/2026-05-17/arcwise_rescored.json
87+
```
88+
89+
Run takes ~90 seconds; we cache gold execution via direct SQLite (no LLM calls).

0 commit comments

Comments
 (0)