arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.16747cs.CLcs.AIcs.LGcs.SE
收藏

SQLong: 面向长上下文的增强型大语言模型NL2SQL方法

SQLong: Enhanced NL2SQL for Longer Contexts with LLMs

Oracle Corporation(Oracle公司)

Dai Quoc Nguyen, Cong Duy Vu Hoang, Duy Vu, Gioacchino Tangari, Thanh Tien Vu, Don Dharmasiri, Yuan-Fang Li, Long Duong

AI总结:

针对大语言模型在长上下文大型数据库模式下NL2SQL性能下降的问题,提出SQLong数据增强框架,通过合成表命令与数据行扩展模式生成增强数据集,实验证明其可显著提升模型在复杂库模式场景下的NL2SQL表现。

摘要:

开放权重大语言模型(LLMs)已显著提升了自然语言转SQL(NL2SQL)任务的性能,但在处理大型数据库模式时,其效果会随上下文长度增加而下降。为解决这一局限,我们提出SQLong——一种新颖高效的数据增强框架,旨在提升LLM在NL2SQL任务长上下文场景下的性能。SQLong通过从训练数据的多样模式中采样,用额外的合成CREATE TABLE命令及对应数据行扩展现有数据库模式,生成增强数据集,该方法可在微调与评估阶段有效模拟长上下文场景。通过在Spider和BIRD数据集上的实验,我们证明用SQLong增强数据微调的LLM,性能显著优于在标准数据集上训练的模型。这些结果表明SQLong具备实际应用价值,能在含复杂数据库模式的真实场景中提升NL2SQL能力。

英文摘要:

Open-weight large language models (LLMs) have significantly advanced performance in the Natural Language to SQL (NL2SQL) task. However, their effectiveness diminishes when dealing with large database schemas, as the context length increases. To address this limitation, we present SQLong, a novel and efficient data augmentation framework designed to enhance LLM performance in long-context scenarios for the NL2SQL task. SQLong generates augmented datasets by extending existing database schemas with additional synthetic CREATE TABLE commands and corresponding data rows, sampled from diverse schemas in the training data. This approach effectively simulates long-context scenarios during finetuning and evaluation. Through experiments on the Spider and BIRD datasets, we demonstrate that LLMs finetuned with SQLong-augmented data significantly outperform those trained on standard datasets. These imply SQLong's practical implementation and its impact on improving NL2SQL capabilities in real-world settings with complex database schemas.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑