Model-based Offline Quantum Reinforcement Learning

Simon Eisenmann, Daniel Hein, Steffen Udluft, Thomas A. RunklerarXiv 2024 · DOI

TL;DR

This paper introduces the first model-based offline quantum reinforcement learning (QRL) algorithm, utilizing variational quantum circuits (VQCs) to both model environment dynamics and represent control policies. By learning entirely from pre-recorded data, the approach bypasses the high costs of online trial-and-error and the communication bottlenecks currently hindering hybrid quantum-classical systems.

What Problem Does This Paper Address?

Reinforcement Learning (RL) is powerful but often impractical for real-world industrial applications because "online" learning requires expensive, potentially dangerous trial-and-error on physical hardware. "Offline" RL solves this by learning from pre-recorded datasets, but it faces a major hurdle: extrapolation error. When an agent encounters a state slightly outside its training data, its performance can collapse.

In the quantum realm, this is even more challenging. Most existing Quantum RL (QRL) methods are model-free and online, requiring constant, slow data transfers between classical and quantum hardware. The authors address these gaps by proposing a model-based offline approach. By training a quantum "surrogate model" (a digital twin of the environment), they can perform thousands of simulated "roll-outs" to optimize a policy without ever touching the real system or needing constant classical-quantum communication during the optimization phase.

Methods

The authors employ a two-stage architecture:

  1. The Surrogate Model: A VQC is trained to predict the next state of the environment given the current state and action. To overcome the limited "expressive power" of small quantum circuits, they use data re-uploading, a technique that interleaves data encoding with variational layers. This model is trained using standard gradient descent (Adam optimizer) on a classical computer.
  2. Policy Optimization: A second VQC represents the policy. Instead of using gradients (which are computationally expensive to calculate for VQCs), the authors use Particle Swarm Optimization (PSO)—a gradient-free, heuristic search—to find the best policy parameters. The "fitness" of a policy is determined by how well it performs during long roll-outs within the learned surrogate model.
Figure 2: Visualizing direct optimization of policy parameters using PSO in a model-based RL context.

Datasets

The algorithm was evaluated on the Cart-Pole balancing benchmark (Gymnasium CartPole-v1).

  • Training Data: 10,000 observations generated by a purely random policy. This is a "weak" dataset, making the task of learning a successful policy more difficult.
  • Validation/Testing: 1,000 data points each were reserved to evaluate the surrogate model's accuracy.

Key Insights and Ideas

  • Data Re-uploading is Essential: The authors found that adding even a single re-uploading step improved the surrogate model's prediction accuracy by more than an order of magnitude. Without it, the VQC simply lacks the complexity to model the environment.
  • "Good Enough" is Enough: While the quantum surrogate models had higher prediction errors than classical neural networks, they were still accurate enough to successfully train a policy. This suggests that QRL doesn't need to perfectly mimic classical performance to be functional.
  • Bypassing the Bottleneck: By using a model-based approach, the entire policy search can, in theory, happen within a quantum computer. This avoids the "data transfer bottleneck" where moving information between classical and quantum bits slows down the learning process.

Key Results

  • Success Rate: In 10 independent experiments, the algorithm successfully learned to solve the cart-pole task. Specifically, 7 out of 10 runs produced "perfect" policies that could balance the pole for the full 500-step horizon across all test start states.
  • Quantum vs. Classical Efficiency: The study confirmed that current VQCs are less data-efficient than classical neural networks. When training data was reduced to 5%, VQC performance degraded significantly more (8x worse) compared to classical NNs (3.5x worse).
  • Surrogate Accuracy: The VQC surrogate model was roughly 13 times less accurate than a comparable classical neural network, yet it remained robust enough for policy discovery.

Limitations and Future Work

The primary limitation is scalability. Due to the current state of quantum hardware, the experiments were conducted via simulation on classical computers using small-scale circuits (5 qubits).

The authors suggest that the next major step is Closed-form Model-based Policy Search. Since both the model and policy are VQCs, one could theoretically implement the entire reinforcement learning loop as a single large quantum circuit. This could allow for "quantum policy improvement" using algorithms like Grover’s adaptive search, potentially offering a definitive quantum advantage once hardware matures.

Figure 1: VQC for the cart-pole surrogate model. The design of the sketch is based on the works of [4] and [2].

Summary updated

BibTeX
@misc{eisenmann2024model,
  author = {Simon Eisenmann and Daniel Hein and Steffen Udluft and Thomas A. Runkler},
  title = {{Model-based Offline Quantum Reinforcement Learning}},
  year = {2024},
  eprint = {2404.10017},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2404.10017},
}
Figure