用指令代替上百个示例,让大模型学会可复用的行为。
Programming by Backprop: An Instruction is Worth 100 Examples When Finetuning LLMs
- 通过分离指令映射与内化过程,实现从说明性指令中学习操作方法。
- 单条指令可替代100个执行示例,样本效率提升显著。
- 适合关注数据高效训练与模型行为可控性的研究者。
大型语言模型通常通过示范或经验学习行为,但其训练数据多为陈述性内容:指令、规则和描述,仅说明行为而不展示执行方式。本文提出编程式反向传播(Programming by Backprop, PBB),一种使模型能从训练中的说明性指令中习得程序性知识(即可复用行为)的训练范式。核心思想是将指令到行为的映射学习与新指令内化相分离。我们设计了两种基于该原则的PBB课程,在算法执行(从Python源码)和上下文无关语法文本生成两个领域进行控制实验,结果表明其优于单一数据混合训练。关键发现:单条指令可替代最多100个执行示例。尽管训练中指令执行可靠性低于上下文提示,但结果证明可通过PBB‘噪声式’地将程序性知识写入模型权重,对数据构建与安全性具有重要意义。
原文摘要 · Abstract (English)
Large language models (LLMs) are typically trained to acquire behaviours from demonstrations or experience, yet much of their training data is declarative: instructions, rules, and descriptions that specify behaviours without showing how to execute them. We introduce Programming by Backprop (PBB): a training regime that enables LLMs to acquire procedural knowledge (i.e., reusable behaviours) from declarative instructions encountered during training. With PBB, instructions in training data provide an opportunity to `program' specific behaviours into model weights. The core principle underpinning PBB is the separation of learning how instructions map to behaviour from internalising new instructions. We devise two distinct PBB curricula that leverage this principle. Through controlled experiments across two domains (algorithmic execution from Python source code and text generation from context-free grammars), we demonstrate the benefit of these curricula over training on a homogeneous data mixture. Crucially, PBB is highly sample efficient, with a single instruction substituting for up to 100 execution examples. Though execution of instructions in training data remains less reliable than when instructions are given in-context, our results demonstrate that procedural knowledge can be noisily `programmed' into LLMs through PBB, with important implications for data curation and safety.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。