把自然语言“编译”成能离线跑的小函数
写代码的人都知道:有些功能一句话能说清,但用规则实现却难如登天。这篇论文的思路是反着来——不写规则,而是把自然语言描述当成“编译输入”,让大模型现场生成一批示例,再用这些示例训练一个极小的适配器,装进一个紧凑的解释器里。编译完成后,这个“函数”就不再依赖任何远程大模型,可以像普通软件一样存储、版本化、组合。在专门挑难的测试集上,它达到了83.6%的语义准确率,代价是编译要花一分钟而不是几秒。它不是你明天就能用上的东西,但方向值得留意:未来很多“说句话就能用的功能”可能不再需要联网调用大模型,而是先编译成轻量本地模块,随取随用。
📄 原文摘要(英文)
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.