mlsanityData to 7 Oct 2026

Reliable Answers for Recurring Questions: Boosting Text-to-SQL Accuracy with Template Constrained Decoding

arXiv 2604.28028 ↗First posted 30 Apr 2026cs.CL cs.AI cs.DBcited by 0

Not on the map. Why?

Abstract (arXiv)

Large language models (LLMs) have revolutionized Text-to-SQL generation, allowing users to query structured data using natural language with growing ease. Yet, real-world deployment remains challenging, especially in complex or unseen schemas, due to inconsistent accuracy and the risk of generating invalid SQL. We introduce Template Constrained Decoding (TeCoD), a system that addresses these limitations by harnessing the recurrence of query patterns in labeled workloads. TeCoD converts historical NL-SQL pairs into reusable templates and introduces a robust template selection module that uses a fine-tuned natural language inference model to match or reject queries efficiently. Once the template is selected, TeCoD enforces it during SQL generation through grammar-constrained decoding, implemented via a novel partitioned strategy that ensures both syntactic validity and efficiency. Together, these components yield up to 36% higher execution accuracy than in-context learning (ICL) and 2.2x lower latency on matched queries.

Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 28 of its 52 references that are in the map. First posted on arXiv 30 Apr 2026.

Builds on

28 of 52 references.

References · 28

  1. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  2. 2020Language Models are Few-Shot Learnerscited by 32,199
  3. 2024The Llama 3 Herd of Modelscited by 14,192
  4. 2019DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lightercited by 4,243
  5. 2025Qwen3 Embedding: Advancing Text Embedding and Reranking Through Foundation Modelscited by 1,175
  6. 2018Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Taskcited by 1,120
  7. 2023Can LLM Already Serve as A Database Interface? A BIg Bench for Large-Scale Database Grounded Text-to-SQLscited by 667
  8. 2024NV-Embed: Improved Techniques for Training LLMs as Generalist Embedding Modelscited by 466
  9. 2023DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correctioncited by 465
  10. 2019RAT-SQL: Relation-Aware Schema Encoding and Linking for Text-to-SQL Parserscited by 420
  11. 2021PICARD: Parsing Incrementally for Constrained Auto-Regressive Decoding from Language Modelscited by 402
  12. 2023Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluationcited by 378
16 more
  1. 2023RESDSQL: Decoupling Schema Linking and Skeleton Parsing for Text-to-SQLcited by 191
  2. 2023Grammar-Constrained Decoding for Structured NLP Tasks without Finetuningcited by 186
  3. 2024CodeS: Towards Building Open-source Language Models for Text-to-SQLcited by 183
  4. 2023MAC-SQL: A Multi-Agent Collaborative Framework for Text-to-SQLcited by 158
  5. 2024CHASE-SQL: Multi-Path Reasoning and Preference Optimized Candidate Selection in Text-to-SQLcited by 132
  6. 2024MCS-SQL: Leveraging Multiple Prompts and Multiple-Choice Selection For Text-to-SQL Generationcited by 103
  7. 2024Guiding LLMs The Right Way: Fast, Non-Invasive Constrained Generationcited by 99
  8. 2023ACT-SQL: In-Context Learning for Text-to-SQL with Automatically-Generated Chain-of-Thoughtcited by 65
  9. 2025OpenSearch-SQL: Enhancing Text-to-SQL with Dynamic Few-shot and Consistency Alignmentcited by 51
  10. 2021Learning to Synthesize Data for Semantic Parsingcited by 41
  11. 2025Arctic-Text2SQL-R1: Simple Rewards, Strong Reasoning in Text-to-SQLcited by 38
  12. 2023Benchmarking and Improving Text-to-SQL Generation under Ambiguitycited by 31
  13. 2023CRUSH4SQL: Collective Retrieval Using Schema Hallucination For Text2SQLcited by 23
  14. 2025ExCoT: Optimizing Reasoning for Text-to-SQL with Execution Feedbackcited by 23
  15. 2022Natural Language Interfaces to Datacited by 14
  16. 2022Diverse Parallel Data Synthesis for Cross-Database Adaptation of Text-to-SQL Parserscited by 7

Built on by

Not cited yet.