轻量级Transformer在零样本和微调下实现高效文本转SQL,适合资源有限场景。
Lightweight Transformers for Zero-Shot and Fine-Tuned Text-to-SQL Generation Using Spider
- 设计可复用的模型无关流水线,适配不同架构的轻量模型
- 微调T5-Small在Spider上达27.8%逻辑形式准确率,最优表现
- 为低资源环境提供可扩展的轻量文本转SQL解决方案
文本转SQL使非专业用户能用自然语言查询关系型数据库,应用于教育与商业智能。本研究在低资源环境下评估三种轻量级Transformer模型(T5-Small、BART-Small、GPT-2)在Spider数据集上的表现。开发了一种可复用、模型无关的流水线,根据各模型架构定制模式格式,训练迭代1000至5000次,在1000个测试样本上使用逻辑形式准确率(LFAcc)、BLEU和精确匹配(EM)进行评估。微调后的T5-Small取得最高LFAcc(27.8%),优于BART-Small(23.98%)和GPT-2(20.1%),表明编码器-解码器模型在模式感知的SQL生成中更具优势。尽管资源受限导致性能受限,该流水线模块化设计支持未来增强,如高级模式链接或替代基模型。本工作凸显了紧凑Transformer在资源匮乏环境中实现可访问文本转SQL的潜力。
原文摘要 · Abstract (English)
Text-to-SQL translation enables non-expert users to query relational databases using natural language, with applications in education and business intelligence. This study evaluates three lightweight transformer models - T5-Small, BART-Small, and GPT-2 - on the Spider dataset, focusing on low-resource settings. We developed a reusable, model-agnostic pipeline that tailors schema formatting to each model's architecture, training them across 1000 to 5000 iterations and evaluating on 1000 test samples using Logical Form Accuracy (LFAcc), BLEU, and Exact Match (EM) metrics. Fine-tuned T5-Small achieves the highest LFAcc (27.8%), outperforming BART-Small (23.98%) and GPT-2 (20.1%), highlighting encoder-decoder models' superiority in schema-aware SQL generation. Despite resource constraints limiting performance, our pipeline's modularity supports future enhancements, such as advanced schema linking or alternative base models. This work underscores the potential of compact transformers for accessible text-to-SQL solutions in resource-scarce environments.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。