[论文解读] ChatDB: Augmenting LLMs with Databases as Their Symbolic Memory
ChatDB 将关系型数据库用作 LLM 的外部符号记忆,采用记忆链来通过 SQL 进行多跳推理,并在一个合成的水果商店数据集上显著优于 ChatGPT。
Large language models (LLMs) with memory are computationally universal. However, mainstream LLMs are not taking full advantage of memory, and the designs are heavily influenced by biological brains. Due to their approximate nature and proneness to the accumulation of errors, conventional neural memory mechanisms cannot support LLMs to simulate complex reasoning. In this paper, we seek inspiration from modern computer architectures to augment LLMs with symbolic memory for complex multi-hop reasoning. Such a symbolic memory framework is instantiated as an LLM and a set of SQL databases, where the LLM generates SQL instructions to manipulate the SQL databases. We validate the effectiveness of the proposed memory framework on a synthetic dataset requiring complex reasoning. The project website is available at https://chatdatabase.github.io/ .
研究动机与目标
- 激励具备记忆增强能力的 LLMs 利用结构化符号记忆进行对历史数据的精确操作。
- 提出一个框架,在该框架中,LLM 控制器向外部数据库发出 SQL 操作以存储和查询历史记录。
- 引入记忆链以将复杂推理分解为若干记忆操作步骤。
- 在一个合成数据集上展示改进的多跳推理能力与较低的错误累积。
提出的方法
- 由一个 LLM 控制器和一个基于 MySQL 的外部符号记忆(数据库)组成的框架。
- 由 LLM 生成中间记忆操作步骤(SQL)以操作记忆。
- 在数据库上执行 SQL 操作,结果反馈给模型。
- 记忆链:基于中间结果对记忆操作进行迭代更新,随后给出最终回答摘要。
- 使用上下文示例和思维链提示来增强记忆操作过程。
- 在一个合成的 Fruit Shop 数据集上进行包含 50 问的基准评估,比较 ChatDB 与 ChatGPT。
实验结果
研究问题
- RQ1通过数据库引入外部符号记忆是否能改善 LLM 的多跳推理?
- RQ2相较于神经记忆,符号记忆如何实现对数据的精确操作(插入/更新/删除/查询)?
- RQ3记忆链分解能否降低长时域推理任务中的误差累积?
- RQ4在需要记忆与计算的简单问题与困难问题上,ChatDB 的表现与强基线相比如何?
主要发现
| 模型 | 简单 | 困难 | 全部 | 准确率 |
|---|---|---|---|---|
| ChatGPT | 10/15 | 1/35 | 11/50 | 22% |
| ChatDB (ours) | 13/15 | 28/35 | 41/50 | 82% |
- ChatDB 在 Fruit Shop 数据集上显著优于基线 ChatGPT(All: 41/50 vs. 11/50;准确率 82% vs. 22%)。
- ChatDB 在硬的多跳问题上的准确率远高于 ChatGPT(Hard: 28/35 vs. 1/35)。
- Memory operations are performed symbolically via SQL, enabling precise data manipulation (insert/update/delete/select).
- Chain-of-memory 将任务分解为中间步骤,提升推理稳定性并减少误差累积。
- 该方法通过结构化数据库记忆和带时间戳的操作保持可解释性和状态跟踪。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。