[Paper Review] Program Synthesis with Pragmatic Communication
This paper introduces a pragmatic program synthesizer that resolves ambiguity in user-provided specifications by modeling the synthesis task as rational communication, using recursive reasoning to infer which program a user likely intended. By treating the specification as a pragmatic utterance, the system outperforms literal and handcrafted prior-based approaches in user studies, with end-users communicating more efficiently with the pragmatic model, demonstrating that principled communication models can improve human-machine interaction in program synthesis without requiring training data.
Program synthesis techniques construct or infer programs from user-provided specifications, such as input-output examples. Yet most specifications, especially those given by end-users, leave the synthesis problem radically ill-posed, because many programs may simultaneously satisfy the specification. Prior work resolves this ambiguity by using various inductive biases, such as a preference for simpler programs. This work introduces a new inductive bias derived by modeling the program synthesis task as rational communication, drawing insights from recursive reasoning models of pragmatics. Given a specification, we score a candidate program both on its consistency with the specification, and also whether a rational speaker would chose this particular specification to communicate that program. We develop efficient algorithms for such an approach when learning from input-output examples, and build a pragmatic program synthesizer over a simple grid-like layout domain. A user study finds that end-user participants communicate more effectively with the pragmatic program synthesizer over a non-pragmatic one.
Motivation & Objective
- To address the ambiguity in program synthesis where multiple programs satisfy the same specification.
- To model program synthesis as a rational communication process, inspired by pragmatics in computational linguistics.
- To develop an inductive bias derived from speaker rationality rather than handcrafted priors or data-driven learning.
- To evaluate whether pragmatic reasoning improves communication efficiency between end-users and program synthesizers.
- To build a scalable inference mechanism for pragmatic program synthesis in a controlled domain using version space algebra.
Proposed method
- Formalizes program synthesis as a recursive pragmatic communication game using literal listener (L₀), pragmatic speaker (S₁), and pragmatic listener (L₁) models.
- Uses the speaker model S₁(D|prog) ∝ Pₗ₀(prog|D) to generate specifications that are most likely to communicate a given program.
- Derives the pragmatic listener L₁(prog|D) ∝ Pₛ₁(D|prog) as the synthesis model, incorporating rationality into program selection.
- Employs version space algebra to efficiently compute probabilities over a small, finite program and specification space.
- Implements an incremental inference algorithm to compute exact posterior probabilities without sampling or approximation.
- Validates the model through a user study on Amazon Mechanical Turk using a grid-based layout domain.
Experimental results
Research questions
- RQ1Can a program synthesizer that models pragmatic communication outperform literal or prior-based synthesizers in user communication efficiency?
- RQ2How do end-users adapt their specification strategies when interacting with a pragmatic versus a literal listener?
- RQ3To what extent does a principled, non-data-driven inductive bias based on rational communication improve synthesis outcomes?
- RQ4Does the pragmatic listener model align with human intuitive assumptions about listener rationality?
- RQ5Can version space algebra enable efficient exact inference for pragmatic program synthesis in a controlled domain?
Key findings
- Human participants used significantly fewer symbols to communicate with the pragmatic listener (L₁) than with the literal listener (L₀), with a mean difference of 8.4 symbols (p < .0001).
- The pragmatic listener (L₁) achieved communication efficiency comparable to that of a human listener, with no significant difference in symbol use (p = .3).
- The pragmatic synthesizer (S₁-L₁) required a mean of 3.34 utterances to achieve successful communication, outperforming the S₁-Lₚ pair (mean 3.8 utterances) using a crafted prior.
- Users adapted their specification strategies by using fewer pebbles when communicating with the pragmatic system, suggesting better inference of pattern size and structure.
- The pragmatic model S₁-L₁ was indistinguishable from human-human communication in efficiency, indicating alignment with human pragmatic expectations.
- The system demonstrated that principled, first-principles inductive biases from pragmatics can outperform handcrafted priors without requiring real user interaction data.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.