让大模型直接操作可动态更新的文本数据库,提升RAG系统灵活性
Can Language Models Enable In-Context Database?
- 用增量编码实现数据库的动态更新,支持增删改查操作
- 在InConDB基准上验证了模型对结构化数据的完整操作能力
- 适合需要灵活数据交互的RAG应用开发者参考
大型语言模型(LLMs)正展现出少样本学习能力,能处理理解、规划、推理、问答、计算等多种任务。其核心在于对表格、图等结构化或半结构化数据的表示与理解能力。已有研究证明,将表格或图作为上下文数据进行推理是可行的,且具有潜力。这种轻量级、人类可读的上下文数据库可能成为传统数据库在典型RAG设置中的替代方案。然而,现有工作几乎都聚焦于静态上下文数据,无法支持动态更新。本文提出一种数据库的增量编码方法,以实现动态更新。探索如何将传统关系型数据库中的数据编码为上下文文本,并评估大模型在上下文数据库上执行CRUD操作的能力。构建了名为InConDB的基准,通过大量实验考察不同编码方式、提示策略、操作类型和输入分布下的模型表现,揭示了其能力边界与局限。
原文摘要 · Abstract (English)
Large language models (LLMs) are emerging as few-shot learners capable of handling a variety of tasks, including comprehension, planning, reasoning, question answering, arithmetic calculations, and more. At the core of these capabilities is LLMs' proficiency in representing and understanding structural or semi-structural data, such as tables and graphs. Numerous studies have demonstrated that reasoning on tabular data or graphs is not only feasible for LLMs but also gives a promising research direction which treats these data as in-context data. The lightweight and human readable characteristics of in-context database can potentially make it an alternative for the traditional database in typical RAG (Retrieval Augmented Generation) settings. However, almost all current work focuses on static in-context data, which does not allow dynamic update. In this paper, to enable dynamic database update, delta encoding of database is proposed. We explore how data stored in traditional RDBMS can be encoded as in-context text and evaluate LLMs' proficiency for CRUD (Create, Read, Update and Delete) operations on in-context databases. A benchmark named InConDB is presented and extensive experiments are conducted to show the performance of different language models in enabling in-context database by varying the database encoding method, prompting method, operation type and input data distribution, revealing both the proficiency and limitations.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。