spider-2.0-eval
Spider 2.0: Evaluating Language Models on Real-World Enterprise Text-to-SQL Workflows — Lei et al. (2024) (arXiv:2411.07763, 2024)
What this evaluates
Evaluates language models' ability to perform real-world enterprise text-to-SQL workflows. It probes agentic reasoning, multi-step data transformation, database schema navigation, and SQL dialect adaptation across complex, long-context tasks.
Datasets
- Spider 2.0 — total 632; splits: test (-1)
- Spider 2.0-lite — total ?; splits: test (-1)
- Spider 2.0-snow — total ?; splits: test (-1)
Metrics
Success Rate (SR) (primary) — range: percent
- Proportion of task instances successfully completed. Calculated as the average of binary scores (0 or 1) from the evaluation script across all instances.
Execution Accuracy (EX) — range: percent
- Proportion of instances where the generated SQL query executes successfully and matches the gold answer. Computed by running the generated SQL against the database and comparing results.
Input / output format
Input: Natural language instruction/question, database schema, codebase, metadata, and documentation context.
Output: SQL query, result table, or database state.
Scoring recipe
def compute_sr(predictions, golds):
scores = []
for pred, gold in zip(predictions, golds):
score = run_evaluation_script(pred, gold) # returns 0 or 1
scores.append(score)
return sum(scores) / len(scores)
def compute_ex(predictions, golds):
scores = []
for pred, gold in zip(predictions, golds):
score = check_execution_match(pred, gold) # returns 0 or 1
scores.append(score)
return sum(scores) / len(scores)
Common pitfalls
- In table-based evaluations, predicted results may contain numerous columns not in the gold answer because questions do not explicitly specify which columns to return. Evaluation scripts ignore irrelevant columns and focus only on essential components.
- Difficulty levels are assigned based on whitespace token counts of gold SQL (<80 Easy, 80-159 Medium, ≥160 Hard), which may not fully capture semantic or structural complexity.
- Models must handle multi-step agentic reasoning and SQL dialect differences (e.g., BigQuery vs. Snowflake), not just single-shot query generation.
Evidence (verbatim from paper)
For Spider 2.0, we use the Success Rate (SR) metric, which measures the proportion of task instances successfully completed. For Spider 2.0-lite and Spider 2.0-snow, the output for each task must be an SQL, we use the widely used metric Execution Accuracy (EX)(Yu et al., 2018; Li et al., 2024b). We employ the execution-based focused evaluation (App.A) to determine the success of each result for Spider 2.0 and assess the accuracy of SQL execution results for Spider 2.0-lite. The evaluation scripts are designed to accept output in the form of strings, tables, or database. For each example, an evaluation script is run for each example, producing a score of either 0 or 1.
Citation
@misc{lei2024spider2.0,
title={Spider 2.0: Evaluating Language Models on Real-World Enterprise Text-to-SQL Workflows},
author={Lei et al. (2024)},
year={2024},
note={arXiv:2411.07763}
}
1---2name: spider-2-0-eval3description: Evaluates language models' ability to perform real-world enterprise text-to-SQL workflows. It probes agentic reasoning, multi-step data transformation, database schema navigation, and SQL dialect adaptation across complex, long-context tasks. Use when the user wants to benchmark on Spider 2.0, Spider 2.0-lite, Spider 2.0-snow, or asks about evaluating this task. Reports Success Rate (SR).4metadata:5 source: https://skillmd.com/skills/qhjqhj00/spider-2-0-eval6 skill_kind: dataset_eval7 source_arxiv: 2411.077638 bibtex_key: lei2024spider2.09 confidence: high10---1112# spider-2.0-eval1314> Spider 2.0: Evaluating Language Models on Real-World Enterprise Text-to-SQL Workflows — Lei et al. (2024) (arXiv:2411.07763, 2024)1516## What this evaluates1718Evaluates language models' ability to perform real-world enterprise text-to-SQL workflows. It probes agentic reasoning, multi-step data transformation, database schema navigation, and SQL dialect adaptation across complex, long-context tasks.1920## Datasets2122- **Spider 2.0** — total 632; splits: test (-1)23- **Spider 2.0-lite** — total ?; splits: test (-1)24- **Spider 2.0-snow** — total ?; splits: test (-1)2526## Metrics2728- `Success Rate (SR)` **(primary)** — range: percent29 - Proportion of task instances successfully completed. Calculated as the average of binary scores (0 or 1) from the evaluation script across all instances.30- `Execution Accuracy (EX)` — range: percent31 - Proportion of instances where the generated SQL query executes successfully and matches the gold answer. Computed by running the generated SQL against the database and comparing results.3233## Input / output format3435**Input**: Natural language instruction/question, database schema, codebase, metadata, and documentation context.3637**Output**: SQL query, result table, or database state.3839## Scoring recipe4041```python42def compute_sr(predictions, golds):43 scores = []44 for pred, gold in zip(predictions, golds):45 score = run_evaluation_script(pred, gold) # returns 0 or 146 scores.append(score)47 return sum(scores) / len(scores)4849def compute_ex(predictions, golds):50 scores = []51 for pred, gold in zip(predictions, golds):52 score = check_execution_match(pred, gold) # returns 0 or 153 scores.append(score)54 return sum(scores) / len(scores)55```5657## Common pitfalls5859- In table-based evaluations, predicted results may contain numerous columns not in the gold answer because questions do not explicitly specify which columns to return. Evaluation scripts ignore irrelevant columns and focus only on essential components.60- Difficulty levels are assigned based on whitespace token counts of gold SQL (<80 Easy, 80-159 Medium, ≥160 Hard), which may not fully capture semantic or structural complexity.61- Models must handle multi-step agentic reasoning and SQL dialect differences (e.g., BigQuery vs. Snowflake), not just single-shot query generation.6263## Evidence (verbatim from paper)6465> For Spider 2.0, we use the Success Rate (SR) metric, which measures the proportion of task instances successfully completed. For Spider 2.0-lite and Spider 2.0-snow, the output for each task must be an SQL, we use the widely used metric Execution Accuracy (EX)(Yu et al., 2018; Li et al., 2024b). We employ the execution-based focused evaluation (App.A) to determine the success of each result for Spider 2.0 and assess the accuracy of SQL execution results for Spider 2.0-lite. The evaluation scripts are designed to accept output in the form of strings, tables, or database. For each example, an evaluation script is run for each example, producing a score of either 0 or 1.6667## Citation6869```bibtex70@misc{lei2024spider2.0,71 title={Spider 2.0: Evaluating Language Models on Real-World Enterprise Text-to-SQL Workflows},72 author={Lei et al. (2024)},73 year={2024},74 note={arXiv:2411.07763}75}76```7778- arXiv: 2411.07763