Text-to-SQL AI Training with Synthetic Data for Natural Language Queries

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Interacting with SQL databases can be challenging due to complex queries and database designs, requiring users to have programming knowledge and database architecture understanding, making it difficult for non-technical users to effectively retrieve data.

Innovation Solution

A computing system utilizing a generative artificial intelligence chat system that includes a SQL Large Language Model (LLM) trained on synthetic and preference datasets to generate and execute SQL code from natural language queries, providing a user-friendly interface for data retrieval.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Ease of operation

If users interact with SQL databases using traditional query methods, then data retrieval accuracy is maintained, but user accessibility and ease of operation deteriorate due to requiring programming knowledge and database architecture understanding

Engineering Contradiction:
Improveuser accessibilityVSAvoidquery complexity
Core Design Contradiction:
Ease of operationVSDevice complexity

Solution Approach 1:

The patent introduces a generative AI model as an intermediary between users and SQL databases. The AI model translates natural language queries into SQL code, eliminating the need for users to directly interact with complex SQL syntax while maintaining accurate data retrieval. This mediator approach resolves the contradiction by simplifying the user interface without compromising the underlying database query complexity.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent replaces the mechanical system of manual SQL query writing with an AI-based automated code generation system. Instead of requiring users to mechanically construct SQL queries based on database schema knowledge, the system uses generative AI to automatically translate natural language into executable SQL, thereby improving ease of operation while maintaining query accuracy.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

2Measurement precision

If the system provides detailed database schema information and metadata, then query accuracy is improved, but the complexity of interacting with the database increases for users

Engineering Contradiction:
Improvequery accuracyVSAvoidinteraction simplicity
Core Design Contradiction:
Measurement precisionVSEase of operation

Solution Approach 1:

The AI model serves as an intermediary that internally processes and understands detailed database schema information and metadata without exposing this complexity to the user. The system maintains access to comprehensive schema details for accurate query generation while presenting a simplified natural language interface to users, thus resolving the contradiction between query accuracy and interaction simplicity.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent segments the database interaction into two distinct layers: an internal layer that handles complex schema parsing, metadata management, and SQL generation, and an external layer that provides simple natural language querying. This segmentation allows the system to maintain high query accuracy through detailed schema understanding while keeping user interaction simple and accessible.

Inventive Principle:
Principle #1Segmentation

3Adaptability or versatility

If the system uses synthetic datasets for training the AI model, then training data diversity is improved, but the complexity of data preparation and processing increases

Engineering Contradiction:
Improvetraining data diversityVSAvoiddata processing complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The system employs self-service data generation where the AI model itself generates synthetic training data by querying actual databases and transforming real query patterns into synthetic examples. This self-service approach improves training data diversity by creating varied training scenarios while reducing the need for manual data preparation, thereby managing the complexity of data processing through automation.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The patent implements preliminary action by pre-processing and curating training data through automated synthesis before the main training process. The system generates synthetic datasets in advance by querying existing databases and transforming them into training examples, which simplifies the overall data preparation process while ensuring diverse and high-quality training data for the AI model.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS20260044717A1Computing systems and methods for a text-to-SQL generative artificial intelligence training and chat
Publication Date: 2026.02.12 THE TORONTO DOMINION BANK
  • US20260044717A1 patent drawing
  • US20260044717A1 patent drawing
  • US20260044717A1 patent drawing

AI summary

Systems and methods are provided for executing a structured query language (SQL) large language model (LLM). A computing system includes a SQL LLM stored in memory and executable by the processor. The processor accesses a SQL dataset with natural language questions, metadata, and sets of SQL code. It generates a synthetic SQL dataset with synthetic natural language questions, metadata, and sets of SQL code. The synthetic and original datasets are combined to create a combined SQL dataset. The SQL LLM is then trained on this combined SQL dataset to output a trained SQL LLM.