Abstract: Standard reinforcement learning (RL) typically assumes that episode termination is governed by fixed environment rules or time limits. In practice, however, agents often interact with external observers—such as humans—who may terminate an episode early based on latent, non-Markovian preferences or safety thresholds. This paper introduces the Termination Markov Decision Process (TerMDP), a framework designed to learn from these exogenous termination signals. We present TermPG, a scalable deep RL algorithm that estimates unobserved costs from termination events and uses these estimates to guide policy learning. Evaluated on the MinAtar benchmark and a novel 'Backseat Driver' simulation, TermPG demonstrates significant performance gains over standard RL baselines and successfully aligns agent behavior with human feedback.
Introduction
In real-world applications, RL agents do not operate in isolation. A human passenger in an autonomous vehicle might intervene if the ride becomes uncomfortable, or a user might terminate a session with a recommendation engine if the suggestions are irrelevant. Standard RL frameworks struggle with these scenarios because the termination criteria are often "latent" (the agent does not know the human's internal cost function) and "non-Markovian" (the decision to stop often depends on a sequence of behaviors over time rather than a single state).
This paper addresses these challenges by proposing that agents should learn preferences directly from termination events. We introduce the Termination Markov Decision Process (TerMDP), where an external observer—the "Terminator"—can end an episode based on the agent's history.
The TerMDP Framework
In a TerMDP, the termination probability is modeled as a function of accumulated, unobserved costs. Unlike standard MDPs, the agent must infer these costs from the binary signal of whether an episode continues or ends. A key insight of this work is that "silence is golden": every step an agent takes without being terminated provides informative evidence that its current trajectory has a low latent cost.
Practical Implementation: TermPG
To solve TerMDPs in complex environments, we propose TermPG, a scalable deep RL method. TermPG utilizes an ensemble of neural networks to estimate latent costs and their associated uncertainty from rollout data. The algorithm incorporates two primary innovations:
- State Augmentation: The agent's state is expanded to include the predicted accumulated cost, effectively converting the non-Markovian problem into a Markovian one.
- Dynamic Discounting: Instead of a fixed discount factor, the agent employs a factor that adjusts based on the predicted probability of termination. This encourages the agent to prioritize "staying alive" to collect future rewards.
Experimental Evaluation
We evaluated TermPG on several benchmarks, including a simplified Atari suite (MinAtar) and a custom Unity-based driving simulation called Backseat Driver (BDr). In the BDr environment, we tested the agent against both synthetic cost functions (e.g., avoiding coins) and real human termination data collected from five supervisors instructed to stop the agent upon experiencing discomfort.
Key Results
TermPG significantly outperformed standard Policy Gradient (PG) methods and reward-shaping baselines. In the Backseat Driver task, TermPG doubled the reward compared to the best baseline. On MinAtar games, the improvements were even more pronounced, with a 410% increase in reward for Breakout.
Crucially, the method successfully learned to navigate using real human termination data, demonstrating its ability to align with subjective and messy human preferences without an explicitly defined reward function for discomfort.
Conclusion and Future Work
TerMDP provides a robust framework for learning from exogenous feedback. By treating termination as a learning signal rather than just an end-of-episode marker, agents can more efficiently learn to avoid behaviors that lead to human intervention. Future work will focus on relaxing the linearity assumptions of the current cost model and improving the computational efficiency of the ensemble-based cost estimation, which currently adds approximately 67% overhead to training time.
Summary updated