程序即权重:一种模糊函数的编程范式
Program-as-Weights: A Programming Paradigm for Fuzzy Functions
AI总结:
提出模糊函数编程范式,通过Program-as-Weights方法将自然语言规范编译为轻量可执行神经工件,在保持性能的同时大幅降低推理成本。
摘要:
许多日常编程任务难以用干净的基于规则的方式实现,例如对重要日志行进行告警、修复格式错误的JSON或按意图对搜索结果进行排序,这些任务越来越多地被外包给大型语言模型API,但代价是局部性、可重复性和价格。我们提出模糊函数编程:将这样的函数从自然语言规范编译成紧凑的、本地可执行的神经工件。我们通过Program-as-Weights(PAW)实例化这一范式,其中在FuzzyBench(我们发布的包含1000万示例的数据集)上训练的4B编译器为冻结的轻量级解释器生成参数高效的适配器。执行PAW程序的0.6B Qwen3解释器与直接提示Qwen3-32B的性能相当,同时使用的推理内存约为后者的五十分之一,并在MacBook M3上以30 tokens/s的速度运行。PAW将基础模型从每个输入的问题解决者重新定义为工具构建者:每个函数定义调用一次,生成一个小的可重用工件,其后续每次函数应用的调用成本低廉且可离线进行。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。