Learn from Yesterday: A Semi-Supervised Continual Learning Method for Supervision-Limited Text-to-SQL Task Streams

Yongrui Chen, Xinnan Guo, Tongtong Wu, Guilin Qi, Yang Li, Yang Dong · DOI

Introduction

Translating natural language questions into executable SQL queries—the Text-to-SQL task—is a cornerstone of modern data interaction. However, real-world applications face a dual challenge: data scarcity and catastrophic forgetting. Annotating SQL labels for new databases is prohibitively expensive, leading to overfitting on small datasets. Simultaneously, fine-tuning models on new domains often causes them to lose proficiency in previously learned ones.

Existing research typically addresses these issues in isolation through Semi-Supervised Learning (SSL) or Continual Learning (CL). This paper introduces SFNET (Soft Fusion Network), a framework that treats these challenges as symbiotic, leveraging past knowledge to improve pseudo-labeling for new tasks while using those labels to reinforce memory of previous tasks.

Overview of the Text-to-SQL task stream with prompt-based augmentation and memory replay.

The SFNET Framework

SFNET employs a specialized Teacher-Student architecture designed to balance immediate task performance with long-term knowledge retention. The process is divided into two distinct roles:

  • The Teacher: This component focuses on the current task. It utilizes self-training to generate pseudo-labels for unlabeled data, maximizing performance on the new database schema.
  • The Student: Responsible for the entire task stream, the Student learns from the Teacher’s pseudo-labels and maintains performance across all previously seen tasks by replaying a small subset of past instances, a technique known as Episodic Memory Replay (EMR).

Dual Sampling Strategy

The core innovation of SFNET lies in its "dual sampling" mechanism, which optimizes the data flow between the Teacher and Student:

  1. Prompt Sampling (Teacher-oriented): The model identifies structurally similar instances from past tasks to serve as "prompts." This structural similarity is determined by hashing SQL keywords and schema patterns rather than raw text, allowing the model to transfer logic between seemingly unrelated domains (e.g., applying the logic of a "perpetrator" query to a "track athlete" database).
  2. Review Sampling (Student-oriented): To prevent forgetting, the model selects a diverse mix of labeled and high-quality pseudo-labeled instances to store in a permanent memory buffer, creating a representative "review sheet" for the Student.
The SFNET architecture featuring the Teacher-Student framework and dual sampling strategy.

Experimental Setup and Results

The researchers evaluated SFNET using task-stream adaptations of the WikiSQL and Spider benchmarks. Tasks were divided by database domain, with supervised data limited to fewer than 500 instances per task to simulate real-world constraints. The base architecture utilized a GRAPPA encoder and an LSTM decoder.

Key Performance Metrics

  • Accuracy: On the complex Spider dataset, SFNET achieved an average accuracy (ACCa) of 56.0%, outperforming CL-only (53.4%) and SSL-only (49.6%) baselines.
  • Retention: SFNET demonstrated superior resistance to catastrophic forgetting. Its Backward Transfer (BWT) score on Spider was -1.0, a significant improvement over the -11.3 observed in standard fine-tuning.
  • Adaptability: The model showed improved Forward Transfer (FWT), indicating that the continual learning process enhanced its zero-shot capabilities on future, unseen databases.

Conclusion

SFNET demonstrates that Semi-Supervised Learning and Continual Learning are mutually beneficial in the context of Text-to-SQL. By using past structural knowledge to guide current learning and using current pseudo-labels to bolster memory, SFNET achieves performance levels approaching full retraining while requiring significantly less computational time. Future work will explore more sophisticated semantic distance metrics for prompt sampling and the integration of automated prompt learning to further smooth task transitions.

Summary updated

BibTeX
@inproceedings{chen2023learn,
  author = {Yongrui Chen and Xinnan Guo and Tongtong Wu and Guilin Qi and Yang Li and Yang Dong},
  title = {{Learn from Yesterday: A Semi-Supervised Continual Learning Method for Supervision-Limited Text-to-SQL Task Streams}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2023},
  doi = {10.1609/aaai.v37i11.26492},
}
Figure