Make-An-Agent: A Generalizable Policy Network Generator with Behavior-Prompted Diffusion

Yongyuan Liang, Tingqiang Xu, Kaizhe Hu, Guangqi Jiang, Furong Huang, Huazhe Xu

Introduction

Traditionally, teaching an AI agent a new task involves Reinforcement Learning (RL) or Imitation Learning (IL). Both methods require mapping states to actions over thousands of iterations, demanding extensive data and time-consuming gradient updates to adapt to even slightly new environments.

Make-An-Agent introduces a novel paradigm for robotic control: generating the neural network weights of a policy directly from a single demonstration using a conditional diffusion model. The authors ask a provocative question: Can we bypass the training loop entirely and just predict the optimal network weights from a suboptimal demonstration, much like generating an image from a text prompt?

The core challenge here is dimensionality. Policy networks contain tens of thousands (or millions) of parameters. Guiding the generation of these high-dimensional parameters using a low-dimensional "prompt" (a short sequence of an agent's states and actions) is incredibly difficult. By compressing policy parameters into a latent space and prompting a diffusion model with contrastive behavior embeddings, the system can instantly synthesize performant, deployable policies for new tasks without any gradient-based fine-tuning.

Methods

To solve the dimensionality and conditioning challenges, the authors propose a three-part architecture.

The Make-An-Agent architecture featuring the Latent Diffusion Model, Autoencoder, and Behavior Embeddings.
  1. Parameter Autoencoder: Instead of applying diffusion directly to a massive array of network weights, the authors train an autoencoder. It flattens the layers of a policy network and compresses them into a compact latent representation. A decoder is trained to reconstruct these latent vectors back into fully functional, deployable policy networks.
  2. Contrastive Behavior Embeddings: To use a trajectory as a "prompt," the model needs to understand the intent of the demonstration. The authors use a contrastive learning objective to capture the mutual information between the initial steps of a trajectory and the eventual success states. This creates a highly informative, concise embedding of the agent's behavior.
Contrastive learning objective for extracting behavior embeddings from agent trajectories.
  1. Conditional Latent Diffusion Model: A 1D Convolutional U-Net diffusion model is trained in the latent parameter space. It learns to denoise random noise into a valid latent parameter representation, conditioned heavily on the behavior embeddings.

Datasets

To train the generator, the authors built a dataset of policy network checkpoints and their corresponding rollout trajectories across diverse domains:

  • MetaWorld: A tabletop robotic manipulation benchmark. They used 10 tasks for training and 8 for unseen evaluation, collecting 1,500 SAC (Soft Actor-Critic) policy checkpoints per task.
  • Robosuite: Used for cross-embodiment testing. Models were trained on 1,500 checkpoints using a Panda robot arm, but evaluated on a completely different Sawyer robot arm.
  • Quadrupedal Locomotion: 10,000 policy checkpoints trained in IsaacGym to evaluate sim-to-real transfer on a physical Unitree Go2 robot.

Key Insights and Results

  • Generation Beats Adaptation: Directly generating policy weights proves highly resilient to environmental randomness and noisy input trajectories. Standard meta-learning or multi-task adaptation methods often overfit to the specific dynamics of the prompt trajectory, whereas the diffusion model captures the broader parameter distribution.
  • True Synthesis, Not Memorization: The generated policy parameters have very low cosine similarity (mostly < 0.2) to standard RL-trained parameters. This proves the diffusion model isn't just regurgitating memorized training data; it is discovering novel, effective regions of the parameter space.
  • Superior Performance & Efficiency: Make-An-Agent outperformed state-of-the-art baselines (Multi-task BC, Meta-RL, Meta-IL) on both seen and unseen tasks. On seen tasks, the model maintained an average "qualification rate" (generating policies that achieve a flawless 100% test success rate) of over 30%. On unseen tasks, high-performing policies could be generated using an average of just 20-50 sub-optimal replay buffer trajectories as prompts, requiring absolutely zero fine-tuning.
  • Cross-Embodiment Zero-Shot Transfer: The model successfully generated effective policies for a Sawyer robot arm despite only being trained on parameters from a Panda robot arm. This showcases that the learned latent parameter space captures deep, generalizable skills rather than just robot-specific kinematics.
  • Real-World Deployment: The authors successfully deployed generated policies directly onto a physical Unitree Go2 quadruped, which smoothly executed complex tasks like high-speed turning, backward movement, and obstacle avoidance.

Limitations and Future Work

The authors acknowledge a few key limitations. First, the method has currently only been validated on relatively small policy networks (e.g., 4-layer MLPs with ~22,000 to 50,000 parameters). Second, the overall quality of the generated policies is strictly bottlenecked by the autoencoder's ability to accurately reconstruct weights from the latent space.

Future work will likely focus on scaling this approach to larger, more diverse network architectures (like Transformers) and exploring more flexible parameter generation frameworks that might bypass the limitations of the current autoencoder setup.

Summary updated

BibTeX
@inproceedings{liang2024make,
  author = {Yongyuan Liang and Tingqiang Xu and Kaizhe Hu and Guangqi Jiang and Furong Huang and Huazhe Xu},
  title = {{Make-An-Agent: A Generalizable Policy Network Generator with Behavior-Prompted Diffusion}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=pHiTmEsAfZ},
}
Figure