mlsanityData to 7 Oct 2026

Representing Rule-based Chatbots with Transformers

arXiv 2407.10949 ↗First posted 15 Jul 2024cs.CL cs.AI cs.LGcited by 1

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

  1. 2017Attention Is All You Needcited by 59,932
  2. 2014Adam: A Method for Stochastic Optimizationcited by 36,960
  3. 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,160
  4. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
  5. 2020Longformer: The Long-Document Transformercited by 3,362
  6. 2023Sparse Autoencoders Find Highly Interpretable Features in Language Modelscited by 1,359
  7. 2022In-context Learning and Induction Headscited by 930
  8. 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 915
  9. 2021Show Your Work: Scratchpads for Intermediate Computation with Language Modelscited by 871
  10. 2023Progress measures for grokking via mechanistic interpretabilitycited by 822
  11. 2022Transformers learn in-context by gradient descentcited by 714
  12. 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 700
38 more
  1. 2023Towards Automated Circuit Discovery for Mechanistic Interpretabilitycited by 700
  2. 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
  3. 2024Sparse Feature Circuits: Discovering and Editing Interpretable Causal Graphs in Language Modelscited by 412
  4. 2021Causal Abstractions of Neural Networkscited by 401
  5. 2023Trained Transformers Learn Linear Models In-Contextcited by 331
  6. 2023The Impact of Positional Encoding on Length Generalization in Transformerscited by 319
  7. 2022Data Distributional Properties Drive Emergent In-Context Learning in Transformerscited by 303
  8. 2023Towards Revealing the Mystery behind Chain of Thought: A Theoretical Perspectivecited by 293
  9. 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 291
  10. 2019Theoretical Limitations of Self-Attention in Neural Sequence Modelscited by 286
  11. 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 274
  12. 2022Transformers Learn Shortcuts to Automatacited by 260
  13. 2024Chain of Thought Empowers Transformers to Solve Inherently Serial Problemscited by 256
  14. 2023Looped Transformers as Programmable Computerscited by 224
  15. 2023Transformers as Algorithms: Generalization and Stability in In-context Learningcited by 220
  16. 2022Exploring Length Generalization in Large Language Modelscited by 204
  17. 2023What Algorithms can Transformers Learn? A Study in Length Generalizationcited by 198
  18. 2023Attribution Patching Outperforms Automated Circuit Discoverycited by 196
  19. 2020Causal Mediation Analysis for Interpreting Neural NLP: The Case of Gender Biascited by 183
  20. 2021Thinking Like Transformerscited by 182
  21. 2024A Mechanistic Understanding of Alignment Algorithms: A Case Study on DPO and Toxicitycited by 179
  22. 2023The Clock and the Pizza: Two Stories in Mechanistic Explanation of Neural Networkscited by 153
  23. 2022Transformer Language Models without Positional Encodings Still Learn Positional Informationcited by 148
  24. 2021Inductive Biases and Variable Creation in Self-Attention Mechanismscited by 144
  25. 2023Physics of Language Models: Part 3.2, Knowledge Manipulationcited by 142
  26. 2024Fine-Tuning Enhances Existing Mechanisms: A Case Study on Entity Trackingcited by 140
  27. 2021Saturated Transformers are Constant-Depth Threshold Circuitscited by 137
  28. 2024Physics of Language Models: Part 3.3, Knowledge Capacity Scaling Lawscited by 137
  29. 2019On the Turing Completeness of Modern Neural Network Architecturescited by 129
  30. 2023What Formal Languages Can Transformers Express? A Surveycited by 120
  31. 2020CausaLM: Causal Model Explanation Through Counterfactual Language Modelscited by 117
  32. 2023The mechanistic basis of data dependence and abrupt learning in an in-context classification taskcited by 115
  33. 2024The Evolution of Statistical Induction Heads: In-Context Learning Markov Chainscited by 115
  34. 2024How Transformers Learn Causal Structure with Gradient Descentcited by 114
  35. 2023Mechanistically analyzing the effects of fine-tuning on procedurally defined taskscited by 110
  36. 2021Self-Attention Networks Can Process Bounded Hierarchical Languagescited by 105
  37. 2022Unveiling Transformers with LEGO: a synthetic reasoning taskcited by 105
  38. 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

Cited by year

Citing papers per year: 2024: 1.

1 paper.

Similar, not cited

Close in wording, no citation either way

  1. 2024Empirical Study of Symmetrical Reasoning in Conversational Chatbots
  2. 2024Generative Expressive Robot Behaviors using Large Language Models
  3. 2022Logical Reasoning for Task Oriented Dialogue Systems
  4. 2025Evolutionary Perspectives on the Evaluation of LLM-Based AI Agents: A Comprehensive Survey
  5. 2026Protoreasoning in Tiny Transformers
  6. 2025Finite State Automata Inside Transformers with Chain-of-Thought: A Mechanistic Study on State Tracking
  7. 2023Commonsense Reasoning for Conversational AI: A Survey of the State of the Art
  8. 2025REALTALK: A 21-Day Real-World Dataset for Long-Term Conversation