SQL-to-Text Generation with Weighted-AST Few-Shot Prompting
Sriom Chakrabarti, Chuangtao Ma, Arijit Khan, Sebastian Link

TL;DR
This paper introduces Weighted-AST retrieval with prompting, a novel method that improves SQL-to-text generation by integrating structural query representations and LLM prompting, leading to more accurate and faithful natural language descriptions of SQL queries.
Contribution
The work proposes a structure-aware prompting technique using Weighted-AST retrieval to enhance the semantic fidelity of SQL-to-text generation with large language models.
Findings
Outperforms baselines by up to +17.24% in execution accuracy
Achieves higher exact match and semantic fidelity in human evaluations
Maintains competitive runtime performance
Abstract
SQL-to-Text generation aims at translating structured SQL queries into natural language descriptions, thereby facilitating comprehension of complex database operations for non-technical users. Although large language models (LLMs) have recently demonstrated promising results, current methods often fail to maintain the exact semantics of SQL queries, particularly when there are multiple possible correct phrasings. To address this problem, our work proposes Weighted-AST retrieval with prompting, an architecture that integrates structural query representations and LLM prompting. This method retrieves semantically relevant examples as few-shot prompts using a similarity metric based on an Abstract Syntax Tree (AST) with learned feature weights. Our structure-aware prompting technique ensures that generated descriptions are both fluent and faithful to the original query logic. Numerous…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsNatural Language Processing Techniques · Topic Modeling · Web Data Mining and Analysis
