Search is an important technique in program synthesis that allows for adaptive strategies such as focusing on particular search directions based on execution results. Several prior works have demonstrated that neural models are effective at guiding program synthesis searches. However, a common drawback of those approaches is the inability to handle iterative loops, higher-order functions, or lambda functions, thus limiting prior neural searches from synthesizing longer and more general programs. We address this gap by designing a search algorithm called LambdaBeam that can construct arbitrary lambda functions that compose operations within a given DSL. We create semantic vector representations of the execution behavior of the lambda functions and train a neural policy network to choose which lambdas to construct during search, and pass them as arguments to higher-order functions to perform looping computations. Our experiments show that LambdaBeam outperforms neural, symbolic, and LLM-based techniques in an integer list manipulation domain.
翻译:搜索是程序合成中的一项重要技术,它允许基于执行结果聚焦特定搜索方向等自适应策略。多项先前研究已证明神经模型能有效指导程序合成搜索。然而,这些方法的共同缺陷是无法处理迭代循环、高阶函数或lambda函数,从而限制了先前神经搜索方法合成更长且更通用程序的能力。我们通过设计名为LambdaBeam的搜索算法来填补这一空白,该算法能够构造任意lambda函数以组合给定领域特定语言(DSL)内的操作。我们为lambda函数的执行行为创建语义向量表示,并训练神经策略网络在搜索过程中选择需构建的lambda函数,将其作为参数传递给高阶函数以执行循环计算。实验表明,在整数列表操作领域,LambdaBeam的性能优于基于神经、符号及大语言模型(LLM)的现有技术。