Abstract
The Generation-Augmented Pre-training (GAP) framework addresses the critical challenge of bridging the gap between natural language utterances and structured database schemas in text-to-SQL tasks. By leveraging high-quality synthetic data and specialized pre-training objectives, GAP improves the alignment between user intent and database structures. Experimental results on the SPIDER and CRITERIA-TO-SQL benchmarks demonstrate that GAP significantly enhances the performance of state-of-the-art semantic parsers, setting new competitive standards for the field.
Introduction
Converting natural language into SQL queries (text-to-SQL) is a complex "bridge-building" task. A model must simultaneously navigate the nuances of human speech and the rigid, logical structure of a database schema. General-purpose language models often fail at specific "pain points":
- Column Detection: Missing columns explicitly mentioned in the text.
- Value-to-Column Inference: Failing to map specific data values (e.g., "republic") to their corresponding schema headers (e.g.,
GovernmentForm). - Complex Composition: Struggling with nested queries or sophisticated logic like
NOT INclauses.
While previous pre-training methods relied on noisy web table text, GAP introduces a more targeted approach using generative models to create clean, intent-driven synthetic data.
Methodology
The GAP framework consists of two main components: a synthetic data generation pipeline and novel pre-training objectives designed to foster a joint representation of utterances and schemas.
Synthetic Data Generation
To overcome the limitations of noisy crawled data, GAP utilizes fine-tuned BART models as "data factories":
- SQL-to-Text: Transforms 30,000 crawled SQL queries into natural language questions.
- Table-to-Text: Generates questions based on sampled columns and cell values from database tables, ensuring the generated text is grounded in actual schema elements.
Pre-training Objectives
GAP moves beyond simple masked language modeling by adding three targeted tasks:
- Column Prediction (CPred): The model must predict which columns in a schema are relevant to the given utterance.
- Column Recovery (CRec): The model sees a cell value (e.g., "manager") and must "recover" the original column name (
job), teaching it the relationship between data values and headers. - SQL Generation (GenSQL): The model practices generating the actual SQL query during the pre-training phase using a specialized decoder.
Experiments and Results
The framework was evaluated on the SPIDER benchmark, a large-scale cross-domain text-to-SQL dataset, and CRITERIA-TO-SQL, which focuses on technical clinical trial eligibility criteria.
As shown in the results, GAP provides a significant performance boost. When integrated with the RAT-SQL parser, it achieved an exact match accuracy of 0.718 (Dev) and 0.697 (Test) on SPIDER, setting a new state-of-the-art at the time of publication. In the domain-specific CRITERIA-TO-SQL task, GAP improved SQL accuracy from a baseline of 0.142 to 0.327, and execution accuracy to 0.594.
Probing tasks further revealed that the GAP encoder is nearly twice as effective as a standard BART encoder at matching cell values to their correct columns (44.5% vs 23.1%), confirming the success of the explicit alignment objectives.
Conclusion
The GAP framework demonstrates that high-quality synthetic data, designed to mimic user intent, is more effective for pre-training semantic parsers than large-scale noisy web text. By explicitly aligning words and database columns, GAP creates a robust semantic representation that can be easily integrated into existing parsing architectures. Future work will focus on improving the diversity of synthetic data and extending the framework to handle even more complex database structures and temporal reasoning.
Summary updated