Transformer Transformer
Diffusion model that generates a robot for a motion, then controls it
License
MIT
GitHub reports no recognised licence for this repository (NOASSERTION) because the LICENSE file is MIT text with carve-outs appended to it. Checked 2026-09-10: the repository is MIT except for four exceptions the file names explicitly. t2/model/core.py (derived from Meta's DiT) and the positional-embedding helpers in t2/model/utils.py (derived from Meta's MAE) remain under their upstream Attribution-NonCommercial licences, so those files are not available for commercial use. t2/mjx_env/ is Apache-2.0, carried over from Brax and MuJoCo Playground, and the rotation helpers in t2/train/augment.py are BSD-3-Clause from PyTorch3D. Robot assets under assets/mjcf/ keep their own per-directory LICENSE files.
Overview
Transformer Transformer takes a target end-effector motion and a user-defined reward and generates a complete robot for it — every link, joint, motor and inertial property — then controls that same robot to track the motion. It works over RoboTokens, a typed tokenisation of robot embodiments, states and actions that the same tokeniser produces for a 6-DoF arm or a 35-DoF biped, so one network acts as generator, critic and cross-embodiment controller. The repository is the full stack behind the paper: the RoboToken tokeniser, procedural robot generation over parameterised design spaces, data generation with Mink and RL controllers, training and inference for both control and co-design, CMA-ES baselines, and the Blender pipelines behind the paper's visualisations.
The model is a diffusion transformer built on DiT with a DDIM noise schedule, trained on RoboToken sequences. Noise is added to every token except the ones being conditioned on, and changing the mask changes the job: mask everything for an unconditional robot generator, mask the actions for a cross-embodiment controller, mask the embodiment for a motion-conditioned designer. Because the same network predicts both a design and its dynamics, those predictions can be fed to any reward function the user writes down; the reward is differentiable in the embodiment tokens, so its gradient is injected back into the denoising steps. The authors call this Dynamics Self-Guidance, and it is what lets an unseen reward be optimised at inference rather than retrained for.
What ships is more than the model. Ten pretrained runs across three design spaces — the ViperX kinematic space, a quadruped manipulator, and a wheeled bimanual space built around dish washing — are hosted at real.stanford.edu alongside the motion-trajectory data and a SHA256SUMS file, and each run directory keeps its training config next to the weights. Setup is uv-driven on Python 3.12, and the install check round-trips hundreds of randomised robots and MuJoCo Menagerie models through the tokeniser on CPU before anything is downloaded. Practically it wants Ubuntu and a recent NVIDIA driver; macOS resolves CPU-only wheels that are enough for the smoke test and nothing further.
Why it matters
Robot co-design has largely been an evolutionary-search problem: propose a body, roll it through a simulator, keep what scores well, repeat for hours per reward function. Framing it as conditional generation collapses that to seconds and makes a new reward an inference-time argument rather than a fresh optimisation run. The release matters as much as the idea — weights, data and the fabrication result are all published, so the claim that a generated body beats a hand-designed one is checkable rather than asserted.
Problem it solves
A policy can only be as good as the body it runs on, and choosing that body has meant hand iteration or black-box search that needs hours of simulation for every new reward. Transformer Transformer makes the body a thing you generate from the motion you want, and then validates the design with the same network that produced it.
Key takeaways
- RoboTokens turn any rigid articulated robot into 28–101 typed tokens, 27–110× more compact than the equivalent MJCF text, which is what makes diffusing a whole robot tractable
- One network wears three hats by changing which tokens are masked: unconditional robot generator, cross-embodiment controller, and motion-conditioned designer
- Dynamics Self-Guidance differentiates the model's own dynamics predictions through a user-supplied reward, so rewards never seen in training are optimised at inference time
- Ten pretrained runs across three design spaces ship with the training config that produced each one, plus the motion-trajectory data and checksums
- A generated ALOHA 2 redesign for cloth flinging was fabricated and cut tracking error by 73% and peak joint speed by 30% against the original arms
- On multi-trajectory bimanual optimisation the CMA-ES baseline took over three hours; the model reached comparable reward in under a minute
Who it is for
- Robot co-design and morphology-optimisation researchers
- Cross-embodiment control and diffusion-policy researchers
- MuJoCo and MJX users building procedural robot design spaces
- Hardware teams evaluating arm geometry and mounting before committing to fabrication
Limitations
- RoboTokens cover primitive-based geometry only — no arbitrary meshes or deformables, and nothing encodes the surrounding scene or contact targets
- The cross-embodiment controller correlates with the RL oracle at Pearson r = 0.53 on diffused embodiments, so a generated design still has to be validated in simulation
- Test-time compute stops paying off after about a minute of sampling; more inference does not keep improving the design
- Generating the whole-body controller training data is expensive — one RL expert per discrete design choice, roughly 16 hours of A100 time per policy
- Not uniformly MIT: the DiT-derived backbone file and the MAE-derived positional-embedding helpers stay under Attribution-NonCommercial terms, which rules out commercial use of those files
- Linux with a recent NVIDIA driver in practice; on macOS uv resolves CPU-only wheels that run the tokeniser smoke test but not evaluation or training
- Every script logs to Weights & Biases unless WANDB_MODE=offline is set explicitly