用自然语言定义模糊函数,生成可本地运行的轻量级程序。
Program-as-Weights: A Programming Paradigm for Fuzzy Functions

- 将自然语言描述编译为紧凑神经模型,实现函数本地执行。
- 0.6B小模型性能媲美32B大模型,内存消耗仅为1/50。
- 适合需要离线、低成本推理的开发场景。
许多日常编程任务难以通过规则清晰实现,如重要日志告警、修复格式错误的JSON或按意图排序搜索结果,正越来越多地依赖大语言模型API,但带来局部性差、复现困难和成本高的问题。我们提出模糊函数编程:将自然语言规范编译为紧凑、可本地执行的神经模型。通过Program-as-Weights(PAW)实现,基于我们发布的1000万样本数据集FuzzyBench训练的40亿参数编译器,生成适用于冻结轻量解释器的参数高效适配器。使用0.6B Qwen3解释器执行PAW程序,在性能上达到直接调用32B Qwen3的效果,推理内存仅需其约1/50,且在MacBook M3上以30词/秒速度运行。PAW将基础模型从逐输入求解者转变为工具构建者:仅需一次调用定义函数,后续应用成本极低且可离线运行。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。