Archer: A Human-Labeled Text-to-SQL Dataset with Arithmetic, Commonsense and Hypothetical Reasoning

Danna Zheng, Mirella Lapata, Jeff Z. Pan

Introduction

While Large Language Models (LLMs) have become remarkably adept at translating natural language into SQL queries, they often rely on "shortcuts"—mapping keywords to schema names without truly understanding the underlying logic. Benchmarks like Spider, once considered the gold standard, now see state-of-the-art models achieving over 85% accuracy. However, a critical question remains: do these models actually reason, or are they just very good at pattern matching?

Researchers from the University of Edinburgh and Huawei introduce Archer, a bilingual text-to-SQL dataset designed to expose the reasoning gap in current models. Archer is a challenging new benchmark that requires models to perform arithmetic, apply commonsense knowledge, and handle hypothetical "what-if" scenarios.

The Reasoning Gap in Text-to-SQL

Most existing text-to-SQL datasets focus on "schema linking"—the ability to find the right table and column names based on a user's question. However, real-world data analysis often requires more than just fetching data. It requires:

  1. Arithmetic: Calculating differences, percentages, or complex formulas.
  2. Commonsense Knowledge: Using information not explicitly in the database (e.g., knowing that "fuel used" is "distance divided by fuel consumption").
  3. Hypothetical Reasoning: Reasoning about counterfactuals (e.g., "If all cars were 4-cylinder, which would be most efficient?").

Existing benchmarks like Spider purposely exclude questions requiring external knowledge or complex math. Archer fills this gap, providing a rigorous testbed for deep logical reasoning in database interactions.

The Archer Dataset and Methodology

The authors developed Archer through a meticulous six-step human-annotation process involving over 300 hours of labor. They selected 20 diverse databases from the Spider set, ensuring they had enough numeric and temporal data to support complex queries.

The six-step human annotation process for the Archer dataset.

The dataset is bilingual, featuring 1,042 questions in both English and Chinese. Each question is manually paired with a complex SQL query. Archer features 521 unique, highly complex SQL queries across 20 domains such as cars, sports, and academic records. Compared to Spider, Archer queries are significantly longer (averaging ~80 tokens vs. Spider's ~13) and contain many more "value slots" (6.2 vs. 0.9), requiring models to handle much more specific data constraints.

Key Insights and Reasoning Analysis

The "Reasoning Gap" is a stark reality: models that appear "solved" on Spider are essentially blind when faced with Archer. This suggests that current SOTA performance is heavily reliant on the simplicity of the logic required by older benchmarks.

Analysis of model performance across reasoning types.

Analysis of the dataset reveals several key challenges:

  • Hypothetical Reasoning is the "Final Boss": Models struggled most with hypothetical questions. These require the model to temporarily "ignore" the facts in the database and reason based on a provided assumption, a task that current LLMs find incredibly difficult to translate into valid SQL logic.
  • External Knowledge is a Bottleneck: Many Archer questions require formulas or unit conversions (like MPG to liters/100km) that aren't in the schema. Without a way to inject this commonsense knowledge, models simply guess or fail.
  • Bilingual Consistency: The difficulty was consistent across both English and Chinese, proving that the challenge lies in the logic, not the language.

Experimental Results

The results are a wake-up call for the field. GPT-4 + DIN-SQL, which sits at the top of the Spider leaderboard, achieved only 6.73% execution accuracy on the Archer test set. Fine-tuned T5 models (base to 3B parameters) achieved 0% accuracy on the test set when trained only on Archer, likely due to the dataset's high complexity and relatively small size. Even with massive data augmentation from Spider, they only reached ~4.8%.

Conclusion

Archer exposes the limitations of current text-to-SQL systems, showing that high performance on standard benchmarks does not equate to true reasoning capability. By releasing this dataset, the researchers encourage the community to move beyond simple schema mapping toward true computational reasoning. Future work includes expanding the dataset to more languages and developing more robust evaluation metrics for semantic SQL equivalence.

Summary updated

BibTeX
@inproceedings{zheng2024archer,
  author = {Danna Zheng and Mirella Lapata and Jeff Z. Pan},
  title = {{Archer: A Human-Labeled Text-to-SQL Dataset with Arithmetic, Commonsense and Hypothetical Reasoning}},
  booktitle = {EACL},
  year = {2024},
  url = {https://openreview.net/forum?id=oqu5jwTYaY},
}
Figure