Progress Constraints for Reinforcement Learning in Behavior Trees

Finn Rietz, Mart Kartašev, Johannes A. Stork, Petter Ögren

Abstract

Behavior Trees (BTs) provide a structured and reactive framework for decision-making, commonly used to switch between sub-controllers based on environmental conditions. Reinforcement Learning (RL), on the other hand, can learn near-optimal controllers but sometimes struggles with sparse rewards, safe exploration, and long-horizon credit assignment. Combining BTs with RL has the potential for mutual benefit: a BT design encodes structured domain knowledge that can simplify RL training, while RL enables automatic learning of the controllers within BTs. However, naive integration of BTs and RL can lead to some controllers counteracting other controllers, possibly undoing previously achieved subgoals, thereby degrading the overall performance. To address this, we propose progress constraints, a novel mechanism where feasibility estimators constrain the allowed action set based on theoretical BT convergence results. Empirical evaluations in a 2D proof-of-concept and a high-fidelity warehouse environment demonstrate improved performance, sample efficiency, and constraint satisfaction, compared to prior methods of BT-RL integration.

The Challenge of Integrating BTs and RL

Behavior Trees (BTs) are highly effective for reactive task-switching in robotics and gaming. By organizing tasks into a hierarchy of conditions and actions, they allow agents to switch fluidly between behaviors, such as moving to an item, grasping it, and then delivering it to a goal. Traditionally, human experts design the controllers for these individual behaviors. Reinforcement Learning (RL) offers a way to automatically learn these controllers, promising more robust performance in complex environments.

Combining the two seems like a perfect match: the BT breaks the long-horizon problem into manageable subtasks, and RL solves the subtasks. However, a major problem arises when integrating them naively: RL controllers act greedily to maximize their specific subtask reward and often ignore the broader context of the BT. For example, a "Move to Goal" RL controller might accidentally drop the item that the "Grasp" controller just picked up, forcing the system into an endless, chattering loop of picking up and dropping the item. This research tackles the challenge of constraining RL training so that it respects the logical progression dictated by the overarching BT.

A Behavior Tree for a warehouse mobile manipulation task, illustrating the hierarchy of subgoals like "Item placed" and "Safe from forklift".

Methodology: Progress-Constrained BT-RL

To prevent RL controllers from undoing progress, the authors propose Progress-Constrained Behavior Tree Reinforcement Learning (CBTRL). The core of this approach lies in identifying and enforcing "convergence sets."

BT Convergence Analysis

The authors use theoretical BT convergence properties to define regions of the state space that must remain invariant once a subgoal is achieved. For instance, once an item is grasped, the "Have Item" state must remain true for all subsequent actions in the delivery sequence. These regions are treated as safety constraints for the RL agent.

Feasibility Estimation and Action Masking

Because constraint violations can be delayed—such as entering a trajectory that inevitably leads to a collision—simple immediate-action masking is insufficient. The authors train a feasibility estimator using dynamic programming to predict if an action will eventually lead to leaving the safe convergence set.

Abstract representation of state space convergence sets (Ω) and feasibility trajectories (π). Checkmarks indicate valid progress-preserving actions, while red Xs denote constraint violations.

During RL training (using standard algorithms like PPO), the action space is dynamically masked. Any action that the feasibility estimator flags as violating a progress constraint is blocked. This ensures that the agent learns to operate strictly within the bounds that preserve previously achieved subgoals.

Experimental Evaluation

The method was evaluated in two simulated environments:

  1. 2D Goal-Reach: A point-mass agent navigating to a goal while avoiding a slippery slope that leads to an unsafe region.
  2. Warehouse Environment: A high-fidelity simulation featuring a mobile manipulator delivering boxes while avoiding a dynamic forklift with unknown dynamics.

Key Results

  • Higher Success Rates: In the warehouse environment, CBTRL achieved a 93% success rate, compared to 78% for standard unconstrained BT-RL and 83% for a reward-penalty baseline.
  • Zero Violations: CBTRL maintained 0% constraint violations (e.g., dropping the item or crashing). In contrast, the baseline BT-RL violated the "Have Item" constraint in over 50% of episodes.
  • Faster Convergence: In the warehouse "Place" task, CBTRL converged to a stable policy in roughly 13 million steps, significantly faster than the ~22 million steps required by the unconstrained baseline.

Discussion and Insights

A key insight from this work is that constraints actually speed up learning. By masking out actions that undo progress, the RL agent's search space is drastically reduced, allowing it to find the optimal policy more efficiently. Furthermore, the authors found that applying constraints only at inference time to a naively trained agent causes massive failures; the agent must learn to operate within those restrictions during the training phase itself.

While the method relies on exploratory data to train robust feasibility estimators, the overhead is low, requiring only about 5% additional data compared to the RL policy training. Future work may explore model-based progress constraints to further reduce data dependency when environment dynamics are partially known.

Summary updated

BibTeX
@misc{rietz2026progress,
  author = {Finn Rietz and Mart Kartašev and Johannes A. Stork and Petter Ögren},
  title = {{Progress Constraints for Reinforcement Learning in Behavior Trees}},
  year = {2026},
  eprint = {2602.06525},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2602.06525},
}
Figure