Text2SQL Training Corpus Generation Based on Bidirectional Enhancement and Multi-Stage Supervision
针对Text2SQL任务中训练语料人工标注成本高、场景覆盖有限的问题,本文提出一种基于双向增强与多阶监督的语料生成框架。该方法通过问题到SQL的正向增强与SQL到问题的逆向增强构建双向数据流,结合大语言模型的上下文理解与代码生成能力,创新性地引入四阶段监督审查机制(提问多样性扩充、提问质量审查、SQL自动生成、生成质量审查),极大地提高了低资源条件下训练语料生成的效率与质量。实验表明,该方法生成的语料所训练出来的模型执行准确率相较于传统人工标注语料微调模型提升了16.3%,相较于少样本提示学习方法提升了35.7%。其次,在语料的泛化迁移性方面,本文方法生成的语料对模型尺寸大小和提问难易程度的适应性都高于人工少量标注方式。To address the challenges of high annotation costs and limited scenario coverage in Text2SQL training corpus construction, this paper proposes a corpus generation framework based on bidirectional enhancement and multi-stage supervision. The method constructs a bidirectional data flow through question-to-SQL forward enhancement and SQL-to-question reverse enhancement, combines the contextual understanding and code generation capabilities of large language models (LLMs), and innovatively introduces a novel four-stage supervision and verification mechanism (question diversity expansion, question quality verification, SQL auto-generation, and generation quality verification), significantly improving the efficiency and quality of corpus generation under low-resource conditions. Experiments demonstrate that models trained with this generated corpus achieve a 16.3% improvement in execution accuracy compared to models fine-tuned with traditional human-annotated corpora and a 35.7% improvement over few-shot prompt learning methods. Furthermore, in terms of the generalization and transferability of the corpus, the corpus generated by this paper’s method is more adaptable to both model size and question difficulty levels than the manually annotated small-scale approach.
Authors
- 浩 黄
Publication Details
- Journal
- Computer Science and Application
- Published
- 2025-01-01
- DOI
- https://doi.org/10.12677/csa.2025.157174
- Primary Topic
- Educational Technology and Assessment
- Type
- article
- Field-Weighted Citation Impact
- 0.00