Learning Metadata-Agnostic Representations for Text-to-SQL In-Context Example Selection
Not on the map. Why?
Abstract (arXiv)
In-context learning (ICL) is a powerful paradigm where large language models (LLMs) benefit from task demonstrations added to the prompt. Yet, selecting optimal demonstrations is not trivial, especially for complex or multi-modal tasks where input and output distributions differ. We hypothesize that forming task-specific representations of the input is key. In this paper, we propose a method to align representations of natural language questions and those of SQL queries in a shared embedding space. Our technique, dubbed MARLO - Metadata-Agnostic Representation Learning for Text-tO-SQL - uses query structure to model querying intent without over-indexing on underlying database metadata (i.e. tables, columns, or domain-specific entities of a database referenced in the question or query). This allows MARLO to select examples that are structurally and semantically relevant for the task rather than examples that are spuriously related to a certain domain or question phrasing. When used to retrieve examples based on question similarity, MARLO shows superior performance compared to generic embedding models (on average +2.9%pt. in execution accuracy) on the Spider benchmark. It also outperforms the next best method that masks metadata information by +0.8%pt. in execution accuracy on average, while imposing a significantly lower inference latency.
Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Builds on 40 of its 49 references that are in the map. First posted on arXiv 17 Oct 2024.
Builds on
40 of 49 references.
References · 40
- 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,456
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2022Training language models to follow instructions with human feedbackcited by 15,712
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,160
- 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,049
- 2022Self-Consistency Improves Chain of Thought Reasoning in Language Modelscited by 5,601
- 2020Dense Passage Retrieval for Open-Domain Question Answeringcited by 3,779
- 2023Retrieval-Augmented Generation for Large Language Models: A Surveycited by 2,185
- 2021SimCSE: Simple Contrastive Learning of Sentence Embeddingscited by 2,168
- 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,413
- 2021What Makes Good In-Context Examples for GPT-3?cited by 1,184
- 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,122
28 more
- 2018Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Taskcited by 1,120
- 2023Teaching Large Language Models to Self-Debugcited by 963
- 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 915
- 2022A Survey on In-context Learningcited by 717
- 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 700
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
- 2021Learning To Retrieve Prompts for In-Context Learningcited by 641
- 2023Faith and Fate: Limits of Transformers on Compositionalitycited by 496
- 2023DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correctioncited by 465
- 2021Sentence-T5: Scalable Sentence Encoders from Pre-trained Text-to-Text Modelscited by 462
- 2021Large Dual Encoders Are Generalizable Retrieverscited by 454
- 2023Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluationcited by 378
- 2022Text and Code Embeddings by Contrastive Pre-Trainingcited by 358
- 2023Label Words are Anchors: An Information Flow Perspective for Understanding In-Context Learningcited by 235
- 2017Efficient Natural Language Response Suggestion for Smart Replycited by 228
- 2022Demystifying Prompts in Language Models via Perplexity Estimationcited by 215
- 2019Multilingual Universal Sentence Encoder for Semantic Retrievalcited by 192
- 2023Large Language Models Are Latent Variable Models: Explaining and Finding Good Demonstrations for In-Context Learningcited by 149
- 2020Learning Dense Representations of Phrases at Scalecited by 91
- 2022On the Effect of Pretraining Corpora on In-context Learning by a Large-scale Language Modelcited by 78
- 2023In-Context Learning with Iterative Demonstration Selectioncited by 74
- 2018A Retrieve-and-Edit Framework for Predicting Structured Outputscited by 73
- 2018End-to-End Retrieval in Continuous Spacecited by 46
- 2023Skill-Based Few-Shot Selection for In-Context Learningcited by 46
- 2023Enhancing Few-shot Text-to-SQL Capabilities of Large Language Models: A Study on Prompt Design Strategiescited by 44
- 2022StructCoder: Structure-Aware Transformer for Code Generationcited by 33
- 2022Exploring Dual Encoder Architectures for Question Answeringcited by 19
- 2023Exploring the Relationship between In-Context Learning and Instruction Tuningcited by 14
Built on by
Citing papers per year: 2025: 1; 2026: 1.
2 papers.