arXiv:2412.12493cs.DBcs.AI2024-12被引 2

让大模型生成的错误数据库操作可撤销且不破坏数据一致性

A Simple and Fast Way to Handle Semantic Errors in Transactions

  • 用不变量满足机制协调长时事务与新事务的依赖关系
  • 在TPC-C测试中实现高频率生成下仍保持数据库一致性
  • 适合需集成大模型交互的系统工程师快速落地

当前许多计算机系统正重构以引入大语言模型(LLM)驱动的智能体,支持自然语言输入和更灵活的操作。本文聚焦于处理由大语言模型生成的数据库事务,这些事务可能包含语义错误,需作为长时事务处理,以便人工审查;若发现错误,可从数据库历史中移除。任何删除操作都必须保证数据库一致性(ACID中的“C”)。为此,我们提出一种基于不变量满足(I-Confluence)的新中间件框架,通过识别并协调长时事务与新事务间的依赖关系来维护一致性。该中间件缓冲可疑或补偿性事务,管理协调状态。我们使用TPC-C基准测试评估了事务生成频率、用户审查率及不变量完备性对系统性能的影响。对系统研究者而言,本研究建立了一个LLM与数据库系统的交互范式,提供了一种可保证一致性的“撤销”机制;对系统工程师而言,论文提供了一种仅需少量修改即可集成可撤销的LLM生成事务的中间件设计。

原文摘要 · Abstract (English)

Many computer systems are now being redesigned to incorporate LLM-powered agents, enabling natural language input and more flexible operations. This paper focuses on handling database transactions created by large language models (LLMs). Transactions generated by LLMs may include semantic errors, requiring systems to treat them as long-lived. This allows for human review and, if the transaction is incorrect, removal from the database history. Any removal action must ensure the database's consistency (the "C" in ACID principles) is maintained throughout the process. We propose a novel middleware framework based on Invariant Satisfaction (I-Confluence), which ensures consistency by identifying and coordinating dependencies between long-lived transactions and new transactions. This middleware buffers suspicious or compensating transactions to manage coordination states. Using the TPC-C benchmark, we evaluate how transaction generation frequency, user reviews, and invariant completeness impact system performance. For system researchers, this study establishes an interactive paradigm between LLMs and database systems, providing an "undoing" mechanism for handling incorrect operations while guaranteeing database consistency. For system engineers, this paper offers a middleware design that integrates removable LLM-generated transactions into existing systems with minimal modifications.

大模型数据库事务一致性

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。