arXiv:2604.08816cs.LG2026-04

用Transformer实现可扩展的神经计算机,指令执行高效且状态固定

Loom: A Scalable Analytical Neural Computer Architecture

  • 用8层Transformer循环执行编译后的C代码,每步处理一条指令
  • 固定参数量470万,支持928条指令,9×9数独求解仅需284条指令
  • 权重不随程序变化,适合研究神经计算与可解释性编程

我们提出Loom,一种将C语言程序编译后在循环Transformer中执行的计算机架构,其权重通过解析方式获得。该架构实现22个操作码的指令集,使用8层Transformer,每次前向传播执行一条指令,模型迭代运行直至程序计数器归零。完整机器状态存储于一个固定大小的张量 $X \in \mathbb{R}^{d \times n}$,每一步计算开销恒定,与程序长度或执行历史无关。默认配置为 $d = 155$、$n = 1024$,共470万参数,提供928个指令槽位;紧凑配置 $d = 146$、$n = 512$ 可完成9×9数独求解(共284条指令)。权重与程序无关,程序仅存在于状态张量中,同一固定权重模型可执行任意编译程序。Loom源代码已公开于 https://github.com/mkturkcan/Loom。

原文摘要 · Abstract (English)

We present Loom, a computer architecture that executes programs compiled from C inside a looped transformer whose weights are derived analytically. The architecture implements a 22-opcode instruction set in 8 transformer layers. Each forward pass executes one instruction; the model is applied iteratively until the program counter reaches zero. The full machine state resides in a single tensor $X \in \mathbb{R}^{d \times n}$ of fixed size, and every step has fixed cost for fixed $d$ and $n$, independent of program length or execution history. The default configuration uses $d = 155$ and $n = 1024$, yielding 4.7 million parameters and 928 instruction slots. A compact configuration at $d = 146$ and $n = 512$ suffices for a 9$\times$9 Sudoku solver (284 instructions). The weights are program-independent: programs live in the state tensor, and the same fixed-weight model executes any compiled program. We make Loom source code publicly available at https://github.com/mkturkcan/Loom.

神经计算机Transformer可解释编程指令系统

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。