Sequence generation applications require satisfying semantic constraints, such as ensuring that programs are correct, using certain keywords, or avoiding undesirable content. Language models, whether fine-tuned or prompted with few-shot demonstrations, frequently violate these constraints, and lack a mechanism to iteratively revise their outputs. Moreover, some powerful language models are of extreme scale or inaccessible, making it inefficient, if not infeasible, to update their parameters for task-specific adaptation. We present Self-Correction, an approach that decouples an imperfect base generator (an off-the-shelf language model or supervised sequence-to-sequence model) from a separate corrector that learns to iteratively correct imperfect generations. To train the corrector, we propose an online training procedure that can use either scalar or natural language feedback on intermediate imperfect generations. We show that Self-Correction improves upon the base generator in three diverse generation tasks - mathematical program synthesis, lexically-constrained generation, and toxicity control - even when the corrector is much smaller than the base generator.
翻译:序列生成应用程序要求满足语义限制,例如确保程序正确,使用某些关键词,或避免不可取的内容。语言模型,无论是微调还是通过微弱的演示推动的,都经常违反这些限制,缺乏反复修改其产出的机制。此外,一些强大的语言模型规模极大,或者无法获取,这使得更新其具体任务适应参数的工作效率低下,甚至不可行。我们提出自我校正,这种方法将一个不完善的基础生成器(现成语言模型或受监督的顺序到顺序模型)从一个单独的校对器中分离出来,该校正器学会迭代地纠正不完善的几代人。为了培训正确者,我们提议了一个在线培训程序,该程序可以对中不完善的几代人使用标语或自然语言反馈。我们表明,自我校正使基本生成器在三种不同的一代任务(数学组合、经法律约束的生成和毒性控制)中得到了改进,即使校正器比基本生成器小得多。