Effective sketching methods for value function approximation

Yangchen Pan, Erfan Sadeqi Azer, Martha White

Abstract

Reinforcement learning often relies on high-dimensional feature representations to approximate complex value functions. While algorithms like Least-Squares Temporal Difference (LSTD) offer superior sample efficiency, their $O(d^2)$ computational complexity per step makes them impractical for large feature dimensions $d$. This paper explores the use of sketching—random projections—to mitigate this cost. We demonstrate that traditional two-sided sketching of features introduces significant estimation bias. In response, we propose left-sided sketching (LSTD-L) and an accelerated gradient variant (ATD-L) that sketch only the constraints of the linear system. Our results across multiple benchmark domains show that these methods achieve the efficiency of dimensionality reduction while maintaining the accuracy of high-dimensional representations.

Introduction

In reinforcement learning (RL), the goal is often to learn a value function that maps states to expected returns. Linear value function approximation is a common approach, where the value function is represented as a weighted sum of features: $\hat{v}(s) = w^\top \phi(s)$. To capture complex dynamics, researchers frequently use "overparameterized" representations such as Radial Basis Functions (RBFs) or Tile Coding, leading to feature vectors with thousands of dimensions.

The Least-Squares Temporal Difference (LSTD) algorithm is a powerful tool for learning these weights, but it requires maintaining and inverting a $d \times d$ matrix, where $d$ is the number of features. This $O(d^2)$ per-step cost is a significant barrier for real-time applications or large-scale problems. While sketching has been proposed as a solution, simply reducing the dimensionality of the features (two-sided sketching) often leads to poor performance due to high estimation bias.

Methodology: From Feature Sketching to System Sketching

The core innovation of this work is the shift from sketching the features to sketching the linear system itself.

The Problem with Two-Sided Sketching

Previous methods applied a random matrix $S$ to the features $\phi$, effectively learning in a lower-dimensional space $k$. While computationally efficient, this "two-sided" approach forces the weight vector into a lower-dimensional subspace, which can destroy the representational power of the original features. This is particularly problematic for sparse representations like Tile Coding, where the "hashing" effect of the sketch can lose critical structural information.

Left-Sided Sketching (LSTD-L)

Instead of reducing the feature dimension, we propose applying a random sketching matrix $S$ only to the left side of the LSTD system: $$SAw = Sb$$ Here, $A$ is the $d \times d$ matrix of feature correlations and $b$ is the $d$-dimensional target vector. By sketching only the constraints, we reduce the number of equations from $d$ to $k$, but the weight vector $w$ remains in the original $d$-dimensional space. Crucially, if the original system $Aw=b$ has a solution, that solution also satisfies the sketched system $SAw=Sb$. This makes the approach inherently unbiased compared to feature-projection methods.

ATD-L: Accelerated Gradient TD

To further improve efficiency, we integrate left-sided sketching into a quasi-Newton framework called Accelerated Gradient TD with Left-sided Sketching (ATD-L). This algorithm uses the sketched matrix to approximate the curvature of the optimization landscape, allowing for more effective step-size selection. ATD-L achieves a per-step complexity of $O(dk)$, providing a middle ground between the $O(d)$ cost of simple TD learning and the $O(d^2)$ cost of full LSTD.

Experimental Evaluation

We evaluated our proposed methods on four benchmark RL domains: Mountain Car, Puddle World, Acrobot, and Energy Allocation. We tested various feature representations, including RBFs and Tile Coding, and compared several sketching families: Gaussian, Count-sketch, and Hadamard sketches.

Figure 1: RMSE performance of various sketching methods (k=50) compared to the LSTD baseline across Mountain Car and Puddle World using Tile Coding and RBF features.

Key Results

As shown in Figure 1, while the full LSTD algorithm (pink line) remains the most accurate, the sketched methods (Gaussian, Hadamard, Count-sketch, and "combine") perform remarkably well and consistently outperform traditional feature-sketching baselines.

  1. Accuracy and Bias: LSTD-L and ATD-L successfully avoid the heavy bias seen in two-sided sketching. In many cases, they converge to solutions with errors comparable to the full LSTD algorithm.
  2. Feature Density: Sketching proved more effective for "dense" features like RBFs than for "sparse" features like Tile Coding. In RBF representations, many features are active simultaneously, providing redundant information that the sketch can compress without significant loss.
  3. Computational Speed: In the Acrobot domain, ATD-L demonstrated massive speedups. While a previous state-of-the-art method (ATD-SVD) took 685 seconds for a single run, ATD-L completed the same task in just 17 seconds, nearly matching the speed of simple TD learning.

Discussion and Future Work

Our findings suggest that left-sided sketching is a robust and efficient alternative for high-dimensional RL. One notable advantage of ATD-L is its reduced sensitivity to the learning rate ($\alpha$), a parameter that is notoriously difficult to tune in standard TD learning.

Future research could explore more sophisticated ways to handle the under-constrained nature of the sketched system, perhaps through advanced regularization techniques. Additionally, while $O(dk)$ is a significant improvement, further optimizations could leverage the inherent sparsity of matrices like $A$ in certain domains to push computational costs even lower.

Conclusion

By rethinking how random projections are applied to linear systems in RL, we have developed a suite of algorithms that balance computational efficiency with representational accuracy. Left-sided sketching provides a theoretically sound, unbiased way to scale LSTD-style learning to the high-dimensional feature spaces required for complex tasks.

Summary updated

BibTeX
@inproceedings{pan2017effective,
  author = {Yangchen Pan and Erfan Sadeqi Azer and Martha White},
  title = {{Effective sketching methods for value function approximation}},
  booktitle = {Conference on Uncertainty in Artificial Intelligence},
  year = {2017},
}
Figure