|
Download README.md from sqlcf-lexsi/counterfactual-sql-data: direct link, hf CLI and curl.
- Browser
- Download file 4.34 kB
-
https://huggingface.co/datasets/sqlcf-lexsi/counterfactual-sql-data/resolve/main/README.md
- Command line
-
hf download hf://datasets/sqlcf-lexsi/counterfactual-sql-data/README.md
-
curl -L -o README.md https://huggingface.co/datasets/sqlcf-lexsi/counterfactual-sql-data/resolve/main/README.md
4.34 kB
metadata
license: cc-by-nc-4.0
language:
- en
tags:
- text-to-sql
- reward-modeling
- grpo
- counterfactual
- sqlite
- lexsi-hackathon
pretty_name: Counterfactual-DB rewards for SQL agents
Counterfactual-DB rewards for SQL agents: data, results and rollout logs
Lexsi Labs AI Safety & Alignment Hackathon, Track 3 (PS #6 data and database agents + #9 reward design and reward-hacking defences), team Teen_khapeetars: Shreshth Rai (lead, @hi-phi-r25i), Rishii Kumar Singh (@LogicPalette), Aksh Aggarwal (@AkshAgg).
Collections: models, data · Demo · Data · Adapters: SFT, GRPO-B, GRPO-C · Code · Write-up
Every number in the write-up is re-derived from these files by python verify_all.py in the code repo.
import tarfile
from huggingface_hub import snapshot_download
d = snapshot_download("sqlcf-lexsi/counterfactual-sql-data", repo_type="dataset")
for split in ("audit", "train", "test"):
tarfile.open(f"{d}/{split}/dbs.tar.gz").extractall(f"{d}/{split}") # SQLite DBs next to items.jsonl
| Path | What |
|---|---|
{audit,train,test}/items.jsonl |
Questions, gold SQL, per-item DB paths and gold results on the original + counterfactual DBs |
{audit,train,test}/dbs.tar.gz |
The SQLite DBs (original and counterfactual copies); extract in place |
train/grpo_items.jsonl |
GRPO prompts (SFT pass rate in (0,1); 3 templates held out of SFT) |
sft.jsonl, sft_all_templates.jsonl |
Scripted oracle trajectories for the SFT warm start |
results/e0_*.json, results/e1_*.json, figure*.png |
Reward audit (FP/FN per reward) and blind rate vs DB size |
results/traj_<model>.jsonl |
Test trajectories: base, sft, sft_ho, GRPO B, GRPO C, Command A, sft_distil (E9), dpo_std / dpo_cf (E10) |
results/e4_eval.json |
Verified / single-DB accuracy, silent error, smuggling, pass^k, McNemar, bootstrap |
results/a2_spider_lucky.json |
E6: Spider-dev lucky passes of 8 published systems (question indices only; predictions from bossben/ESMp, DBs from Zhong et al. 2020) |
results/a3_skyrl_audit.json |
E7: SkyRL-SQL reward audit on the E0 candidates |
results/a4_selfconsistency.json |
E8: gold-free majority vote and shaky-answer flag on the test trajectories |
results/teacher_command_a.jsonl, results/d1_teacher_filter.json |
E9: Command A plan + SQL on the 353 SFT train items; lucky answers a single-DB filter would keep |
sft_distil.jsonl |
E9: the SFT trajectories with the 211 counterfactual-verified teacher endings swapped in (traj_sft_distil is the resulting model) |
runs/traj_sft_ho_grpoprompts.jsonl |
sft_ho's 2670 rollouts on the 445 GRPO prompts (G = 6, T = 1.0): the source of the E10 DPO pairs, replayed by E11 and E12 |
dpo_std.jsonl, dpo_cf.jsonl, results/dpo_pairs.json |
E10: DPO pairs from those rollouts, single-DB vs counterfactual labels (traj_dpo_<std,cf> are the resulting models) |
results/e11_partial_credit.json |
E11: partial-credit rewards audited like E0 and replayed on the GRPO rollouts |
results/e12_period_copies.json |
E12: period-edge copies vs date-filter bugs, and replayed on real answers (the copies are in <split>/dbs/*/period/) |
runs/grpo_<B,C>_rewards.jsonl |
Every GRPO rollout: final SQL, reward, per-DB pass vector |
runs/grpo_<B,C>/ |
lexsi_provenance.json, training config and stats |
Synthetic e-commerce data from a seeded generator; no personal data. Rollouts contain outputs of Tiny Aya Global (CC-BY-NC-4.0) and Cohere Command A, hence the non-commercial licence.