Cover tree Bayesian reinforcement learning

Nikolaos Tziortziotis, Christos Dimitrakakis, Konstantinos Blekas

Reinforcement Learning (RL) in continuous spaces often feels like a balancing act between two extremes. On one hand, you have simple parametric models (like linear regression) that are fast but often too "dumb" to capture complex environment dynamics. On the other, you have non-parametric powerhouses like Gaussian Processes (GPs) that can model almost anything but crawl to a halt as data accumulates due to their $O(n^3)$ complexity.

In their paper "Cover tree Bayesian reinforcement learning," Tziortziotis, Dimitrakakis, and Blekas introduce a "middle way" that offers the flexibility of non-parametric models with the efficiency of tree-based data structures.

TL;DR

The authors present CTBRL, a new algorithm for reinforcement learning in continuous state spaces. By combining cover trees for efficient spatial partitioning with a Bayesian piecewise-linear model, they create an agent that learns faster, stays more stable, and maintains logarithmic computational complexity—making it a viable alternative to computationally expensive Gaussian Processes.

What Problem Does This Paper Address?

Most RL agents need a model of their environment to plan effectively. In continuous worlds (like robotics), building this model is hard.

  1. Parametric models (e.g., global linear models) are computationally cheap but suffer from high bias; they can’t represent complex, non-linear transitions.
  2. Non-parametric models (e.g., Gaussian Processes) are highly flexible but don't scale. As the agent collects more experience, the math required to update a GP becomes prohibitively expensive.

The challenge is creating a model that is non-parametric (it grows with the data) but remains online-efficient (it doesn't slow down the agent as it learns).

Methods

The authors' solution, CTBRL, relies on three main pillars:

  1. Cover Trees: Unlike standard KD-trees, cover trees are specifically designed for high-dimensional metric spaces. They provide theoretical guarantees for fast ($O(\log t)$) insertion and neighbor lookups. CTBRL uses these to partition the state space on the fly as the agent explores.
  2. Generalized Context Trees: Each node in the cover tree represents a "context." The algorithm maintains a distribution over these contexts. Instead of picking just one leaf node to represent a state, it uses a Bayesian approach to weight models at different depths of the tree. Each node contains a multivariate linear-Gaussian model to predict the next state.
  3. Thompson Sampling: To handle the exploration-exploitation trade-off, the agent uses Thompson Sampling. Every episode, it draws a "sample" MDP from its posterior belief and treats it as the absolute truth, using Approximate Dynamic Programming (ADP)—specifically Least-Squares Policy Iteration (LSPI)—to find the best policy for that sampled world.

Datasets

The authors evaluated CTBRL on two classic continuous control benchmarks:

  • Inverted Pendulum: The goal is to balance a pole vertically by applying force to a cart. It’s a classic test of precision and stability.
  • Mountain Car: A car must gain enough momentum to drive up a steep hill. This is a "sparse reward" problem that tests an agent's ability to explore effectively.

They compared CTBRL against standard LSPI, a global linear Bayesian model (LBRL), and a Gaussian Process-based RL (GP-RL).

Key Insights and Ideas

  • Piecewise Linear is Plenty: You don't always need complex kernels. By stitching together many local linear models within a tree structure, you can approximate highly non-linear global dynamics with much simpler math.
  • Logarithmic Scaling: Because the cover tree allows for $O(\log t)$ updates, the agent's "thinking time" doesn't explode as it gains experience. This is a massive win over GPs.
  • Bayesian Robustness: The "shaded regions" in the paper's results show that CTBRL is significantly more stable than its competitors. By maintaining a full distribution over models (the context tree), the agent is less likely to be led astray by a single noisy observation.

Key Results

The experimental results (shown in Figure 3 of the paper) are striking:

  • Speed of Convergence: In the Mountain Car task, CTBRL discovered the optimal policy in significantly fewer rollouts than GP-RL or LSPI.
  • Stability: While LSPI occasionally failed to find a solution (around 5% of runs), CTBRL was remarkably consistent.
  • Efficiency: The authors proved that the online complexity of CTBRL is $O((m^3 + K_L m_L) \ln t)$, where $m$ is the state dimension. In practice, this meant the algorithm worked "out of the box" with far less hyper-parameter tuning than the GP-based methods.

Limitations and Future Work

  • The ADP Bottleneck: While the inference (building the tree) is fast, the planning step (ADP/LSPI) is still the most computationally heavy part of the loop. The authors suggest that more incremental or online versions of ADP could further speed things up.
  • Dimensionality: While cover trees handle high dimensions better than most, the "curse of dimensionality" still looms. The worst-case complexity for cover trees can still be exponential in the dimension of the state space if the data is distributed uniformly.
  • Continuous Actions: The current work focuses on discrete actions. Extending this to continuous action spaces (e.g., using "metric bandits") is a cited goal for future research.

Summary updated

BibTeX
@article{tziortziotis2014cover,
  author = {Nikolaos Tziortziotis and Christos Dimitrakakis and Konstantinos Blekas},
  title = {{Cover tree Bayesian reinforcement learning}},
  journal = {J. Mach. Learn. Res.},
  year = {2014},
  url = {https://openreview.net/forum?id=vuh1-7ht_XH},
}
Figure