EMNLP Findings2021
Searching for More Efficient Dynamic Programs
Abstract
Computational models of human language often involve combinatorial problems.For instance, a probabilistic parser may marginalize over exponentially many trees to make predictions.Algorithms for such problems often employ dynamic programming and are not always unique.Finding one with optimal asymptotic runtime can be unintuitive, timeconsuming, and error-prone.Our work aims to automate this laborious process.Given an initial correct declarative program, we search for a sequence of semantics-preserving transformations to improve its running time as much as possible.To this end, we describe a set of program transformations, a simple metric for assessing the efficiency of a transformed program, and a heuristic search procedure to improve this metric.We show that in practice, automated search-like the mental search performed by human programmers-can find substantial improvements to the initial program.Empirically, we show that many speed-ups described in the NLP literature could have been discovered automatically by our system.β(X,I,K) += γ(X,Y,Z) * β(Y,I,J) * β(Z,J,K).β(X,I,K) += γ(X,Y) * word(Y,I,K).z += β(root,0,N) * len(N).start β(X,I,K) += tmp(I,J,X,Z) * β(Z,J,K).β(X,I,K) += γ(X,Y) * word(Y,I,K).z += β(root,0,N) * len(N).tmp(I,J,X,Z) += β(Y,I,J) * γ(X,Y,Z).fold(1, [1, 2]) elim(4) β(X,I,K) += γ(X,Y,Z) * β(Y,I,J) * β(Z,J,K).β(X,I,K) += γ(X,Y) * word(Y,I,K).
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
Lineage
Builds on1
Related papers
- Optimal Program Synthesis via Abstract InterpretationStephen Mell, Steve Zdancewic, Osbert BastaniPOPL 2024 · 6 citations
- Algorithms for Weighted Pushdown AutomataAlexandra Butoi, Brian DuSell, Tim Vieira, Ryan Cotterell et al.EMNLP 2022 · 2 citations
- DEPT: Large Language Model–Driven Automated Algorithm Design via Evolutionary Program TreesBin Chen, Shouliang Zhu, Beidan Liu, Yong Zhao et al.ICML 2026 · 3 citations
- Eco Search: A No-delay Best-First Search Algorithm for Program SynthesisThéo Matricon, Nathanaël Fijalkow, Guillaume LagardeAAAI 2025 · 1 citation
- Presynthesis: Towards Scaling Up Program Synthesis with Finer-Grained Abstract SemanticsRui Dong, Qingyue Wu, Danny Ding, Zheng Guo et al.PLDI 2026
