From Words to Code: Harnessing Data for Program Synthesis from Natural Language
Not on the map. Why?
Abstract (arXiv)
Creating programs to correctly manipulate data is a difficult task, as the underlying programming languages and APIs can be challenging to learn for many users who are not skilled programmers. Large language models (LLMs) demonstrate remarkable potential for generating code from natural language, but in the data manipulation domain, apart from the natural language (NL) description of the intended task, we also have the dataset on which the task is to be performed, or the "data context". Existing approaches have utilized data context in a limited way by simply adding relevant information from the input data into the prompts sent to the LLM. In this work, we utilize the available input data to execute the candidate programs generated by the LLMs and gather their outputs. We introduce semantic reranking, a technique to rerank the programs generated by LLMs based on three signals coming the program outputs: (a) semantic filtering and well-formedness based score tuning: do programs even generate well-formed outputs, (b) semantic interleaving: how do the outputs from different candidates compare to each other, and (c) output-based score tuning: how do the outputs compare to outputs predicted for the same task. We provide theoretical justification for semantic interleaving. We also introduce temperature mixing, where we combine samples generated by LLMs using both high and low temperatures. We extensively evaluate our approach in three domains, namely databases (SQL), data science (Pandas) and business intelligence (Excel's Power Query M) on a variety of new and existing benchmarks. We observe substantial gains across domains, with improvements of up to 45% in top-1 accuracy and 34% in top-3 accuracy.
Key facts. Cited by 11 papers in the map (data through 7 Oct 2026). Builds on 41 of its 63 references that are in the map. First posted on arXiv 2 May 2023.
Builds on
41 of 63 references.
References · 41
- 2017Attention Is All You Needcited by 59,932
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2021Prefix-Tuning: Optimizing Continuous Prompts for Generationcited by 3,878
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2022Competition-Level Code Generation with AlphaCodecited by 1,427
- 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,413
- 2021Calibrate Before Use: Improving Few-Shot Performance of Language Modelscited by 1,371
- 2020Making Pre-trained Language Models Better Few-shot Learnerscited by 1,255
- 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
29 more
- 2018Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Taskcited by 1,120
- 2015A Diversity-Promoting Objective Function for Neural Conversation Modelscited by 1,068
- 2022Program of Thoughts Prompting: Disentangling Computation from Reasoning for Numerical Reasoning Taskscited by 1,057
- 2023Teaching Large Language Models to Self-Debugcited by 963
- 2019How Can We Know What Language Models Know?cited by 953
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
- 2022A Survey on In-context Learningcited by 717
- 2020It's Not Just Size That Matters: Small Language Models Are Also Few-Shot Learnerscited by 668
- 2023DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correctioncited by 465
- 2021PICARD: Parsing Incrementally for Constrained Auto-Regressive Decoding from Language Modelscited by 402
- 2023How Good Are GPT Models at Machine Translation? A Comprehensive Evaluationcited by 344
- 2021Factual Probing Is [MASK]: Learning vs. Learning to Recallcited by 291
- 2023LEVER: Learning to Verify Language-to-Code Generation with Executioncited by 228
- 2023RESDSQL: Decoupling Schema Linking and Skeleton Parsing for Text-to-SQLcited by 191
- 2022Can Foundation Models Wrangle Your Data?cited by 173
- 2022Synchromesh: Reliable code generation from pre-trained language modelscited by 156
- 2022Ask Me Anything: A simple strategy for prompting language modelscited by 155
- 2020Compositional Generalization and Natural Language Variation: Can a Semantic Parsing Approach Handle Both?cited by 147
- 2021Cutting Down on Prompts and Parameters: Simple Few-Shot Learning with Language Modelscited by 139
- 2022Natural Language to Code Translation with Executioncited by 122
- 2021LGESQL: Line Graph Enhanced Text-to-SQL Model with Mixed Local and Non-Local Relationscited by 119
- 2023A comprehensive evaluation of ChatGPT's zero-shot Text-to-SQL capabilitycited by 118
- 2021KaggleDBQA: Realistic Evaluation of Text-to-SQL Parserscited by 105
- 2021Jigsaw: Large Language Models meet Program Synthesiscited by 103
- 2023Language Models Enable Simple Systems for Generating Structured Views of Heterogeneous Data Lakescited by 101
- 2022Coder Reviewer Reranking for Code Generationcited by 83
- 2023"What It Wants Me To Say": Bridging the Abstraction Gap Between End-User Programmers and Code-Generating Large Language Modelscited by 48
- 2020Optimizing Deeper Transformers on Small Datasetscited by 41
- 2023Generate, Transform, Answer: Question Specific Tool Synthesis for Tabular Datacited by 11
Built on by
Citing papers per year: 2023: 5; 2024: 4; 2025: 2.
11 papers.
- 2023Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluationcited by 378
- 2023LLM-SQL-Solver: Can LLMs Determine SQL Equivalence?cited by 10
- 2024Laurel: Unblocking Automated Verification with Large Language Modelscited by 10
- 2024TransitGPT: A Generative AI-based framework for interacting with GTFS data using Large Language Modelscited by 5
- 2023Will Code Remain a Relevant User Interface for End-User Programming with Generative AI Models?cited by 3
- 2024Contextualized Data-Wrangling Code Generation in Computational Notebookscited by 3
- 2025Inferring multiple helper Dafny assertions with LLMscited by 3
- 2023ChatGPT for GTFS: Benchmarking LLMs on GTFS Understanding and Retrievalcited by 1
- 2023TSTR: Target Similarity Tuning Meets the Real Worldcited by 1
- 2024An Empirical Study of Validating Synthetic Data for Formula Generationcited by 0
- 2025Tabularis Formatus: Predictive Formatting for Tablescited by 0
- 2025Inferring multiple helper Dafny assertions with LLMs31 Oct 2025
- 2025Tabularis Formatus: Predictive Formatting for Tables14 Aug 2025
- 2024TransitGPT: A Generative AI-based framework for interacting with GTFS data using Large Language Models7 Dec 2024
- 2024Contextualized Data-Wrangling Code Generation in Computational Notebooks20 Sep 2024
- 2024An Empirical Study of Validating Synthetic Data for Formula Generation15 Jul 2024
- 2024Laurel: Unblocking Automated Verification with Large Language Models27 May 2024
- 2023LLM-SQL-Solver: Can LLMs Determine SQL Equivalence?16 Dec 2023
- 2023Will Code Remain a Relevant User Interface for End-User Programming with Generative AI Models?1 Nov 2023
- 2023TSTR: Target Similarity Tuning Meets the Real World26 Oct 2023
- 2023Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluation29 Aug 2023
- 2023ChatGPT for GTFS: Benchmarking LLMs on GTFS Understanding and Retrieval4 Aug 2023