arXivDaily arXiv每日学术速递 周一至周五更新
​通知:联邦节假日调休:哥伦布日 / 原住民日(Columbus Day / Indigenous Peoples' Day),今日(13日)无更新。
arXiv 2407.10949cs.CLcs.AIcs.LG

用Transformer表示基于规则的聊天机器人

Representing Rule-based Chatbots with Transformers

Princeton University(普林斯顿大学)

Dan Friedman, Abhishek Panigrahi, Danqi Chen

AI总结:

针对Transformer对话内部机制不明的问题,以经典规则聊天机器人ELIZA为分析场景,构建实现ELIZA的Transformer理论模型并实证分析其训练模型的机制偏好,为对话智能体机械分析提供新框架。

摘要:

Transformer可能会使用什么样的内部机制来进行流畅、自然的对话?先前的工作通过构建说明了Transformer如何解决各种合成任务,例如对列表进行排序或识别形式语言,但如何将这种方法扩展到对话场景仍不清楚。在这项工作中,我们提出使用经典的基于规则的聊天机器人ELIZA作为对基于Transformer的聊天机器人进行正式、机械分析的场景。ELIZA允许我们对对话的关键方面进行正式建模,包括局部模式匹配和长期对话状态跟踪。我们首先提出了一个实现ELIZA聊天机器人的Transformer的理论构建。基于先前的构建,特别是那些用于模拟有限状态自动机的构建,我们展示了如何组合和扩展更简单的机制以产生更复杂的行为。接下来,我们对在合成生成的ELIZA对话上训练的Transformer进行了一系列实证分析。我们的分析说明了这些模型倾向于偏好的机制类型——例如,模型更倾向于归纳头机制,而不是更精确的基于位置的复制机制;并使用中间生成来模拟递归数据结构,类似于隐式暂存器或思维链。总体而言,通过在神经聊天机器人和可解释的符号机制之间建立明确的联系,我们的结果为对话智能体的机械分析提供了一个新框架。

英文摘要:

What kind of internal mechanisms might Transformers use to conduct fluid, natural-sounding conversations? Prior work has illustrated by construction how Transformers can solve various synthetic tasks, such as sorting a list or recognizing formal languages, but it remains unclear how to extend this approach to a conversational setting. In this work, we propose using ELIZA, a classic rule-based chatbot, as a setting for formal, mechanistic analysis of Transformer-based chatbots. ELIZA allows us to formally model key aspects of conversation, including local pattern matching and long-term dialogue state tracking. We first present a theoretical construction of a Transformer that implements the ELIZA chatbot. Building on prior constructions, particularly those for simulating finite-state automata, we show how simpler mechanisms can be composed and extended to produce more sophisticated behavior. Next, we conduct a set of empirical analyses of Transformers trained on synthetically generated ELIZA conversations. Our analysis illustrates the kinds of mechanisms these models tend to prefer--for example, models favor an induction head mechanism over a more precise, position-based copying mechanism; and using intermediate generations to simulate recurrent data structures, akin to an implicit scratchpad or Chain-of-Thought. Overall, by drawing an explicit connection between neural chatbots and interpretable, symbolic mechanisms, our results provide a new framework for the mechanistic analysis of conversational agents.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑