赋予数据代理以部落知识
Arming Data Agents with Tribal Knowledge
AI总结:
Tk-Boost通过积累经验纠正NL2SQL代理的误解,提升其在大规模数据库中的查询准确性。
摘要:
自然语言到SQL(NL2SQL)转换使非专业人士能够通过自然语言查询关系数据库。最近,受大型语言模型(LLMs)推理能力驱动的NL2SQL代理在NL2SQL转换方面取得了显著进展。然而,当面对大规模真实世界数据库时,NL2SQL代理仍然会犯错,因为它们缺乏如何正确利用底层数据(例如每列的意图知识)的知识,并在查询时对数据形成误解,导致错误。先前的研究已研究生成关于数据库的事实以提供更多的上下文给NL2SQL代理,但这些方法只是重新陈述数据库内容而没有解决代理的误解。在本文中,我们提出了Tk-Boost,一种可扩展到任何NL2SQL代理的框架,用于增强其部落知识:即通过使用数据库积累的经验纠正代理在查询数据库时的误解的知识。为了积累经验,Tk-Boost首先让NL2SQL代理在数据库上回答几个查询,通过分析其在数据库上的错误来识别代理的误解,并生成部落知识以解决这些问题。为了实现准确检索,Tk-Boost将此知识索引,其适用条件指定了知识在哪些查询特征下是有用的。当回答新查询时,Tk-Boost使用此知识为NL2SQL代理提供反馈,在SQL生成过程中解决代理的误解,从而提高代理的准确性。在BIRD和Spider 2.0基准测试中,对各种NL2SQL代理进行了广泛实验,结果显示Tk-Boost在Spider 2.0上将NL2SQL代理的准确性提高了16.9%,在BIRD上提高了13.7%。
英文摘要:
Natural language to SQL (NL2SQL) translation enables non-expert users to query relational databases through natural language. Recently, NL2SQL agents, powered by the reasoning capabilities of Large Language Models (LLMs), have significantly advanced NL2SQL translation. Nonetheless, NL2SQL agents still make mistakes when faced with large-scale real-world databases because they lack knowledge of how to correctly leverage the underlying data (e.g., knowledge about the intent of each column) and form misconceptions about the data when querying it, leading to errors. Prior work has studied generating facts about the database to provide more context to NL2SQL agents, but such approaches simply restate database contents without addressing the agent's misconceptions. In this paper, we propose Tk-Boost, a bolt-on framework for augmenting any NL2SQL agent with tribal knowledge: knowledge that corrects the agent's misconceptions in querying the database accumulated through experience using the database. To accumulate experience, Tk-Boost first asks the NL2SQL agent to answer a few queries on the database, identifies the agent's misconceptions by analyzing its mistakes on the database, and generates tribal knowledge to address them. To enable accurate retrieval, Tk-Boost indexes this knowledge with applicability conditions that specify the query features for which the knowledge is useful. When answering new queries, Tk-Boost uses this knowledge to provide feedback to the NL2SQL agent, resolving the agent's misconceptions during SQL generation, and thus improving the agent's accuracy. Extensive experiments across the BIRD and Spider 2.0 benchmarks with various NL2SQL agents shows Tk-Boost improves NL2SQL agents accuracy by up to 16.9% on Spider 2.0 and 13.7% on BIRD
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。