Schema-Agnostic Text-to-SQL Training Data Generation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing deep learning models for Text-to-SQL face challenges in maintaining accuracy when transitioning between different database schemas, requiring extensive computing resources for individual training and lacking sufficient training coverage.

Innovation Solution

A method and system for generating training data that includes selecting values, adverbs, and adjectives from a database schema, determining join paths, and creating structured query language patterns to train a text-to-SQL model using a first artificial neural network, reducing the need for individual schema-specific training.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If deep learning models are trained individually for different database schemas, then accuracy for specific schemas is improved, but computing resource usage increases significantly

Engineering Contradiction:
ImproveSQL query generation accuracyVSAvoidcomputing resource usage
Core Design Contradiction:
Measurement precisionVSUse of energy by moving object

Solution Approach 1:

The patent creates a universal training data generation system that produces schema-agnostic training examples. The system generates synthetic database schemas and corresponding SQL queries using templates that can be applied across different database types, allowing a single model to serve multiple schema-specific functions without requiring separate training processes for each schema.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Solution Approach 2:

The system dynamically generates diverse training data by varying parameters such as schema structure, table relationships, and query patterns. By changing these parameters systematically, the model learns to adapt to different schemas during training, reducing the need for retraining while maintaining accuracy across varying database configurations.

Inventive Principle:
Principle #35Parameter changes

2Measurement precision

If deep learning models are trained individually for different database schemas, then schema-specific accuracy is improved, but training time increases

Engineering Contradiction:
ImproveSQL query generation accuracyVSAvoidtraining time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The system performs preliminary action by pre-generating a comprehensive corpus of synthetic training data that covers multiple database schemas and query patterns. This pre-generated training data is then used to train a single model that can handle various schemas, eliminating the need for repeated training processes and significantly reducing overall training time.

Inventive Principle:
Principle #10Preliminary action

3Measurement precision

If extensive computing resources are allocated for individual schema training, then model accuracy is improved, but system complexity increases

Engineering Contradiction:
ImproveSQL query generation accuracyVSAvoidtraining system complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The system uses copying by creating synthetic replicas of database schemas through template-based generation. Instead of training separate models on actual diverse schemas, the system generates copied representations of various schemas using predefined templates, which simplifies the training process while maintaining the diversity needed for accurate query generation across different real schemas.

Inventive Principle:
Principle #26Copying

4Productivity

If training data coverage is limited, then training speed is maintained, but model adaptability to different schemas deteriorates

Engineering Contradiction:
Improvetraining efficiencyVSAvoidschema adaptability
Core Design Contradiction:
ProductivityVSAdaptability or versatility

Solution Approach 1:

The training data generation system is dynamic, automatically creating diverse schema configurations and query patterns on demand. Rather than relying on static, limited training datasets, the system dynamically generates training examples that adapt to cover various schema types, improving model adaptability without requiring proportionally more training resources.

Inventive Principle:
Principle #15Dynamics

Data Source

PatentUS12393584B2Generating training data for a machine learning model that performs text-to-SQL
Publication Date: 2025.08.19 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US12393584B2 patent drawing
  • US12393584B2 patent drawing
  • US12393584B2 patent drawing

AI summary

A set of values can be selected from a plurality of fields of a table in a database. At least one adverb or adjective can be selected for the set of values. Join paths for values in the set of values can be determined. A structured query language pattern can be determined based, at least in part, on at least one value in the set of values, the at least one adverb or adjective for the set of values, and the join paths for the set of values. The structured query language pattern can be stored to first training data configured, at least in part, for use in machine learning to train a text-to-SQL model, the text-to-SQL model comprising a first artificial neural network and configured to convert first natural language text to a first structured query language query.