Abstract
Generative diffusion models have set new benchmarks in reinforcement learning (RL) by enabling sophisticated trajectory planning. However, their iterative sampling process is computationally intensive, often requiring significant GPU resources and high latency, which limits their utility in real-time robotics. This paper introduces Habi, a framework that distills slow, deliberate diffusion planners into high-speed "habitual" policies. By framing distillation as a biological habit-formation process, Habi achieves decision-making speeds exceeding 800 Hz on standard laptop CPUs while maintaining or improving upon the performance of the original planners.
Introduction
In the quest for autonomous agents capable of complex reasoning, diffusion-based planners have emerged as a dominant paradigm. These models treat decision-making as a generative task, iteratively refining action sequences to maximize expected utility. While effective, this "System 2" approach—characterized by slow, deliberate planning—is often too sluggish for the millisecond-level reflexes required in agile robotics or autonomous driving.
Humans solve this efficiency problem through "habitization": the transition of goal-directed, effortful behaviors into fast, automatic responses (System 1). This paper presents Habi, a framework designed to replicate this transition in artificial agents. By compressing the knowledge of a diffusion planner into a lightweight habitual policy, Habi bridges the gap between high-level generative planning and real-time execution.
Methodology: The Habitization Process
Habi utilizes an Auto-Encoding Variational Bayes framework to translate the behavior of a pre-trained diffusion planner into a reactive neural network. The architecture is built around three core components: a Prior Encoder, a Posterior Encoder, and a Decoder.
Latent Space Alignment
The framework distinguishes between two types of behavior:
- Goal-Directed (Posterior): The slow diffusion planner, which utilizes future trajectory information to determine the optimal action.
- Habitual (Prior): The fast policy, which must make decisions based solely on the current state.
During training, Habi aligns these two behaviors by minimizing the Kullback-Leibler (KL) divergence between their respective latent spaces. This ensures that the habitual policy captures the underlying intent and structural consistency of the complex planner, rather than simply mimicking surface-level actions (as in standard behavioral cloning).
Adaptive KL Weighting
To maintain stability across diverse environments—ranging from simple locomotion to complex maze navigation—Habi employs an adaptive $\beta_{KL}$ mechanism. This dynamically adjusts the weight of the KL divergence term during training, preventing the latent alignment from overpowering the reconstruction of the actual actions.
Critic-Guided Inference
To ensure robustness, Habi incorporates a "Critic-guided" inference strategy. Instead of generating a single action, the habitual policy produces a small batch of candidates (e.g., five). A lightweight Critic network—trained to estimate the Q-value—quickly evaluates these candidates and selects the best one. This minimal deliberation allows the model to correct potential errors in the habitual response without the heavy overhead of full diffusion sampling.
Experimental Evaluation
The authors evaluated Habi using the D4RL benchmark, focusing on MuJoCo locomotion, Franka Kitchen manipulation, and Maze2D/AntMaze navigation tasks.
Computational Efficiency
The most striking result is the gain in inference speed. On an Apple M2 Max laptop CPU, Habi achieved average decision frequencies of:
- 1329 Hz on MuJoCo locomotion tasks.
- 1532 Hz on Maze2D environments.
In contrast, standard diffusion planners often operate at sub-1 Hz frequencies on similar hardware. Even on high-end Nvidia A100 GPUs, Habi maintained throughputs of 137–376 Hz across parallel environments, significantly outperforming other accelerated probabilistic methods.
Task Performance
Despite the massive reduction in computational cost, Habi does not sacrifice quality. In many benchmarks, Habi matched the performance of state-of-the-art diffusion models like Diffusion Voyager and DQL. In some instances, the habitization process actually improved performance, likely by filtering out planning noise and producing more concentrated, confident action distributions.
Discussion and Future Work
Habi demonstrates that the computational bottleneck of diffusion planning can be overcome by treating policy distillation as a transition from deliberate planning to habitual execution. By aligning latent decision spaces rather than just output actions, Habi preserves the sophisticated reasoning of generative models in a form suitable for real-time applications.
Currently, the framework is optimized for state-based inputs and offline RL datasets. Future research will focus on extending Habi to high-dimensional visual inputs (pixels) and integrating it into online reinforcement learning loops. The ultimate goal is the deployment of Habi in physical robotic systems where high-frequency, intelligent decision-making is a prerequisite for safety and agility.
Summary updated