Towards Mixed Optimization for Reinforcement Learning with Program Synthesis

Surya Bhupatiraju, Kumar Krishna Agrawal, Rishabh SingharXiv 2018

Abstract

Deep reinforcement learning has led to several recent breakthroughs, though the learned policies are often based on black-box neural networks. This makes them difficult to interpret and to impose desired specification constraints during learning. We present an iterative framework, MORL, for improving the learned policies using program synthesis. Concretely, we propose to use synthesis techniques to obtain a symbolic representation of the learned policy, which can then be debugged manually or automatically using program repair. After the repair step, we use behavior cloning to obtain the policy corresponding to the repaired program, which is then further improved using gradient descent. This process continues until the learned policy satisfies desired constraints. We instantiate MORL for the simple CartPole problem and show that the programmatic representation allows for high-level modifications that in turn lead to improved learning of the policies.

Introduction

Deep Reinforcement Learning (DRL) has achieved significant success in complex domains, yet the resulting policies remain opaque "black boxes." This lack of interpretability makes it challenging to understand agent decisions or guarantee safety constraints. When a neural policy fails, developers typically cannot directly edit its logic; instead, they must adjust reward functions and retrain, hoping for better convergence. This paper introduces MORL (Mixed Optimization for Reinforcement Learning) to bridge the gap between high-level symbolic reasoning and low-level neural optimization.

Methodology

The MORL framework employs an iterative four-step workflow to integrate programmatic logic into the RL training loop:

  1. Synthesis: A trained neural policy ($\pi_t$) is translated into a symbolic program ($P_t$) using synthesis techniques like VIPER or PIRL. This program exists within a Domain-Specific Language (DSL) and mimics the network's behavior.
  2. Repair: The symbolic program is analyzed and modified—either manually by an expert or via automated tools—to satisfy safety constraints or correct flawed logic.
  3. Imitation: The repaired program ($P'_t$) serves as an oracle. Behavioral cloning is used to distill this logic back into a new neural policy ($\pi'_t$).
  4. Policy Optimization: The distilled neural policy is fine-tuned using gradient-based RL (e.g., TRPO) to optimize performance.
The MORL framework: an iterative loop between neural policies and symbolic programs.

The framework was evaluated on the CartPole-v0 environment. While simple, it demonstrates how programmatic intervention can steer learning trajectories. For instance, a failing policy can be "fixed" by ensuring the cart moves in the direction the pole is leaning, a high-level logic change easily expressed in code.

Results and Discussion

Experiments demonstrate that programmatic intervention significantly accelerates learning and improves performance.

  • Convergence Speed: Policies initialized from "Near-optimal" or "Intermediate" repaired programs converged much faster than those starting from a "Worst" (random) state.
  • Performance Gains: Manual repair of a "Worst" policy (starting reward ~9.28) to an "Intermediate" program immediately boosted reward to 104.0. Further refinement to a "Near-optimal" program achieved the environment maximum of 200.0.
  • Synergy: Fine-tuning via TRPO after distillation allowed agents to continue improving, showing that symbolic and gradient-based methods are complementary.
Learning curves comparing policies initialized from different programmatic states. Repaired policies show significantly faster convergence.

Conclusion and Future Work

MORL demonstrates that interpretability can be a powerful training tool rather than just a post-hoc analysis. By using programs as a debugging interface, developers can push agents out of local minima that gradient descent might struggle to escape.

Future work will focus on scaling MORL to high-dimensional tasks through more robust DSLs and automated program repair using SAT/SMT solvers. This would enable formal verification and repair against safety specifications without requiring a human-in-the-loop.

Summary updated

BibTeX
@misc{bhupatiraju2018towards,
  author = {Surya Bhupatiraju and Kumar Krishna Agrawal and Rishabh Singh},
  title = {{Towards Mixed Optimization for Reinforcement Learning with Program Synthesis}},
  year = {2018},
  eprint = {1807.00403},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1807.00403},
}
Figure