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.
翻译:当前,许多计算机系统正在重新设计以集成基于大语言模型(LLM)的智能体,从而实现自然语言输入和更灵活的操作。本文重点关注处理由大语言模型生成的数据库事务。由LLM生成的事务可能包含语义错误,因此系统需要将其视为长生命周期事务进行处理。这使得人工审核成为可能,并且当发现事务错误时,可将其从数据库历史记录中移除。任何移除操作都必须确保在整个过程中维持数据库的一致性(即ACID原则中的"C")。我们提出了一种基于不变性满足(I-Confluence)的新型中间件框架,该框架通过识别并协调长生命周期事务与新事务之间的依赖关系来确保一致性。该中间件通过缓冲可疑事务或补偿事务来管理协调状态。利用TPC-C基准测试,我们评估了事务生成频率、用户审核以及不变性完备性对系统性能的影响。对于系统研究者而言,本研究建立了LLM与数据库系统之间的交互范式,提供了一种在保证数据库一致性的同时处理错误操作的“撤销”机制。对于系统工程师而言,本文提出了一种中间件设计方案,能够以最小的修改将可移除的LLM生成事务集成到现有系统中。