Abstract
Mapping natural language instructions to programs that computers can process is a fundamental challenge. Existing approaches focus on likelihood-based training or using reinforcement learning to fine-tune models based on a single reward. In this paper, we pose program generation from language as Inverse Reinforcement Learning. We introduce several interpretable reward components and jointly learn (1) a reward function that linearly combines them, and (2) a policy for program generation. Fine-tuning with our approach achieves significantly better performance than competitive methods using Reinforcement Learning (RL). On the VirtualHome framework, we get improvements of up to 9.0% on the Longest Common Subsequence metric and 14.7% on recall-based metrics over previous work on this framework. The approach is data-efficient, showing larger gains in performance in the low-data regime. Generated programs are also preferred by human evaluators over an RL-based approach, and rated higher on relevance, completeness, and human-likeness.
Introduction
Teaching robots or software agents to follow human instructions—like "Go to the kitchen and put the groceries in the fridge"—requires mapping language to a precise sequence of programmatic commands. Traditionally, researchers use Reinforcement Learning (RL) to fine-tune these models. However, RL relies on a "reward signal" to tell the model if it's doing a good job. Designing this signal is notoriously difficult. Simple rewards (e.g., "did you finish the task?") are often too sparse for effective learning. Conversely, manually "shaping" rewards with penalties for specific errors creates a complex set of hyperparameters that are difficult to tune and often fail to capture the nuances of human-like behavior.
Methods
The authors propose using Maximum Entropy Inverse Reinforcement Learning (MaxEnt IRL) to address these challenges. Instead of manually weighting penalties and rewards, the model learns the underlying reward function by observing "expert" human-written programs.
The Framework
- Model Architecture: A standard encoder-decoder setup using LSTMs where the encoder processes text and the decoder predicts program steps (action-object-object triplets).
- Interpretable Reward Components: Five key features define a "good" program: Longest Common Subsequence (LCS) relative to the expert, Recall of mentioned objects, Irrelevance (penalizing unmentioned objects), Repetition (penalizing loops), and Executability within the simulator.
- The IRL Loop: The model iteratively updates the weights of these reward components to favor expert demonstrations over current predictions, then uses RL to improve program generation based on this learned, multi-faceted reward.
Results and Discussion
The study utilized the VirtualHome framework, a simulator for household tasks. Experiments were conducted on a full dataset (697 training samples) and smaller subsets (221 and 70 samples) to test data efficiency.
Key Findings
- Quantitative Gains: On the full dataset, the IRL model achieved a 9.0% improvement in LCS and a 14.7% improvement in recall-based metrics over previous RL baselines.
- Data Efficiency: The performance gap widened in low-data regimes. With only 70 training samples, the IRL approach maintained much higher program recall than RL, suggesting that learning the "intent" (the reward) is a more powerful signal than simple output mimicry.
- Human Preference: In blind studies via Amazon Mechanical Turk, humans preferred IRL-generated programs 57.6% of the time, rating them higher for relevance, completeness, and "human-likeness."
Conclusion
By reimagining program generation as an IRL problem, this research demonstrates that automated reward balancing is more effective than manual tuning. While the method depends on expert demonstrations and faces challenges in generalizing to entirely unseen environments, it provides a robust, data-efficient path toward more human-like robotic instruction following. Future work may explore the impact of adversarial reward components and broader environmental generalization.
Summary updated