把模糊需求编译成AI小程序,本地跑还省内存
你让AI做一件事——比如从日志里挑出重要的行、把乱掉的JSON修好——通常得每次把完整指令发给大模型,慢、贵、还依赖网络。这篇换了个思路:把自然语言描述的需求,先编译成一个极小的“AI程序”,然后让一个轻量模型在本地执行这个程序。编译一次(用4B参数的模型),之后每次调用只需0.6B的模型,在MacBook M3上每秒跑30个token,内存只用直接调大模型的五十分之一,效果却和32B模型直接提示差不多。它不是你明天就能用的工具,但指向一个趋势:AI从“每次帮你算答案”变成“帮你造一个能反复用的小工具”。
📄 原文摘要(英文)
Many everyday programming tasks resist clean rule-based implementation, such as alerting on important log lines, repairing malformed JSON, or ranking search results by intent, and are increasingly outsourced to large language model APIs at the cost of locality, reproducibility, and price. We propose fuzzy-function programming: compiling such a function from a natural-language specification into a compact, locally-executable neural artifact. We instantiate this paradigm with Program-as-Weights (PAW), in which a 4B compiler trained on FuzzyBench, a 10M-example dataset we release, emits parameter-efficient adapters for a frozen, lightweight interpreter. A 0.6B Qwen3 interpreter executing PAW programs matches the performance of direct prompting of Qwen3-32B, while using roughly one fiftieth of the inference memory and running at 30 tokens/s on a MacBook M3. PAW reframes the foundation model from a per-input problem solver into a tool builder: invoked once per function definition, it produces a small reusable artifact whose subsequent calls per function application are cheap and offline.