mlsanityData to 7 Oct 2026

Is Long Context All You Need? Leveraging LLM's Extended Context for NL2SQL

arXiv 2501.12372 ↗First posted 21 Jan 2025cs.DB cs.AIcited by 30

Not on the map. Why?

Abstract (arXiv)

Large Language Models (LLMs) have demonstrated impressive capabilities across a range of natural language processing tasks. In particular, improvements in reasoning abilities and the expansion of context windows have opened new avenues for leveraging these powerful models. NL2SQL is challenging in that the natural language question is inherently ambiguous, while the SQL generation requires a precise understanding of complex data schema and semantics. One approach to this semantic ambiguous problem is to provide more and sufficient contextual information. In this work, we explore the performance and the latency trade-offs of the extended context window (a.k.a., long context) offered by Google's state-of-the-art LLM (textitgemini-1.5-pro). We study the impact of various contextual information, including column example values, question and SQL query pairs, user-provided hints, SQL documentation, and schema. To the best of our knowledge, this is the first work to study how the extended context window and extra contextual information can help NL2SQL generation with respect to both accuracy and latency cost. We show that long context LLMs are robust and do not get lost in the extended contextual information. Additionally, our long-context NL2SQL pipeline based on Google's textitgemini-pro-1.5 achieve strong performances on various benchmark datasets without finetuning and expensive self-consistency based techniques.

Key facts. Cited by 30 papers in the map (data through 7 Oct 2026). Builds on 29 of its 58 references that are in the map. First posted on arXiv 21 Jan 2025.

Builds on

29 of 58 references.

References · 29

  1. 2023Judging LLM-as-a-Judge with MT-Bench and Chatbot Arenacited by 8,393
  2. 2022Self-Consistency Improves Chain of Thought Reasoning in Language Modelscited by 5,601
  3. 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,383
  4. 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,378
  5. 2018Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Taskcited by 1,120
  6. 2017Seq2SQL: Generating Structured Queries from Natural Language using Reinforcement Learningcited by 679
  7. 2023Can LLM Already Serve as A Database Interface? A BIg Bench for Large-Scale Database Grounded Text-to-SQLscited by 667
  8. 2023DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correctioncited by 465
  9. 2019RAT-SQL: Relation-Aware Schema Encoding and Linking for Text-to-SQL Parserscited by 420
  10. 2020TaBERT: Pretraining for Joint Understanding of Textual and Tabular Datacited by 395
  11. 2023Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluationcited by 378
  12. 2024Long-context LLMs Struggle with Long In-context Learningcited by 285
17 more
  1. 2023RESDSQL: Decoupling Schema Linking and Skeleton Parsing for Text-to-SQLcited by 191
  2. 2024CHESS: Contextual Harnessing for Efficient SQL Synthesiscited by 164
  3. 2023C3: Zero-shot Text-to-SQL with ChatGPTcited by 159
  4. 2023MAC-SQL: A Multi-Agent Collaborative Framework for Text-to-SQLcited by 158
  5. 2022Large Language Models Meet NL2Code: A Surveycited by 135
  6. 2024CHASE-SQL: Multi-Path Reasoning and Preference Optimized Candidate Selection in Text-to-SQLcited by 132
  7. 2021KaggleDBQA: Realistic Evaluation of Text-to-SQL Parserscited by 105
  8. 2024MCS-SQL: Leveraging Multiple Prompts and Multiple-Choice Selection For Text-to-SQL Generationcited by 103
  9. 2023Exploring Chain-of-Thought Style Prompting for Text-to-SQLcited by 69
  10. 2024The Death of Schema Linking? Text-to-SQL in the Age of Well-Reasoned Language Modelscited by 67
  11. 2023Enhancing Few-shot Text-to-SQL Capabilities of Large Language Models: A Study on Prompt Design Strategiescited by 44
  12. 2024BEAVER: An Enterprise Benchmark for Text-to-SQLcited by 37
  13. 2024E-SQL: Direct Schema Linking via Question Enrichment in Text-to-SQLcited by 35
  14. 2023A Benchmark to Understand the Role of Knowledge Graphs on Large Language Model's Accuracy for Question Answering on Enterprise SQL Databasescited by 25
  15. 2023Divide and Prompt: Chain of Thought Prompting for Text-to-SQLcited by 20
  16. 2024Increasing the LLM Accuracy for Question Answering: Ontologies to the Rescue!cited by 18
  17. 2024Blar-SQL: Faster, Stronger, Smaller NL2SQLcited by 4

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2025: 12; 2026: 18.

30 papers.

Sort:

By area:

  1. 2025Agentic Context Engineering: Evolving Contexts for Self-Improving Language Modelscited by 349
  2. 2025How Many Instructions Can LLMs Follow at Once?cited by 17
  3. 2025Think2SQL: Reinforce LLM Reasoning Capabilities for Text2SQLcited by 14
  4. 2025ContextPilot: Fast Long-Context Inference via Context Reusecited by 8
  5. 2025Enhancing Text2Cypher with Schema Filteringcited by 6
  6. 2026Arming Data Agents with Tribal Knowledgecited by 6
  7. 2025Rethinking Schema Linking: A Context-Aware Bidirectional Retrieval Approach for Text-to-SQLcited by 4
  8. 2026Feedback by Design: Understanding and Overcoming User Feedback Barriers in Conversational Agentscited by 4
  9. 2025RetrySQL: text-to-SQL training with retry data for self-correcting query generationcited by 2
  10. 2025High-Fidelity And Complex Test Data Generation For Google SQL Code Generation Servicescited by 1
  11. 2025SteinerSQL: Graph-Guided Mathematical Reasoning for Text-to-SQL Generationcited by 1
  12. 2026On Theoretically-Driven LLM Agents for Multi-Dimensional Discourse Analysiscited by 1
18 more
  1. 2026Both Ends Count! Just How Good are LLM Agents at "Text-to-Big SQL"?cited by 1
  2. 2026Fine-Grained Table Retrieval Through the Lens of Complex Queriescited by 1
  3. 2026AV-SQL: Decomposing Complex Text-to-SQL Queries with Agentic Viewscited by 1
  4. 2026Extending Confidence-Based Text2Cypher with Grammar and Schema Aware Filteringcited by 1
  5. 2025LLM-Powered Proactive Data Systemscited by 0
  6. 2025Effectiveness of Prompt Optimization in NL2SQL Systemscited by 0
  7. 2025Context-Driven Performance Modeling for Causal Inference Operators on Neural Processing Unitscited by 0
  8. 2026FINER-SQL: Boosting Small Language Models for Text-to-SQLcited by 0
  9. 2026Toward Multi-Database Query Reasoning for Text2Cyphercited by 0
  10. 2026VineLM: Trie-Based Fine-Grained Control for Agentic Workflowscited by 0
  11. 2026Database Context Compression for Text-to-SQL on Real-World Large Databasescited by 0
  12. 2026STRATOS: Bridging the Symbolic-to-Numeric Gap in Spatio-Temporal Text-to-SQL for Meteorological Datacited by 0
  13. 2026Benchmarking Text-to-SQL under Role-Based Access Controlcited by 0
  14. 2026DexterSQL: Deep Schema Exploration and Rule-based Correction for Text-to-SQL Generationcited by 0
  15. 2026SchemaLink: An Intelligent Web Editor for LinkML Schema Curationcited by 0
  16. 2026DualSQL: Text-to-SQL with Multi-Agent Reinforcement Learningcited by 0
  17. 2026BudgetSchemaBench: A Budget-Swept Diagnostic for Schema Context in Text-to-SQLcited by 0
  18. 2026Argo-Bench: Evaluating Data Agents on Enterprise-Scale Workflowscited by 0

Similar, not cited

Close in wording, no citation either way

  1. 2024Can Long-Context Language Models Subsume Retrieval, RAG, SQL, and More?
  2. 2024Can Language Models Enable In-Context Database?
  3. 2024Evaluating and Enhancing LLMs for Multi-turn Text-to-SQL with Multiple Question Types
  4. 2025LLMSQL: Upgrading WikiSQL for the LLM Era of Text-to-SQL
  5. 2024Open-SQL Framework: Enhancing Text-to-SQL on Open-source Large Language Models
  6. 2024From Natural Language to SQL: Review of LLM-based Text-to-SQL Systems
  7. 2023Retrieval meets Long Context Large Language Models
  8. 2025Readme_AI: Dynamic Context Construction for Large Language Models