通过训练编译:将自然语言规范转化为局部神经函数

·

研究论文 · 2026/09/04

许多重复的文本功能易于描述但难以用规则实现,而每次输入都调用大型远程模型会带来重复成本、延迟和对提供商的依赖。我们提出了“通过训练编译”,将自然语言规范转化为可重用的神经函数。在编译时,教师模型生成任务特定示例,用于为紧凑解释器训练小型适配器。生成的函数无需教师即可运行,并可像普通软件一样存储、版本化和组合。在FuzzyBench-Hard上(Program-as-Weights快速编译器未产生精确匹配的子集),通过训练编译达到了83.6%的语义准确率。这种更高的准确率伴随着更高的编译时成本:大约一分钟而非几秒。我们将编译器部署在公共交互服务中,并在多站点网站助手、语言控制的3D虚拟角色和双向英语-Claudish翻译器中展示了编译函数。

该论文提出了一种新颖的编译方法,将自然语言规范转化为可部署的神经函数,解决了规则实现困难和大模型调用成本高的问题,并在基准测试中展示了显著效果,具有实际应用价值。

Many recurring text functions are easy to describe but difficult to implement with rules, while calling a large remote model for every input introduces repeated cost, latency, and dependency on a provider. We present compile by training, which turns a natural-language specification into a reusable neural function. At compile time, teacher models generate task-specific examples that are used to train a small adapter for a compact interpreter. The resulting function runs without the teachers and can be stored, versioned, and composed like ordinary software. On FuzzyBench-Hard, a subset on which the Program-as-Weights fast compiler produced no exact matches, compile by training reaches 83.6% semantic accuracy. This higher accuracy comes with a higher compile-time cost: roughly a minute rather than seconds for the fast compiler. We deploy the compiler in a public interactive service and demonstrate compiled functions in a multi-site website helper, a language-controlled 3D avatar, and a bidirectional English-Claudish translator.

阅读原文

参与讨论