Training models to map natural language instructions to programs given target world supervision only requires searching for good programs at training time. Search is commonly done using beam search in the space of partial programs or program trees, but as the length of the instructions grows finding a good program becomes difficult. In this work, we propose a search algorithm that uses the target world state, known at training time, to train a critic network that predicts the expected reward of every search state. We then score search states on the beam by interpolating their expected reward with the likelihood of programs represented by the search state. Moreover, we search not in the space of programs but in a more compressed state of program executions, augmented with recent entities and actions. On the SCONE dataset, we show that our algorithm dramatically improves performance on all three domains compared to standard beam search and other baselines.
Fully Automated Task Management for Generation, Execution, and Evaluation: A Framework for Fetch-and-Carry Tasks with Natural Language Instructions in Continuous Space
Natural Language to Code Translation with Execution
Meta AI;Toyota Technological Institute at Chicago(芝加哥丰田技术研究院);Carnegie Mellon University(卡内基梅隆大学);University of Washington(华盛顿大学)
在大型程序语料库上预训练的代码生成模型在将自然语言转换为代码方面已经显示出巨大的成功(Chen et al.,2021; Austin等人,2021年; Li等人,2022年,除其他外)。虽然这些模型没有明确地结合程序语义(即,执行结果),在培训期间,他们能够对许多问题产生正确的解决方案。然而,选择一个正确的程序从每个问题的生成集仍然具有挑战性。在这项工作中,我们引入了基于执行结果的最小贝叶斯风险解码(MBR-EXEC)的程序选择,并表明它提高了自然语言到代码任务的预训练代码模型的Few-Shot性能。我们选择输出程序从一个产生的候选人集边缘化的程序实现,共享相同的语义。由于精确等价是棘手的,我们执行每个程序上的少量测试输入近似语义等价。跨数据集,执行或模拟执行显著优于不涉及程序语义的方法。我们发现,MBR-EXEC一贯改善所有执行不知情的选择方法,这表明它是一种有效的方法,自然语言的代码翻译。我们在github.com/facebookresearch/mbr-exec上开源我们的代码,在dl.fbaipublicfiles.com/mbr-exec/mbr-exec-release.zip上开源我们的数据