TL;DR
Long-horizon sequential decision problems like NetHack are notoriously difficult for reinforcement learning (RL) agents due to sparse rewards and massive search spaces. This paper demonstrates that an action-free offline dataset of human play can be "doubly leveraged" by training two separate models: a contrastive state representation encoder and an auxiliary progress-based exploration reward. Combining both models with a strong RL backbone (Muesli) yields dramatic improvements in sample efficiency across both dense- and sparse-reward tasks.
What Problem Does This Paper Address?
In complex environments such as the terminal-based rogue-like game NetHack, tasks feature horizons reaching millions of steps and combinatorial action spaces ($|\mathcal{A}| = 121$). Uninformed exploration is computationally intractable, and standard curiosity-driven techniques (such as Random Network Distillation) often fail.
Prior work—namely Explore-Like-Experts (ELE)—showed that one can extract an intrinsic progress reward from offline human demonstrations by training a model to predict temporal distance between observations. However, ELE collapses an entire rich dataset into a single scalar reward signal, which degrades performance on dense-reward tasks and fails to capture structural state features. The authors investigate how offline, action-free demonstrations can simultaneously build informative state representations and guide exploration without sacrificing one for the other.
Methods
The authors adopt a two-stage pipeline: offline pre-training followed by online fine-tuning using the Muesli RL algorithm.
- Contrastive Representation Learning: Using offline trajectory observations (without actions or rewards), an encoder is pre-trained via Noise-Contrastive Estimation (NCE). Positive future states are drawn using a truncated geometric distribution $\Delta t \sim \text{Geom}_t^H(1-\gamma)$, training the encoder to approximate discounted future state-occupancy measures while preventing representation collapse.
- Progress-Based Exploration (ELE): From the exact same offline dataset, a separate model $g(s_t, s_{t+\Delta t})$ is trained to predict the signed log-temporal distance between states.
- Online Fine-Tuning: The agent's convolutional ResNet encoder is initialized with the pre-trained contrastive weights and frozen. A standard recurrent policy/value network (LSTM + MLP) sits on top. During online interaction, the environment reward is augmented with the intrinsic progress signal: $$r'(s_t, a_t) = r(s_t, a_t) + \lambda g(s_{t-k}, s_t)$$
Datasets
- Offline Training Data: The NAO Top 10 dataset, consisting of roughly 16,000 games and 184 million transitions from the top 10 human players on
nethack.alt.org. The dataset contains only visual terminal observations (TTY arrays) without recorded actions or environment rewards. - Evaluation Benchmark: 7 tasks from the NetHack Learning Environment (NLE):
- Dense reward: Score and Scout (rewarding tile exploration).
- Sparse reward: Depth-2, Depth-4, Level-2, Level-4, and the exploration-heavy Oracle task (reward only upon completion).
Key Insights and Ideas
- Orthogonal Benefits: Exploration bonuses help the agent discover rare rewards in sparse settings, whereas contrastive representation learning enables the agent to exploit those rewards with high sample efficiency.
- Decoupled Models Outperform Shared Encoders: Simply extracting representations from the progress model's torso (rather than training a contrastive encoder separately) performs poorly. Progress prediction captures a scalar progression metric, whereas contrastive estimation captures state connectivity and occupancy dynamics.
- Freezing Representations Prevents Drift: Freezing the pre-trained encoder throughout online RL training performs just as well as fine-tuning it, eliminating the risk of catastrophic forgetting or representation drift during new state exploration.
- ResNets Beat ViTs for NLE: Ablation studies show that standard 2D ResNets achieve substantially better categorical prediction accuracy than Vision Transformers (ViTs) on NetHack's discrete character grid.
Key Results
- Superior Across Task Spectra: Across all 7 tasks, combining contrastive pre-training with ELE outperformed tabula rasa Muesli, pure ELE, and standard imitation baselines from observations (GAIfO, BCO, and FORM).
- Fixing Dense Tasks: While pure ELE degraded Muesli's baseline performance on dense tasks (Score and Scout), adding contrastive pre-training reversed this, accelerating learning curves and achieving higher final returns within the 200M actor-step budget.
- Sparse Task Speedups: On sparse tasks (Depth, Level, and Oracle), pre-training alone could not solve the tasks without an exploration reward. However, paired with ELE, it significantly improved sample efficiency, converging much faster than pure ELE within 200M steps (and 500M steps on Oracle).
Limitations and Future Work
- The Game Remains Unsolved: While the hybrid agent makes significant progress on sub-goals like finding the Oracle, full NetHack game completion (achieved by only ~1% of humans) remains out of reach.
- Fixed Lag Heuristic: During the online phase, the progress reward evaluates progress using a fixed temporal lag ($s_{t-k}$ to $s_t$), which may not adapt dynamically to varied gameplay tempos.
- Reliance on Expert Quality: The approach assumes demonstrations contain meaningful forward progression; noisy or suboptimal offline data may negatively impact both the temporal ordering heuristic and representation geometry.
Summary updated