NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Efficient Bottom-Up Synthesis for Programs with Local Variables

Xiang Li, Xiangyu Zhou, Rui Dong, Yihong Zhang, Xinyu WangProceedings of the ACM on Programming Languages 2024

TL;DR

This paper introduces "lifted interpretation," a novel synthesis algorithm that efficiently handles programs with local variables, a common challenge in program synthesis. By simultaneously evaluating all programs from a grammar, their approach significantly speeds up the synthesis of web automation programs, outperforming existing methods.

What Problem Does This Paper Address?

Creating web automation programs, such as those for scraping data or filling forms, is notoriously difficult. A key challenge lies in synthesizing programs that correctly handle local variables, often introduced by loops or lambdas. Existing bottom-up synthesis techniques struggle with these local variables because they cannot effectively reduce the search space of programs containing them. This limitation makes synthesis slow and prevents automation of more complex tasks.

Methods

The core contribution is lifted interpretation, a new synthesis algorithm. Instead of evaluating programs one by one, it simultaneously interprets all programs derived from a grammar. This allows for the systematic enumeration of binding contexts for local variables, enabling the evaluation and reduction of program spaces that include local variables. This is achieved by:

  • Lifted Interpretation: A bidirectional approach that traverses the grammar top-down to generate reachable contexts and builds programs bottom-up given these contexts.
  • Finite Tree Automata (FTAs): Used to compactly represent equivalence classes of programs, where states encode context-output behaviors rather than just input-output behaviors.
  • Web Automation Instantiation: The approach is applied to web automation, creating a tool called ARBORIST. This involves defining a specific web automation language and adapting the lifted interpretation framework to it.

Datasets

The paper evaluates ARBORIST on a collection of web automation tasks. This includes:

  • 76 tasks previously used to evaluate WEBROBOT.
  • 55 newly curated tasks designed to be more challenging, involving modern websites with complex DOM structures and requiring a larger space of candidate selectors.
  • In total, 131 benchmarks were used.

Key Insights and Ideas

  • Local variables are a major bottleneck: The paper clearly articulates why handling local variables is difficult for existing synthesis techniques, highlighting the "chicken-and-egg" problem of needing program outputs to evaluate contexts and needing contexts to evaluate programs.
  • Simultaneous evaluation is key: The core idea of "lifted interpretation" – evaluating all programs from a grammar at once – is the breakthrough that allows for systematic context enumeration and efficient handling of local variables.
  • Candidate selectors matter: The research demonstrates that a rich set of candidate selectors is crucial for achieving high success rates in web automation synthesis, especially for complex tasks.
  • FTAs can encode context-output behaviors: The paper shows how FTAs can be extended to represent equivalence classes based on context-output behaviors, which is essential for dealing with local variables.

Key Results

  • High Success Rate: ARBORIST successfully synthesizes intended programs for 93.9% of the 131 benchmarks. This is a significant improvement over baselines (WEBROBOT and WEBROBOT-extended) which solve at most 68.7%.
  • Efficiency: ARBORIST is remarkably fast, with a median synthesis time of 0.02 seconds for solved benchmarks. This is significantly faster than baselines, which often time out.
  • Handling Complexity: ARBORIST excels on newly curated, challenging benchmarks, solving 96.4% of them, a 2.5x improvement over baselines.
  • Scalability: The system scales well with the number of candidate selectors, demonstrating that even with thousands of selectors, it can efficiently search program spaces.
  • LLM Performance: A case study using GPT-3.5 showed that current LLMs struggle to generate semantically correct web automation programs for these challenging benchmarks, highlighting the need for more robust synthesis techniques.

Limitations and Future Work

  • Language Limitations: ARBORIST failed to solve 8 benchmarks due to limitations in its web automation language, not necessarily due to the synthesis algorithm itself.
  • LLM Performance: The case study with LLMs indicates that current models are not yet capable of handling the complexity of these web automation tasks, suggesting a need for better prompting strategies or model architectures.
  • Future Work: The paper suggests that lifted interpretation could be applied to other data structures beyond FTAs and that further research into LLM prompting for program synthesis is warranted. The authors also highlight that their work opens new avenues for studying program synthesis problems, particularly those involving higher-order functions and data-dependent computations.

Summary updated

BibTeX
@inproceedings{li2024efficient,
  author = {Xiang Li and Xiangyu Zhou and Rui Dong and Yihong Zhang and Xinyu Wang},
  title = {{Efficient Bottom-Up Synthesis for Programs with Local Variables}},
  booktitle = {Proceedings of the ACM on Programming Languages},
  year = {2024},
  doi = {10.1145/3632894},
}
Figure