Lune

EMNLP2025Top-tier venue

TinySQL: A Progressive Text-to-SQL Dataset for Mechanistic Interpretability Research

Abir Harrasse, Philip Quirke, Clement Neo, Dhruv Nathawani, Luke Marks, Amir Abdullah

Abstract

Mechanistic interpretability research faces a gap between analyzing simple circuits in toy tasks and discovering features in large models. To bridge this gap, we propose text-to-SQL generation as an ideal task to study, as it combines the formal structure of toy tasks with real-world complexity. We introduce TinySQL, a synthetic dataset, progressing from basic to advanced SQL operations, and train models ranging from 33M to 1B parameters to establish a comprehensive testbed for interpretability. We apply multiple complementary interpretability techniques, including Edge Attribution Patching and Sparse Autoencoders, to identify minimal circuits and components supporting SQL generation. We compare circuits for different SQL subskills, evaluating their minimality, reliability, and identifiability. Finally, we conduct a layerwise logit lens analysis to reveal how models compose SQL queries across layers: from intent recognition to schema resolution to structured generation. Our work provides a robust framework for probing and comparing interpretability methods in a structured, progressively complex setting.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

Questions to start from

Lune can draw on

the full paper · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Sparse Autoencoders Find Highly Interpretable Features in Language Models cites Towards Automated Circuit Discovery for Mechanistic Interpretability
  • Sparse Autoencoders Find Highly Interpretable Features in Language Models cites Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 Small
  • Towards Automated Circuit Discovery for Mechanistic Interpretability cites Progress measures for grokking via mechanistic interpretability
  • Towards Automated Circuit Discovery for Mechanistic Interpretability cites Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 Small
  • Progress measures for grokking via mechanistic interpretability cites Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 Small
Builds onCited byLeft to right by year; the more cited, the higher.

Builds on11

  1. Sparse Autoencoders Find Highly Interpretable Features in Language ModelsRobert Huben, Hoagy Cunningham, Logan Riggs Smith, Aidan Ewart et al.ICLR 2024 · 1,072 citations
  2. Towards Automated Circuit Discovery for Mechanistic InterpretabilityArthur Conmy, Augustine N. Mavor-Parker, Aengus Lynch, Stefan Heimersheim et al.NeurIPS 2023 · 861 citations
  3. Text-to-SQL Generation for Question Answering on Electronic Medical RecordsPing Wang, Tian Shi, Chandan K. ReddyWWW 2020 · 148 citations
  4. Progress measures for grokking via mechanistic interpretabilityNeel Nanda, Lawrence Chan, Tom Lieberum, Jess Smith et al.ICLR 2023 · 54 citations
  5. Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 SmallKevin Ro Wang, Alexandre Variengien, Arthur Conmy, Buck Shlegeris et al.ICLR 2023 · 50 citations

Related papers

  1. Developing and Benchmarking Verification Algorithms to Improve Text-to-SQL GenerationTarfah Alrashed, Madhup Sukoon, David R. Karger, Natasha F. NoyVLDB 2026
  2. Addressing Semantic Blind Spots in Text-to-SQL via Component Pre-generation and AST Matching RewardsXingyu Ma, Xin Tian, Lingxiang Wu, Xuepeng Wang et al.ICML 2026
  3. SQL-Checker: Error Detection and Labeling for Text-to-SQL with Interpretability AnalysisXingyu Ma, Xin Tian, Lingxiang Wu, Xuepeng Wang et al.WWW 2026
  4. OmniSQL: Synthesizing High-quality Text-to-SQL Data at ScaleHaoyang Li, Shang Wu, Xiaokang Zhang, Xinmei Huang et al.VLDB 2025 · 90 citations
  5. Learning SQL Like a Human: Structure-Aware Curriculum Learning for Text-to-SQL GenerationXiaohu Zhu, Qian Li, Lizhen Cui, Yuntao DuEMNLP Findings 2025
Dusk over the sea between two cliffs drawn in fine vertical lines