Faster and Safer Training by Embedding High-Level Knowledge into Deep Reinforcement Learning

Haodi Zhang, Zihang Gao, Yi Zhou, Hao Zhang 0071, Kaishun Wu, Fangzhen LinarXiv 2019

Abstract

Deep reinforcement learning (DRL) often suffers from slow training times, brittle behavior, and unsafe "cold starts" where random exploration leads to catastrophic failures. This paper introduces Rule-interposing Learning (RIL), a framework that embeds high-level, human-readable symbolic rules into Deep Q-Networks (DQN). By using heuristic rules to guide early exploration and safety rules to block dangerous actions, RIL significantly accelerates training and ensures safety without requiring complex manual interventions.

Introduction

Deep reinforcement learning has achieved massive success in complex environments with large state spaces, such as Atari games or Go. However, DRL is notoriously data-hungry and slow to train. At the beginning of training, agents suffer from a "cold start" phase where they act completely randomly to explore their environment.

In simulated video games, dying repeatedly during this random exploration phase is acceptable. However, in real-world applications like robotics or critical decision-support systems, a random action could destroy hardware or cause catastrophic harm. Furthermore, DRL models are typically "black boxes," making it incredibly difficult to inject basic human common sense into the agent. The authors tackle this by creating a bridge between explicit, symbolic human knowledge and implicit, neural-network-based learning.

Methods

The authors propose Rule-interposing Learning (RIL), a framework that integrates a symbolic knowledge base directly into the DQN training loop.

The knowledge base consists of simple "If-Then" rules: if a specific environmental condition is met, a specific set of actions is recommended. During training, RIL evaluates the DQN's chosen action against these rules. The framework uses an interposing probability mechanism, $P_t = p_0 \cdot \gamma^t$, to decide whether a rule should override the DQN's action at timestamp $t$.

The authors implement two distinct types of rules using this mechanism:

  1. Acceleration Rules ($\gamma < 1$): These act as training wheels. They are highly active early in training to guide the agent toward useful behaviors. Because $\gamma < 1$, the probability of the rule intervening decays over time, smoothly handing control back to the DQN as it becomes competent.
  2. Safety Rules ($p_0 = 1, \gamma = 1$): These act as permanent guardrails. They never decay. If the DQN attempts an action that violates a safety rule, the framework rejects the action and forces a safe alternative, ensuring the agent never explores catastrophic states.

Experimental Setup

The authors evaluated their framework on four classic simulated game environments: Flappy Bird, Space War (Aircraft Shooting), Breakout (Atari), and Grid World.

Custom symbolic rule sets were authored for each specific game environment to test the RIL framework's ability to accelerate learning and maintain safety constraints.

Key Results and Insights

The RIL framework demonstrated massive improvements in both training speed and overall performance compared to a baseline DQN:

  • Breakout: RIL saved 31.97% in training time to reach a target reward and improved the reward by 107.55% within a fixed training time limit.
  • Space War: RIL improved the reward by 81.82% in a fixed time window.
  • Flappy Bird: RIL saved 20.00% in training time.
  • Grid World (Safety): While the baseline DQN frequently fell into traps during early training, the RIL agent equipped with a single safety rule never fell into a trap, maintaining a completely safe learning trajectory from episode one.

Key Insights

  • Bypassing Useless Exploration: By using acceleration rules, the agent is immediately guided toward high-reward states, preventing the network from wasting thousands of episodes randomly flailing.
  • Solving the "Cold Start" Danger: Safety rules strictly prevent catastrophic errors even when the underlying neural network is completely untrained, a critical step for physical robotics.
  • Rule Internalization: As the DQN trains, it naturally internalizes the behaviors suggested by rules. Eventually, the neural network learns to approximate and even exceed the performance of the hardcoded heuristics.
  • Knowledge Transferability: Because rules are written in high-level symbolic logic, they are highly interpretable and can be easily tweaked or transferred between similar environments.

Limitations and Future Work

The current framework relies on human experts to manually author symbolic rules. If a human provides poor or conflicting rules, it could potentially bottleneck the agent's learning.

Future research aims to "close the loop" by using DRL to generate or update high-level rules. This would allow the system to extract learned knowledge from the neural network's black box and translate it back into interpretable, shareable symbolic logic.

Summary updated

BibTeX
@misc{zhang2019faster,
  author = {Haodi Zhang and Zihang Gao and Yi Zhou and Hao Zhang and Kaishun Wu and Fangzhen Lin},
  title = {{Faster and Safer Training by Embedding High-Level Knowledge into Deep Reinforcement Learning}},
  year = {2019},
  eprint = {1910.09986},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1910.09986},
}
Figure