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

Introduction

In the evolving landscape of natural language processing, the Text-to-SQL task—translating natural language questions into executable SQL queries—remains a cornerstone for accessible data interaction. However, traditional research often treats this as a static problem. In real-world applications, databases are dynamic, constantly being added or updated, creating a task stream. This dynamic environment introduces two critical challenges: data scarcity, where annotating SQL labels for every new schema is prohibitively expensive, and catastrophic forgetting, where models lose proficiency in older tasks as they learn new ones.

To address these issues, this paper introduces the Soft Fusion Network (SFNET), a framework that synergizes semi-supervised learning (SSL) and continual learning (CL) to maintain high performance across expanding task streams with limited supervision.

Motivation: Leveraging Structural Similarities

The core intuition behind SFNET is that while database schemas change, the underlying logic of SQL queries often repeats across domains. For instance, a query finding the "most recently opened track" in a racing database shares the same structural skeleton (ORDER BY ... DESC LIMIT 1) as a query finding the perpetrator with the "most injuries."

Conceptual overview of task streams, showing how past tasks can provide prompts for new ones and how memory is augmented over time.

By recognizing these patterns, a model can use knowledge from "yesterday" (past tasks) to better understand "today's" unlabeled data. This cross-task knowledge transfer is the foundation for bridging the gap between learning efficiency and long-term retention.

The SFNET Framework

SFNET utilizes a Teacher-Student architecture to decouple the immediate goal of task-specific performance from the long-term goal of stream-wide stability.

Dual Sampling Strategy

The framework's effectiveness hinges on two specialized sampling mechanisms:

  1. Prompt Sampling: This strategy identifies past labeled instances that are schema-similar to the current task. These instances serve as "hints" for the Teacher Parser, helping it generate high-quality pseudo-labels for the current task's unlabeled data.
  2. Review Sampling: To prevent forgetting, the Student Parser maintains an episodic memory. Review sampling selects a diverse set of past instances based on SQL skeletons and database schemas, providing a comprehensive "review" of previously learned logic.
The SFNET architecture illustrating the interaction between Teacher and Student parsers, pseudo-label generation, and the dual sampling mechanisms.

Teacher and Student Parsers

  • The Teacher Parser focuses on optimizing performance for the current task ($D^i$). It leverages the Prompt Sampling mechanism to perform self-training on unlabeled data ($U^i$).
  • The Student Parser is the primary model for the entire stream. It is trained on a combination of original labeled data ($A^i$), the Teacher's pseudo-labels, and the episodic memory ($M_{stu}$) curated via Review Sampling. This ensures the model learns new tasks without overwriting the knowledge required for previous ones.

Experimental Evaluation

The researchers evaluated SFNET on two major benchmarks, WikiSQL and Spider, modified into 10-task streams. The datasets were split by domain to test the model's ability to handle "zero-shot" tables—schemas never encountered during the training of a specific task.

Key Results

  • Superior Accuracy: SFNET achieved a 56.0% average accuracy ($ACC_a$) on the complex Spider dataset, significantly outperforming standard fine-tuning (47.5%) and vanilla continual learning baselines.
  • Mitigating Forgetting: The model showed exceptional stability. Its Backward Transfer (BWT) metric—a measure of forgetting—was -1.0 on Spider, compared to -11.3 for naive fine-tuning.
  • Forward Transfer: As the model progressed through the stream, its ability to handle completely unseen databases improved, demonstrating that learning SQL logic in one domain facilitates faster adaptation to others.

Conclusion

SFNET demonstrates that semi-supervised and continual learning are not just compatible but mutually beneficial. By using past knowledge to label new data and using new data to reinforce structural SQL patterns, SFNET provides a robust solution for deploying Text-to-SQL systems in dynamic, data-scarce environments. Future work may involve refining distance metrics for sampling and exploring prompt-tuning techniques to further enhance the Teacher's predictive capabilities.

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