arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2605.08150cs.LG
收藏

一种图灵完备神经网络的PyTorch库

A PyTorch Library of Turing-Complete Neural Networks

Jonathan Bates

AI总结:

本文提出一个PyTorch库,通过图灵机描述编译神经网络及权重,生成可精确模拟指定机器的模型。实现两种架构:基于Wei等人(2021)的Transformer和基于Siegelmann和Sontag(1995)的循环网络,展示ReLU网络实现布尔电路及硬注意力实现磁带位置查找。

摘要:

我们提出一个PyTorch包,将神经网络及其权重从图灵机描述编译,生成无需训练即可精确模拟指定机器的模型。给定转移函数和终端状态集,该包构建一个模型,其前向传递对应图灵机的一步。实现了两种架构:(1) 基于Wei等人(2021)的Transformer,包含自注意力、交叉注意力和前馈层;(2) 基于Siegelmann和Sontag(1995)的循环网络,将栈编码为康托集。从基础原理出发,展示了ReLU网络如何实现布尔电路(与、或、非、异或门及其组合成DNF公式和二进制加法器)以及硬注意力如何实现磁带位置查找。该库为符号-神经桥梁提供了可运行的参考,并为未来研究构造解在基于梯度的优化下的稳定性奠定了基础。代码见https://github.com/jonrbates/turing.

英文摘要:

We present a PyTorch package that compiles neural networks and their weights from Turing machine descriptions, producing models that exactly simulate the specified machine without any training. Given a transition function and a set of terminal states, the package constructs a model whose forward pass corresponds to one step of the Turing machine. Two architectures are implemented, each realizing a different theoretical result: (1) a transformer with self-attention, cross-attention, and feedforward layers based on Wei, Chen, and Ma (2021), and (2) a recurrent network based on Siegelmann and Sontag (1995) that encodes the stack in a Cantor set. We develop the constructions from first principles, showing how ReLU networks implement Boolean circuits (AND, OR, NOT, XOR gates and their composition into DNF formulas and binary adders) and how hard attention implements positional lookup on the tape. The package serves as a concrete, runnable reference for the symbolic-neural bridge, and as a foundation for future work on the stability of constructed solutions under gradient-based optimization. Code is available at https://github.com/jonrbates/turing.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑