Abstract
Our goal is to learn a semantic parser that maps natural language utterances into executable programs when only indirect supervision is available: examples are labeled with the correct execution result, but not the program itself. Consequently, we must search the space of programs for those that output the correct result, while not being misled by spurious programs: incorrect programs that coincidentally output the correct result. We connect two common learning paradigms, reinforcement learning (RL) and maximum marginal likelihood (MML), and then present a new learning algorithm that combines the strengths of both. The new algorithm guards against spurious programs by combining the systematic search traditionally employed in MML with the randomized exploration of RL, and by updating parameters such that probability is spread more evenly across consistent programs. We apply our learning algorithm to a new neural semantic parser and show significant gains over existing state-of-the-art results on a recent context-dependent semantic parsing task.
Introduction: The Challenge of Spurious Programs
The primary objective of semantic parsing is to translate natural language instructions into executable code. In many practical applications, we lack a direct mapping from sentences to code. Instead, we rely on weak supervision, where only the final world state resulting from a program's execution is known.
The central hurdle in this setting is the spurious program problem. A model may generate a program that is logically incorrect but happens to produce the correct final state by coincidence. For example, if tasked to "Move the man in the yellow hat," a model might simply move "Person #2." If Person #2 happens to be the man in the yellow hat in that specific instance, the model receives positive feedback for a program that fails to generalize to other contexts where the man in the yellow hat is in a different position.
Standard algorithms often fall into a "vicious cycle" where they latch onto these simpler, spurious programs, preventing the model from ever learning the true underlying language logic.
Methodology: The RANDOMER Algorithm
To address these challenges, we introduce RANDOMER, a learning algorithm that bridges the gap between Reinforcement Learning (RL) and Maximum Marginal Likelihood (MML). RANDOMER incorporates two key innovations:
- Randomized Beam Search: While standard MML relies on deterministic beam search and RL uses random sampling, RANDOMER employs an $\epsilon$-greedy randomized beam search. By occasionally injecting noise into the search process, the model can discover low-probability correct programs that deterministic methods would overlook.
- Meritocratic Parameter Updates: Standard MML updates are proportional to a program's current probability, often leading to a "rich get richer" effect for spurious programs. We introduce a $\beta$-smoothed update rule that distributes probability more evenly across all programs that yield the correct result, preventing the model from over-committing to a single potentially incorrect path.
Additionally, the parser utilizes a STACK-based execution history. By embedding the actual state of the program's execution stack rather than just previous tokens, the model becomes more robust to complex object referencing.
Experimental Results
We evaluated RANDOMER on the SCONE (Sequential Context-dependent Execution) dataset, which includes three domains: ALCHEMY (chemical manipulation), TANGRAMS (geometric shapes), and SCENE (human entities on a stage).
RANDOMER achieved new state-of-the-art results across all domains. Notably, in the highly complex SCENE domain, RANDOMER reached 46.2% accuracy, a massive improvement over the previous best of 14.7%. Furthermore, the meritocratic update ($\beta=0$) allowed the model to reach 60% accuracy on the ALCHEMY domain nearly twice as fast as standard MML approaches. While standard RL (REINFORCE) failed to make progress in the SCENE domain due to sparse rewards, RANDOMER’s hybrid approach proved highly effective.
Conclusion
By combining the systematic search of MML with the randomized exploration of RL, RANDOMER effectively mitigates the spurious program problem in weakly supervised semantic parsing. Our results demonstrate that the choice of exploration strategy and gradient weighting is critical for learning from indirect feedback. Future work will explore annealing the $\beta$ parameter and scaling these methods to even more complex, discrete program spaces.
Summary updated