Sutra is a typed, purely functional programming language whose compiled forward pass is a PyTorch neural network. The compiler beta-reduces the whole program -- primitives, control flow, string I/O -- to one fused tensor-op graph over a frozen embedding substrate. Rotation binding, unbind, bundle, polynomial Kleene three-valued logic, and tail-recursive loops all lower to tensor operations; the Kleene connectives are Lagrange-interpolated polynomials exact on the {-1, 0, +1} truth grid. Validation is one fact tested two ways. (1) The same program runs on four frozen embeddings spanning two modalities -- three text encoders (nomic-embed-text, all-minilm, mxbai-embed-large) and one protein language model (ESM-2) -- and decodes bundles at 100% accuracy through width k=8 on every substrate, where the textbook Hadamard product has already collapsed (2.5% on mxbai-embed-large, 7.5% on all-minilm). (2) PyTorch autograd flows through the actually compiled graph: a fuzzy-rule classifier written in .su trains from random init (18.7 +/- 9.5%; chance = 20%, five classes) to 100.0 +/- 0.0% (three seeds) by backpropagating through the emitted graph, the symbolic source unmodified. A weighted variant additionally trains a scalar cosine gain and writes it back into the .su source as a numeric literal; recompiling reproduces the trained behaviour to ~2e-7 per logit, so the trained model is itself legible, recompilable code. The same artifact is therefore both a logic program and a trainable neural network.


翻译:Sutra是一种带类型的纯函数式编程语言,其编译后的前向传播过程为一个PyTorch神经网络。编译器对完整程序——包括原语、控制流、字符串输入/输出——实施β归约,最终在冻结的嵌入基座上将其转化为单一融合的张量操作图。旋转绑定、解绑、捆绑、多项式Kleene三值逻辑以及尾递归循环均被降级为张量操作;其中Kleene联结词采用拉格朗日插值多项式,在{-1, 0, +1}真值网格上精确成立。验证通过两种方式对同一事实进行测试:(1) 同一程序在跨越两种模态的四种冻结嵌入上运行——三种文本编码器(nomic-embed-text、all-minilm、mxbai-embed-large)与一种蛋白质语言模型(ESM-2)——并在每个基座上以宽度k=8实现100%的捆绑解码准确率,而教科书级别的哈达玛乘积在此条件下已完全失效(mxbai-embed-large为2.5%,all-minilm为7.5%);(2) PyTorch自动求导机制流经实际编译后的计算图:一个以.su编写的模糊规则分类器通过反向传播经发射计算图(符号源代码保持不变)从随机初始化(18.7±9.5%;随机基线20%,五分类)训练至100.0±0.0%(三个随机种子)。其加权变体额外训练一个标量余弦增益,并将其以数值字面量形式写回.su源代码;重新编译后,该训练行为在每个logit上可复现至约2e-7精度,因而训练后的模型本身即为可读、可重编译的代码。同一产物因此兼具逻辑程序与可训练神经网络的双重身份。

0
下载
关闭预览

相关内容

Transformer它就是个支持向量机
专知会员服务
38+阅读 · 2023年9月7日
如何用latext画神经网络?这个PlotNeuralNet能帮到你
专知会员服务
26+阅读 · 2022年1月15日
华为等发布《视觉Transformer转换器》综述论文,21页pdf
专知会员服务
86+阅读 · 2020年12月25日
综述:基于GAN的图像翻译模型盘点
GAN生成式对抗网络
21+阅读 · 2019年9月2日
面试题:请简要介绍下tensorflow的计算图
七月在线实验室
14+阅读 · 2019年6月10日
【收藏】支持向量机原理详解+案例+代码!【点击阅读原文下载】
机器学习算法与Python学习
10+阅读 · 2018年9月13日
用PyTorch实现各种GANs(附论文和代码地址)
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
最新内容
《无人地面战车(UGV)的崛起》报告
专知会员服务
5+阅读 · 7月16日
美陆军任务式指挥人工智能解决方案
专知会员服务
7+阅读 · 7月16日
相关基金
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员