File size: 3,531 Bytes
47c0925
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5dec14d
47c0925
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
---
dataset_info:
- config_name: spider
  features:
  - name: db_id
    dtype: string
  - name: question
    dtype: string
  - name: query
    dtype: string
  - name: query_toks
    list: string
  splits:
  - name: train
    num_examples: 7000
  - name: validation
    num_examples: 1034
- config_name: reviewed_trajectories
  features:
  - name: db_id
    dtype: string
  - name: question
    dtype: string
  - name: gold_sql
    dtype: string
  - name: trajectory
    list:
      struct:
      - name: step
        dtype: int32
      - name: thought
        dtype: string
      - name: tool
        dtype: string
      - name: argument
        dtype: string
      - name: observation
        dtype: string
  - name: final_sql
    dtype: string
  - name: test_suite_passed
    dtype: bool
  splits:
  - name: train
    num_examples: 500
- config_name: filtered_rollouts
  features:
  - name: db_id
    dtype: string
  - name: question
    dtype: string
  - name: rollout_sql
    dtype: string
  - name: execution_accuracy
    dtype: float32
  splits:
  - name: train
    num_examples: 1200
configs:
- config_name: spider
  data_files:
  - split: train
    path: spider/train-*
  - split: validation
    path: spider/validation-*
- config_name: reviewed_trajectories
  data_files:
  - split: train
    path: reviewed_trajectories/train-*
- config_name: filtered_rollouts
  data_files:
  - split: train
    path: filtered_rollouts/train-*
---

# AskTheDatabase Trajectories & Evaluation Benchmark 🗄️

> Procedural interactive exploration trajectories and relational benchmark datasets for natural language to SQL translation.

This dataset repository powers the training and empirical evaluation of **AskTheDatabase**, enabling models to move beyond brittle single-turn SQL generation toward verifiable, multi-turn schema exploration.

---

## Configurations & Subsets

### 1. `reviewed_trajectories` (Harness-Zero Distillation)
High-quality multi-turn trajectories curated and verified by K_SQL procedural rules:
- **Tools executed**: `inspect_schema`, `sample_data`, `execute_sql`.
- **Target**: Teaches models to actively inspect table schemas and categorical distinct values before committing to final queries, eliminating schema hallucinations.

```python
from datasets import load_dataset

dataset = load_dataset("chrisjcc/ask-the-database", "reviewed_trajectories")
print(dataset["train"][0]["trajectory"])
```

### 2. `filtered_rollouts` (Condition 3 RLVR Warmup)
Rollout trajectories generated by student models and filtered strictly by execution accuracy and test suite rewards.

```python
dataset = load_dataset("chrisjcc/ask-the-database", "filtered_rollouts")
```

### 3. `spider` (Normalized Relational Benchmark)
Normalized Spider text-to-SQL benchmark train (7,000 samples) and dev (1,034 samples) splits with aligned SQLite database schemas.

```python
dataset = load_dataset("chrisjcc/ask-the-database", "spider")
```

---

## Schema & Features

- `db_id` *(string)*: Unique identifier of the target SQLite database.
- `question` *(string)*: User natural language inquiry.
- `gold_sql` *(string)*: Ground-truth reference SQL query.
- `trajectory` *(list of structs)*: Step-by-step interactive actions, thoughts, and environment observations.
- `test_suite_passed` *(bool)*: Whether the final SQL passes the dual-fixture mutation test suite.

---

## Licensing & Attribution
- Spider benchmark: [Yale LILY Lab](https://yale-lily.github.io/spider) (CC BY-SA 4.0).
- Curated trajectories & fixtures: Apache 2.0.