Training Transformers as a Universal Computer

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Xu, Ruize, Yang, Chenxiao, Li, Yanhong, McAllester, David
Format: Preprint
Published: 2026
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866915962473676800
author Xu, Ruize
Yang, Chenxiao
Li, Yanhong
McAllester, David
author_facet Xu, Ruize
Yang, Chenxiao
Li, Yanhong
McAllester, David
contents We demonstrate that a small transformer can learn to execute programs in MicroPy, a simplified yet computationally universal programming language. Given procedure definitions together with an expression to evaluate, the transformer predicts small-step execution using PENCIL scaffolding for space-efficient execution within a bounded context window. After training on randomly generated, meaningless MicroPy programs, the learned transformer generalizes to various human-written programs including bit copying and flipping, binary addition and multiplication, and SAT verification and solving. We note that the trained model can achieve out-of-distribution generalization; i.e., evaluate novel programs from distribution on programs. Since MicroPy can express any computation, our results provide empirical evidence that a standard transformer can be trained to act as a universal computer.
format Preprint
id arxiv_https___arxiv_org_abs_2604_25166
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle Training Transformers as a Universal Computer
Xu, Ruize
Yang, Chenxiao
Li, Yanhong
McAllester, David
Artificial Intelligence
We demonstrate that a small transformer can learn to execute programs in MicroPy, a simplified yet computationally universal programming language. Given procedure definitions together with an expression to evaluate, the transformer predicts small-step execution using PENCIL scaffolding for space-efficient execution within a bounded context window. After training on randomly generated, meaningless MicroPy programs, the learned transformer generalizes to various human-written programs including bit copying and flipping, binary addition and multiplication, and SAT verification and solving. We note that the trained model can achieve out-of-distribution generalization; i.e., evaluate novel programs from distribution on programs. Since MicroPy can express any computation, our results provide empirical evidence that a standard transformer can be trained to act as a universal computer.
title Training Transformers as a Universal Computer
topic Artificial Intelligence
url https://arxiv.org/abs/2604.25166