Learning Elementary Cellular Automata with Transformers

Mikhail Burtsev
12/2/2024
cs.NEcs.AIcs.FL

No official code found. Best implementation: burtsev/TransformerECA (2 stars, MIT, last commit 2024-10-29).

Abstract

Large Language Models demonstrate remarkable mathematical capabilities but at the same time struggle with abstract reasoning and planning. In this study, we explore whether Transformers can learn to abstract and generalize the rules governing Elementary Cellular Automata. By training Transformers on state sequences generated with random initial conditions and local rules, we show that they can generalize across different Boolean functions of fixed arity, effectively abstracting the underlying rules. While the models achieve high accuracy in next-state prediction, their performance declines sharply in multi-step planning tasks without intermediate context. Our analysis reveals that including future states or rule prediction in the training loss enhances the models' ability to form internal representations of the rules, leading to improved performance in longer planning horizons and autoregressive generation. Furthermore, we confirm that increasing the model's depth plays a crucial role in extended sequential computations required for complex reasoning tasks. This highlights the potential to improve LLM with inclusion of longer horizons in loss function, as well as incorporating recurrence and adaptive computation time for dynamic control of model depth.

View on arXivView PDF

Code Implementations(1)

MIT

Code for Burtsev, Mikhail. "Learning Elementary Cellular Automata with Transformers." In The 4th Workshop on Mathematical Reasoning and AI at NeurIPS'24.

21Jupyter NotebookOct 29, 20241 years agoMIT

Similar Papers

Cite this paper

@article{burtsev2024learning,
  title  = {Learning Elementary Cellular Automata with Transformers},
  author = {Mikhail Burtsev},
  year   = {2024},
  eprint = {2412.01417},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2412.01417v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2412.01417.svg)](https://codeofpaper.com/paper/2412.01417)

Discussion