Learning Sparse Representations in Reinforcement Learning with Sparse Coding

Lei Le, Raksha Kumaraswamy, Martha White

Abstract

In Reinforcement Learning (RL), the quality of state representation is critical for effective value function approximation. While hand-crafted features like tile-coding are common, they often fail to capture task-specific nuances and can be computationally expensive. This paper introduces SCoPE (Sparse Coding for Policy Evaluation), a method that automatically learns sparse representations by jointly optimizing for state reconstruction and value prediction. We provide a theoretical breakthrough, proving that despite the non-convexity of the objective, every local minimum is a global minimum. Our empirical results on classic benchmarks demonstrate that SCoPE's learned features are more compact and accurate than traditional methods.

Introduction

The success of RL agents in continuous state spaces hinges on feature representation. Historically, researchers have relied on fixed, hand-crafted features such as tile-coding (overlapping grids) or Radial Basis Functions (RBFs). However, designing these features is labor-intensive and requires significant domain expertise. While deep learning offers an automated alternative, sparse coding—a technique inspired by the primary visual cortex—provides a principled way to learn efficient, overcomplete representations. The primary challenge in applying sparse coding to RL is ensuring that the learned features are "task-aware," meaning they are optimized not just for reconstruction but for predicting future rewards.

The SCoPE Framework

SCoPE addresses this by treating representation learning as a supervised dictionary learning problem. The objective function balances three key components:

  1. Reconstruction Error: Ensures the features accurately describe the input state.
  2. Value Error: Ensures the features are predictive of the expected future return (using Bellman Error or Mean Squared Return Error).
  3. Sparsity Penalty ($L_1$): Encourages a small number of active features, which promotes generalization and reduces computational overhead.

The optimization is performed using an alternating proximal gradient descent approach, cycling through updates for the dictionary (the "basis"), the sparse codes (the "features"), and the value function weights.

Theoretical Analysis

A significant contribution of this work is the theoretical characterization of the SCoPE objective. Non-convex optimization typically suffers from suboptimal local minima. However, using the mathematical framework of $\Gamma$-convergence, we prove that for the SCoPE objective, any local minimum is also a global minimum. This result justifies the use of simple gradient-based methods for training and ensures the robustness of the learned representations, making them much more reliable than previously thought.

Experimental Evaluation

We evaluated SCoPE on three standard RL benchmarks: Mountain Car, Puddle World, and Acrobot. These environments test the algorithm's ability to handle different continuous state dynamics and reward structures.

Performance Comparison

SCoPE was compared against various tile-coding configurations, ranging from $4 \times 4$ to $8 \times 8$ grids with different numbers of tilings. As shown in the results below, SCoPE consistently achieved lower Mean Absolute Percentage Value Error (MAPVE) across all three tasks compared to the hand-crafted baselines.

Comparison of SCoPE against various tile-coding configurations across three RL benchmarks.

Representation Sparsity and Compactness

A key advantage of SCoPE is its compactness. While tile-coding often requires thousands of features to achieve high accuracy, SCoPE achieved superior results with only 100 features ($k=100$). The following visualization illustrates the sparsity pattern of these learned features, showing a distributed yet sparse activation across thousands of samples.

Visualization of the sparse features learned by SCoPE over 5000 samples, demonstrating the method's ability to maintain a compact representation.

Discussion and Future Work

Our findings highlight that supervision is essential; purely unsupervised sparse coding performs poorly in RL tasks because it ignores the reward signal. Furthermore, we identified that the popular Mean-Squared Projected Bellman Error (MSPBE) is unsuitable for representation learning as it can be "cheated"—the error can drop to zero without the features actually improving.

While SCoPE shows great promise in batch policy evaluation, future work will focus on extending the method to online, incremental learning settings and applying it to control problems where the agent's representation and its behavior policy evolve simultaneously.

Summary updated

BibTeX
@inproceedings{le2017learning,
  author = {Lei Le and Raksha Kumaraswamy and Martha White},
  title = {{Learning Sparse Representations in Reinforcement Learning with Sparse Coding}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2017},
  doi = {10.24963/ijcai.2017/287},
}
Figure