Large language models (LLMs) have revolutionized Text-to-SQL generation, allowing users to query structured data using natural language with growing ease. Yet, real-world deployment remains challenging, especially in complex or unseen schemas, due to inconsistent accuracy and the risk of generating invalid SQL. We introduce Template Constrained Decoding (TeCoD), a system that addresses these limitations by harnessing the recurrence of query patterns in labeled workloads. TeCoD converts historical NL-SQL pairs into reusable templates and introduces a robust template selection module that uses a fine-tuned natural language inference model to match or reject queries efficiently. Once the template is selected, TeCoD enforces it during SQL generation through grammar-constrained decoding, implemented via a novel partitioned strategy that ensures both syntactic validity and efficiency. Together, these components yield up to 36% higher execution accuracy than in-context learning (ICL) and 2.2x lower latency on matched queries.


翻译:暂无翻译

0
下载
关闭预览

相关内容

机器学习系统设计系统评估标准
大语言模型中的检索与结构化增强生成综述
专知会员服务
33+阅读 · 2025年9月17日
结合知识增强的大型语言模型复杂问题求解综述
专知会员服务
16+阅读 · 2025年5月7日
《大语言模型的数据合成与增强综述》
专知会员服务
43+阅读 · 2024年10月19日
disentangled-representation-papers
CreateAMind
26+阅读 · 2018年9月12日
论文浅尝 | 基于知识图谱的子图匹配回答自然语言问题
开放知识图谱
27+阅读 · 2018年5月17日
论文浅尝 | Question Answering over Freebase
开放知识图谱
19+阅读 · 2018年1月9日
语料库构建——自然语言理解的基础
计算机研究与发展
11+阅读 · 2017年8月21日
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
VIP会员
最新内容
DeepSeek 版Claude Code,免费小白安装教程来了!
专知会员服务
5+阅读 · 5月5日
《美空军条令出版物 2-0:情报(2026版)》
专知会员服务
9+阅读 · 5月5日
帕兰提尔 Gotham:一个游戏规则改变器
专知会员服务
5+阅读 · 5月5日
【综述】 机器人学习中的世界模型:全面综述
专知会员服务
10+阅读 · 5月4日
伊朗的导弹-无人机行动及其对美国威慑的影响
相关基金
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员