Overview
LECO (Learnable Episodic COunt) is a novel reinforcement learning (RL) framework designed to tackle hard exploration problems with sparse rewards. By combining learnable state compression with a task-specific reward modulator, LECO successfully ignores task-irrelevant distractions and automatically transitions from exploration to exploitation in complex environments.
The Challenge of Sparse Rewards
In RL, agents often struggle with "sparse rewards"—environments that provide no feedback until a complex sequence of actions is completed (e.g., finding a key, opening a door, and reaching a goal). To encourage agents to discover these rare rewards, researchers often use intrinsic rewards, such as giving the agent a bonus for visiting novel states.
However, traditional count-based exploration faces three major hurdles:
- The Dimensionality Curse: In high-dimensional, pixel-based environments, every frame is technically unique. Raw pixel counting is infeasible, requiring effective state compression.
- Task-Irrelevant Distractions: Standard exploration is "task-agnostic." An agent might get stuck observing randomly changing pixels (the "noisy TV" problem) because it perceives constant novelty, even if it doesn't help solve the task.
- The Exploration-Exploitation Transition: Once an agent finds the goal, it should stop wandering and optimize its path. Purely count-based methods often keep the agent distracted by novelty even after the task is solved.
The LECO Framework
LECO addresses these issues through a dual-component intrinsic reward system that dynamically balances novelty with task relevance.
1. Learnable Hashing via VQ-VAE
Instead of using fixed or random hashing, LECO employs a Vector Quantized Variational Autoencoder (VQ-VAE). The encoder maps high-dimensional observations into a discrete set of codes from a learned codebook. This allows the agent to maintain an efficient episodic hash memory—a table that counts how many times each discrete spatial code has appeared in the current episode. Because VQ-VAE codes preserve spatial information, this hashing is significantly more effective than standard Locality-Sensitive Hashing (LSH).
2. Task-Specific Modulation
A core innovation of LECO is its learnable modulator (parameterized by an MLP). Rather than simply rewarding all novelty, LECO uses bi-level optimization (meta-gradients) to tune the intrinsic reward:
- Inner Loop: The agent's policy is updated to maximize the sum of extrinsic (environment) and intrinsic rewards.
- Outer Loop: The modulator is updated to maximize only the extrinsic reward.
Essentially, the modulator learns to amplify the novelty bonus if it helps the agent find real rewards, and suppress it (or even make it negative) if the novelty proves to be a distraction. The authors also found that adding the modulated reward to the novelty count is more robust than multiplying them, ensuring a baseline drive to explore early in training.
Key Insights and Results
The authors evaluated LECO on challenging, procedurally generated benchmarks known for sparse rewards: MiniGrid (2D gridworld) and DeepMind Lab (DMLab) (3D navigation).
Automatic Phase Shifting
LECO naturally shifts from exploration to exploitation. As the agent learns the task, the modulator reduces the intrinsic reward toward zero. In contrast, agents using unmodulated novelty (VQ-only) remain permanently distracted by exploration bonuses.
State-of-the-Art Performance
LECO consistently outperformed baselines like NovelD, AGAC, and RIDE:
- Solving Complex Puzzles: In the highly difficult
ObstructedMaze-Fulltask (MiniGrid), which requires picking up keys and toggling boxes to clear paths, LECO was the only method to consistently achieve a high success score. - Scaling to 3D: In DMLab's
lasertag_three_opponents_large, LECO achieved significantly higher human-normalized scores than baselines, successfully navigating complex 3D spaces where other methods failed. - Computational Efficiency: The VQ-VAE hashing allows for fast, constant-time lookups, making it practical for modern distributed RL systems.
Limitations and Future Directions
While highly effective, LECO's counts currently reset every episode. Leveraging "inter-episode" novelty could further improve performance in static environments. Additionally, the bi-level optimization required for the modulator can be computationally expensive; exploring single-level reformulations or scaling the architecture with Transformers represent promising avenues for future research.
Summary updated