Representing Rule-based Chatbots with Transformers
Not on the map. Why?
Abstract (arXiv)
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.
Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Builds on 70 of its 89 references that are in the map. First posted on arXiv 15 Jul 2024.
Builds on
70 of 89 references.
References · 70
- 2017Attention Is All You Needcited by 59,932
- 2014Adam: A Method for Stochastic Optimizationcited by 36,960
- 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,160
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
- 2020Longformer: The Long-Document Transformercited by 3,362
- 2023Sparse Autoencoders Find Highly Interpretable Features in Language Modelscited by 1,359
- 2022In-context Learning and Induction Headscited by 930
- 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 915
- 2021Show Your Work: Scratchpads for Intermediate Computation with Language Modelscited by 871
- 2023Progress measures for grokking via mechanistic interpretabilitycited by 822
- 2022Transformers learn in-context by gradient descentcited by 714
- 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 700
38 more
- 2023Towards Automated Circuit Discovery for Mechanistic Interpretabilitycited by 700
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
- 2024Sparse Feature Circuits: Discovering and Editing Interpretable Causal Graphs in Language Modelscited by 412
- 2021Causal Abstractions of Neural Networkscited by 401
- 2023Trained Transformers Learn Linear Models In-Contextcited by 331
- 2023The Impact of Positional Encoding on Length Generalization in Transformerscited by 319
- 2022Data Distributional Properties Drive Emergent In-Context Learning in Transformerscited by 303
- 2023Towards Revealing the Mystery behind Chain of Thought: A Theoretical Perspectivecited by 293
- 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 291
- 2019Theoretical Limitations of Self-Attention in Neural Sequence Modelscited by 286
- 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 274
- 2022Transformers Learn Shortcuts to Automatacited by 260
- 2024Chain of Thought Empowers Transformers to Solve Inherently Serial Problemscited by 256
- 2023Looped Transformers as Programmable Computerscited by 224
- 2023Transformers as Algorithms: Generalization and Stability in In-context Learningcited by 220
- 2022Exploring Length Generalization in Large Language Modelscited by 204
- 2023What Algorithms can Transformers Learn? A Study in Length Generalizationcited by 198
- 2023Attribution Patching Outperforms Automated Circuit Discoverycited by 196
- 2020Causal Mediation Analysis for Interpreting Neural NLP: The Case of Gender Biascited by 183
- 2021Thinking Like Transformerscited by 182
- 2024A Mechanistic Understanding of Alignment Algorithms: A Case Study on DPO and Toxicitycited by 179
- 2023The Clock and the Pizza: Two Stories in Mechanistic Explanation of Neural Networkscited by 153
- 2022Transformer Language Models without Positional Encodings Still Learn Positional Informationcited by 148
- 2021Inductive Biases and Variable Creation in Self-Attention Mechanismscited by 144
- 2023Physics of Language Models: Part 3.2, Knowledge Manipulationcited by 142
- 2024Fine-Tuning Enhances Existing Mechanisms: A Case Study on Entity Trackingcited by 140
- 2021Saturated Transformers are Constant-Depth Threshold Circuitscited by 137
- 2024Physics of Language Models: Part 3.3, Knowledge Capacity Scaling Lawscited by 137
- 2019On the Turing Completeness of Modern Neural Network Architecturescited by 129
- 2023What Formal Languages Can Transformers Express? A Surveycited by 120
- 2020CausaLM: Causal Model Explanation Through Counterfactual Language Modelscited by 117
- 2023The mechanistic basis of data dependence and abrupt learning in an in-context classification taskcited by 115
- 2024The Evolution of Statistical Induction Heads: In-Context Learning Markov Chainscited by 115
- 2024How Transformers Learn Causal Structure with Gradient Descentcited by 114
- 2023Mechanistically analyzing the effects of fine-tuning on procedurally defined taskscited by 110
- 2021Self-Attention Networks Can Process Bounded Hierarchical Languagescited by 105
- 2022Unveiling Transformers with LEGO: a synthetic reasoning taskcited by 105
- 2021Statistically Meaningful Approximation: a Case Study on Approximating Turing Machines with Transformerscited by 101
50 most cited of 70 All 70 (JSON)
Built on by
Citing papers per year: 2024: 1.
1 paper.
- 2024ALTA: Compiler-Based Analysis of Transformerscited by 7
- 2024ALTA: Compiler-Based Analysis of Transformers23 Oct 2024
Similar, not cited
Close in wording, no citation either way
- 2024Empirical Study of Symmetrical Reasoning in Conversational Chatbots
- 2024Generative Expressive Robot Behaviors using Large Language Models
- 2022Logical Reasoning for Task Oriented Dialogue Systems
- 2025Evolutionary Perspectives on the Evaluation of LLM-Based AI Agents: A Comprehensive Survey
- 2026Protoreasoning in Tiny Transformers
- 2025Finite State Automata Inside Transformers with Chain-of-Thought: A Mechanistic Study on State Tracking
- 2023Commonsense Reasoning for Conversational AI: A Survey of the State of the Art
- 2025REALTALK: A 21-Day Real-World Dataset for Long-Term Conversation