展示HN:将英文规格编译成22 MB的本地运行神经网络功能
我们开发了 ProgramAsWeights (PAW) — <a href="https://programasweights.com" rel="nofollow">https://programasweights.com</a>
<p>您可以用英语描述一个功能,比如“判断这条消息是否紧急”,PAW 会将其编译成一个小型神经程序(22 MB),该程序可以像普通的 Python 函数一样在本地运行。无需 API 密钥,编译后无需互联网,输出结果是确定性的。</p>
<p>它适用于那些容易描述但难以用规则编码的任务:紧急程度分类、JSON 修复、日志过滤、代理工具路由。</p>
<pre><code> pip install programasweights
import programasweights as paw
f = paw.compile_and_load("判断这是否紧急。")
f("需要您在今天结束前签字") # "紧急"
</code></pre>
编译过程在我们的服务器上只需几秒钟。之后,所有操作都在您的机器上运行。每个程序都是一个 LoRA 适配器 + 文本指令,适配一个固定的预训练解释器(Qwen3 0.6B)。模型本身没有改变——所有的任务行为都来自编译后的程序。
<p>在我们的评估中,这个 0.6B 的解释器与 PAW 达到了 73% 的准确率。而直接提示同样的 0.6B 仅能得到 10%。即使提示 Qwen3 32B 也仅能得到 69%。</p>
<p>还可以在浏览器中运行(GPT-2 124M,WebAssembly): <a href="https://programasweights.com/browser" rel="nofollow">https://programasweights.com/browser</a></p>
<p>您还可以通过复制这里的提示在您的 AI 代理中使用它: <a href="https://programasweights.com/agents" rel="nofollow">https://programasweights.com/agents</a></p>
<p>来源: <a href="https://github.com/programasweights" rel="nofollow">https://github.com/programasweights</a></p>
<p>试用一下: <a href="https://programasweights.com" rel="nofollow">https://programasweights.com</a></p>
查看原文
We built ProgramAsWeights (PAW) — <a href="https://programasweights.com" rel="nofollow">https://programasweights.com</a><p>You describe a function in English — like "classify if this message is urgent" — and PAW compiles it into a tiny neural program (22 MB) that runs locally like a normal Python function. No API keys, no internet after compilation, deterministic output.<p>It's for tasks that are easy to describe but hard to code with rules: urgency triage, JSON repair, log filtering, tool routing for agents.<p><pre><code> pip install programasweights
import programasweights as paw
f = paw.compile_and_load("Classify if this is urgent or not.")
f("Need your signature by EOD") # "urgent"
</code></pre>
Compilation takes a few seconds on our server. After that, everything runs on your machine. Each program is a LoRA adapter + text instructions that adapt a fixed pretrained interpreter (Qwen3 0.6B). The model itself is unchanged — all task behavior comes from the compiled program.<p>On our evaluation, this 0.6B interpreter with PAW reaches 73% accuracy. Prompting the same 0.6B directly gets 10%. Even prompting Qwen3 32B only gets 69%.<p>Also runs in the browser (GPT-2 124M, WebAssembly): <a href="https://programasweights.com/browser" rel="nofollow">https://programasweights.com/browser</a><p>You can also use it in your AI agents by copying the prompt here: <a href="https://programasweights.com/agents" rel="nofollow">https://programasweights.com/agents</a><p>Source: <a href="https://github.com/programasweights" rel="nofollow">https://github.com/programasweights</a><p>Try it out: <a href="https://programasweights.com" rel="nofollow">https://programasweights.com</a>