Multi-Turn Text-to-SQL Self-Play for Unseen Database Generalization

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional text-to-SQL models struggle with multi-turn conversations due to limited training data and the challenge of generalizing to unseen databases, necessitating improved methods for semantic parsing that address complex contextual dependencies and co-reference phenomena.

Innovation Solution

Augment multi-turn text-to-SQL datasets through self-play by generating synthetic interactions using an SQL-to-text model and a text-to-SQL model, filtering based on similarity scores, and re-training the models with filtered interactions to enhance grounding and generalization.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Ease of manufacture

If conventional text-to-SQL models are trained on limited annotated datasets, then training cost is reduced, but generalization ability to unseen databases deteriorates

Engineering Contradiction:
Improvetraining costVSAvoidgeneralization ability
Core Design Contradiction:
Ease of manufactureVSAdaptability or versatility

Solution Approach 1:

The system employs self-play between the text-to-SQL model and SQL-to-text model to automatically generate training interactions without human annotation. The models converse with each other, with the SQL-to-text model generating user utterances based on the text-to-SQL model's SQL queries, creating synthetic training data that improves generalization while avoiding expert annotation costs

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The system changes the parameter of training data diversity by sampling from multiple unseen databases with different schemas during self-play. This exposes the model to varied database structures and contexts, improving its ability to generalize to unseen databases while maintaining automated data generation

Inventive Principle:
Principle #35Parameter changes

2Reliability

If multi-turn dialogue datasets are annotated by trained experts, then data quality improves, but annotation cost and time increase

Engineering Contradiction:
Improvedata qualityVSAvoidannotation time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The system replaces expert annotation with self-service automated generation. The SQL-to-text model automatically generates user utterances that correspond to SQL queries produced by the text-to-SQL model, creating multi-turn dialogue datasets without requiring trained experts to manually annotate conversations

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The system creates synthetic copies of real dialogue patterns by having the SQL-to-text model generate utterances that mirror how users would naturally query databases. These synthetic dialogues replicate the structure and context of real multi-turn conversations while being generated automatically through model interaction

Inventive Principle:
Principle #26Copying

3Productivity

If models are trained on seen databases only, then training efficiency is improved, but ability to handle co-reference and omission in conversations deteriorates

Engineering Contradiction:
Improvetraining efficiencyVSAvoidcontextual dependency handling
Core Design Contradiction:
ProductivityVSAdaptability or versatility

Solution Approach 1:

The system dynamically samples from multiple unseen databases with varying schemas during self-play training. This dynamic exposure to different database structures forces the model to learn contextual dependencies and co-reference resolution in varied contexts, improving its ability to handle conversational phenomena while maintaining training efficiency through automated generation

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The system changes the parameter of database schema diversity by sampling from unseen databases with different structures during self-play. This variation in schema parameters exposes the model to diverse contextual scenarios, improving its ability to resolve co-reference and omission phenomena across different database contexts

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS12541510B1System, method, and computer program for augmenting multi-turn text-to-SQL datasets with self-play
Publication Date: 2026.02.03 TENCENT AMERICA LLC
  • US12541510B1 patent drawing
  • US12541510B1 patent drawing
  • US12541510B1 patent drawing

AI summary

A method, performed by at least one processor, and an apparatus for augmenting multi-turn text-to-SQL datasets is provided. The method and computer program code include generating an SQL-to-text model to converse with a text-to-SQL model, pre-training the SQL-to-text model and the text-to-SQL model based on input training data, sampling an SQL query as a goal query of an interaction between the SQL-to-text model and the text-to-SQL model, generating the interaction based on the goal query, a current utterance, previous utterances in the interaction, an SQL query from a preceding turn of the interaction, and a serialized database, filtering interactions based on a similarity score between the last turn of the interaction and the goal query, and re-training the SQL-to-text model and the text-to-SQL model based on the input training data and the filtered interactions.