NL-to-SQL Training Data Augmentation for Aggregation and Sorting
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Deep-learning approaches for converting natural language queries to SQL queries require large amounts of labeled training data, struggle with generalization across domains, and are computationally intensive, particularly for operations like aggregation and sorting, leading to suboptimal accuracy.
Innovation Solution
A data augmentation process is employed to automatically generate additional training examples, using template-based and keyword-based strategies, enriching the training set with relevant examples tailored to specific database operations, improving model robustness and accuracy.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If deep-learning approaches are used to convert natural language queries to SQL queries, then the system can understand and process natural language input, but the requirement for large amounts of labeled training data increases significantly
Solution Approach 1:
The patent applies preliminary action by performing data augmentation before the main training process. Synthetic training examples are generated in advance using template-based and keyword-based strategies, creating an expanded training dataset that incorporates various database operations like aggregation and sorting. This preliminary data preparation reduces the need for manually collected labeled data while maintaining model performance.
Solution Approach 2:
The patent uses copying by creating synthetic copies of existing training examples through template substitution and keyword replacement. Existing natural language-SQL pairs are replicated and modified by inserting different keywords and templates, generating new training examples that preserve the original structure while varying the content. This copying approach efficiently expands the training dataset without requiring new manual annotations.
2Measurement precision
If deep-learning models are trained for specific database operations like aggregation and sorting, then operational accuracy improves, but computational resources and training time increase
Solution Approach 1:
The patent applies local quality by focusing training data augmentation on specific database operations that require higher accuracy, such as aggregation and sorting. Instead of uniformly treating all query types, the system identifies operations where precision is critical and applies targeted keyword-based and template-based augmentation strategies specifically for these operations. This localized approach improves accuracy for critical operations without unnecessarily increasing computational burden across the entire model.
Solution Approach 2:
The patent uses parameter changes by modifying training data characteristics rather than changing the model architecture or training algorithm. The data augmentation process alters parameters such as keyword variations, template structures, and example diversity in the training set. These parameter changes in the input data enable the model to learn better representations for specific operations like aggregation and sorting, improving accuracy without requiring changes to the computational model itself.
3Adaptability or versatility
If more diverse training examples are generated to improve model generalization, then performance across different domains improves, but the complexity of the data generation process increases
Solution Approach 1:
The patent applies segmentation by dividing the data generation process into distinct modules: template-based generation and keyword-based generation. Each module handles specific aspects of diversity - templates provide structural variety while keywords provide lexical variety. This segmentation allows the system to achieve comprehensive domain generalization through coordinated simple operations rather than a single complex data generation process, making the overall system more manageable and maintainable.
Data Source
AI summary
Techniques are disclosed for augmenting training data for training a machine learning model to generate database queries. Training data comprising a first training example comprising a first natural language utterance, a logical form for the first natural language utterance, and associated first metadata is obtained. From the first training example, a template utterance is generated. A second natural language utterance is generated by filling slots in the template utterance based on a database schema and database values. Updated metadata is produced based on the first metadata and the second natural language utterance. A second training example is generated, comprising the second natural language utterance, the logical form for the first natural language utterance, and the updated metadata. The training data is augmented by adding the second training example. A machine learning model is trained to generate a database query comprising the database operation using the augmented training data set.


