Skip to main content
QUICK REVIEW

[论文解读] HYSYNTH: Context-Free LLM Approximation for Guiding Program Synthesis

Shraddha Barke, Emmanuel Anaya Gonzalez|arXiv (Cornell University)|May 24, 2024
Parallel Computing and Optimization Techniques被引用 5
一句话总结

HYSYNTH 使用 LLM 完成来学习一个上下文无关代理(PCFG),该代理引导自底向上的程序合成器,在 Arc、Tensor 和 String 任务中表现优于无引导搜索、仅 LLM 采样以及领域基线。

ABSTRACT

Many structured prediction and reasoning tasks can be framed as program synthesis problems, where the goal is to generate a program in a domain-specific language (DSL) that transforms input data into the desired output. Unfortunately, purely neural approaches, such as large language models (LLMs), often fail to produce fully correct programs in unfamiliar DSLs, while purely symbolic methods based on combinatorial search scale poorly to complex problems. Motivated by these limitations, we introduce a hybrid approach, where LLM completions for a given task are used to learn a task-specific, context-free surrogate model, which is then used to guide program synthesis. We evaluate this hybrid approach on three domains, and show that it outperforms both unguided search and direct sampling from LLMs, as well as existing program synthesizers.

研究动机与目标

  • 激发混合程序综合,以克服 LLM 在领域特定 DSL 上的精度局限。
  • 提出一个从 LLM 完成中学习的上下文无关代理模型,以引导自底向上的搜索。
  • 在 Arc 网格谜题、张量操作和字符串操作上实现并评估该方法。
  • 证明 LLM 引导的综合在效率和成功率上优于基线。

提出的方法

  • 从给定 DSL 与任务中采样 LLM 的完成结果,并收集一组候选程序。
  • 将完成结果解析为程序集合,并通过最大似然估计(带平滑)学习 PCFG,以近似 LLM 分布。
  • 将 PCFG 转换为加权 CFG,以引导自底向上的搜索按成本递增枚举程序。
  • 使用可重复使用子表达式并缓存评估结果的自底向上的搜索算法,以裁剪观测等价程序。
  • 在 Arc 中,应用分治策略分别合成变换和过滤器以加速搜索。
  • 与基线基线(领域求解器 Arga、Probe、TFCoder)以及消融实验(无搜索、无引导搜索)进行比较。
(a) Arc
(a) Arc

实验结果

研究问题

  • RQ1从 LLM 完成中学习的上下文无关代理模型是否能够在多个 DSL 领域有效地引导自底向上的程序综合?
  • RQ2相较于无引导搜索和纯 LLM 采样,LLM 指导的 PCFG 加权对搜索效率和成功率有何影响?
  • RQ3将 HYSYNTH 应用于 Arc、Tensor 和 String 任务时的领域特定收益与局限性是什么?

主要发现

  • 混合方法在 299 个任务中总体解决了 58%,优于无引导搜索(40%)和无搜索的 LLM(2%)。
  • 在 Arc、Tensor 和 String 中,HYSYNTH 分别优于领域基线 Arga、TFCoder 和 Probe。
  • LLM 指导的 PCFG 可以缩小搜索空间(例如,将激发性 Arc 示例的搜索空间从约 450K 程序缩减到约 220K),在有 LLM 指导的情况下大约一分钟内得到解。
  • 在 Tensor 域,LLM 的引导不仅加快搜索,还消除了对用户提供非常规常量的需求。
  • 使用 100 个 LLM 样本来学习 PCFG 在各领域提供强劲性能,较少的样本数量仍然优于基线。
  • 总体而言,HYSYNTH 表明任务特定的上下文无关近似可以利用 LLM 的直觉,同时保持高效的自底向上搜索。
(b) Tensor
(b) Tensor

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。