不靠推理也不微调,用低成本实现高精度文本转SQL
Cheaper, Better, Faster, Stronger: Robust Text-to-SQL without Chain-of-Thought or Fine-Tuning
- 通过多重模式输入增强模型鲁棒性,避免单一表示缺陷
- 每查询仅需0.039美元,性能接近昂贵方法的基准表现
- 适合预算有限但需稳定效果的工业级数据库查询场景
大型语言模型在文本转SQL等代码生成任务中表现优异,但现有最优方法常依赖链式思维、自一致性或微调,推理成本高昂,单次查询平均花费高达0.46美元,微调成本可达数千美元。本文提出「N-rep一致性」方法,通过同一模式的多种表示形式提升模型鲁棒性,克服单一表示弱点,使小型廉价模型无需推理或微调即可达到相近性能。该方法在BIRD基准上表现优异,单次查询成本低至0.039美元,据我们所知,是当前同成本区间内性能最佳的文本转SQL方案。
原文摘要 · Abstract (English)
LLMs are effective at code generation tasks like text-to-SQL, but is it worth the cost? Many state-of-the-art approaches use non-task-specific LLM techniques including Chain-of-Thought (CoT), self-consistency, and fine-tuning. These methods can be costly at inference time, sometimes requiring over a hundred LLM calls with reasoning, incurring average costs of up to \$0.46 per query, while fine-tuning models can cost thousands of dollars. We introduce "N-rep" consistency, a more cost-efficient text-to-SQL approach that achieves similar BIRD benchmark scores as other more expensive methods, at only \$0.039 per query. N-rep leverages multiple representations of the same schema input to mitigate weaknesses in any single representation, making the solution more robust and allowing the use of smaller and cheaper models without any reasoning or fine-tuning. To our knowledge, N-rep is the best-performing text-to-SQL approach in its cost range.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。