arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2501.12372cs.DBcs.AI
收藏

长上下文是你所需的全部吗?利用大语言模型的扩展上下文实现NL2SQL

Is Long Context All You Need? Leveraging LLM's Extended Context for NL2SQL

Google(谷歌)

Yeounoh Chung, Gaurav T. Kakkar, Yu Gan, Brenton Milne, Fatma Ozcan

AI总结:

该研究针对NL2SQL的语义歧义问题,探究谷歌gemini-1.5-pro的长上下文在性能与延迟间的权衡,验证其鲁棒性,并构建无需微调与自一致性技术的长上下文NL2SQL流水线,在多基准数据集上取得优异表现。

摘要:

大语言模型(LLM)已在一系列自然语言处理任务中展现出令人瞩目的能力。尤其是推理能力的提升与上下文窗口的扩展,为利用这些强大模型开辟了新途径。NL2SQL(自然语言转SQL)颇具挑战性,因为自然语言问题本质上存在歧义,而SQL生成需要对复杂数据模式与语义有精准理解。解决这一语义歧义问题的一种思路是提供更多且充足的上下文信息。\n在本研究中,我们探究了谷歌前沿大语言模型gemini-1.5-pro所提供的扩展上下文窗口(即长上下文)在性能与延迟之间的权衡。我们研究了多种上下文信息的影响,包括列示例值、问题与SQL查询对、用户提供的提示、SQL文档以及模式。据我们所知,这是首项从准确率与延迟成本两方面,研究扩展上下文窗口及额外上下文信息如何助力NL2SQL生成的工作。我们证实,长上下文大语言模型具备鲁棒性,不会在扩展的上下文信息中迷失方向。此外,我们基于谷歌gemini-pro-1.5构建的长上下文NL2SQL流水线,无需微调,也无需采用成本高昂的基于自一致性的技术,即可在多个基准数据集上取得优异性能。

英文摘要:

Large Language Models (LLMs) have demonstrated impressive capabilities across a range of natural language processing tasks. In particular, improvements in reasoning abilities and the expansion of context windows have opened new avenues for leveraging these powerful models. NL2SQL is challenging in that the natural language question is inherently ambiguous, while the SQL generation requires a precise understanding of complex data schema and semantics. One approach to this semantic ambiguous problem is to provide more and sufficient contextual information. In this work, we explore the performance and the latency trade-offs of the extended context window (a.k.a., long context) offered by Google's state-of-the-art LLM (\textit{gemini-1.5-pro}). We study the impact of various contextual information, including column example values, question and SQL query pairs, user-provided hints, SQL documentation, and schema. To the best of our knowledge, this is the first work to study how the extended context window and extra contextual information can help NL2SQL generation with respect to both accuracy and latency cost. We show that long context LLMs are robust and do not get lost in the extended contextual information. Additionally, our long-context NL2SQL pipeline based on Google's \textit{gemini-pro-1.5} achieve strong performances on various benchmark datasets without finetuning and expensive self-consistency based techniques.

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

↑