Paper · 2022-10-06 · cs.RO, cs.AI, cs.LG
VIMA: General Robot Manipulation with Multimodal Prompts
VIMA writes robot tasks as prompts that interleave text and object images. A T5 encoder reads the prompt, and a causal transformer decodes discrete pose actions while cross-attending to it. Trained by behaviour cloning on simulated expert data. Author-reported: 81.5% success on the easiest zero-shot level at 200M parameters, versus 58.0% for the best baseline.
Imitation learningRobot simulation for learningVision Transformer (ViT) backbonesMulti-task learningroboticsimitation-learningmultimodalcross-attentiontransformermulti-task
arXivPDFCodeMarkdown14 min read
AI-compiled by claude-haiku-5-5 on 2026-10-18, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.
In plain words
Robots can be told what to do in many ways: a sentence, a picture of the goal arrangement, a short video of someone doing the task, or a rule such as "do not touch that area". Usually each way needs its own system, so the systems do not combine well.
VIMA's idea is to put all of these into one prompt that mixes words and pictures of objects, like a sentence with pictures inside it. A single transformer reads the prompt together with the robot's recent history and outputs the next small movement, one step at a time. It treats each object as its own item, a picture plus a box, instead of looking at the whole table image. The results below test whether this design is worth it.
The model is trained by copying demonstrations made by a scripted expert in a simulator. It is then tested on tasks it has not seen, including new kinds of tasks, and the paper's main claim is that it holds up better than other designs as the tests move further from the training data.
TL;DR
VIMA is a robot policy for tabletop manipulation whose task is given as an interleaved text-and-image prompt. It uses object-centric tokens, a pretrained T5 prompt encoder and a decoder that alternates cross-attention to the prompt with causal self-attention. It is trained by behaviour cloning in the authors' simulator benchmark and reports the best zero-shot results among the designs it compares, at every model size (author-reported). Code is MIT licensed LICENSE; checkpoint licensing was not checked.
Problem
Robot task specification is fragmented: goal images, video demonstrations, language instructions and visual constraints have each been handled by separate policies with different architectures, objectives and data pipelines §1. The paper asks whether one sequence-modelling interface can express all of them, and whether one agent trained on that interface generalises to unseen objects, textures and tasks §1, §2.
No prior method works directly with multimodal prompts, so the authors compare against adapted transformer baselines §5.1.
Method
The policy is \pi(a_t \mid \mathcal{P}, \mathcal{H}), where \mathcal{P} is the prompt and \mathcal{H} = [o_1, a_1, \ldots, o_t] is the interaction history §4. A prompt is an ordered sequence of text and image elements §2.
Step 1: tokenize the prompt §4 Tokenization app. C.2.1.
- Text: T5 tokenizer and word embeddings, dimension 768 tab. 2.
- Full-scene images: a fine-tuned Mask R-CNN extracts each object as a bounding box plus a cropped image app. C.4. Each object becomes one token.
- Single-object images: the same, with a dummy box app. C.2.1.
- Object token: the box (centre x, centre y, height, width) is normalised and passed through an MLP; the crop is passed through a ViT trained from scratch; the two are concatenated and mapped to the embedding dimension app. C.2.1. Hyperparameters in tab. 2.
- Non-text tokens go through an adapter MLP before the T5 encoder §4 app. C.2.1.
Step 2: encode the prompt §4 Tokenization app. C.2.1. A pretrained T5-base encoder encodes the interleaved sequence. Only its last two layers are fine-tuned, with layer-wise learning-rate decay; the other layers are frozen app. C.2.1. The T5 size ablation is in app. E.4.
Step 3: tokenize the observation app. C.2.2 tab. 3. Each observation gives object tokens from two views, ordered frontal then top-down. The end-effector state is one-hot encoded, embedded to dimension 2, concatenated with the object tokens and projected to observation tokens of dimension 768. Positional embeddings are learned and absolute.
Step 4: tokenize past actions app. C.2.3. Each past action is embedded by a two-layer MLP with hidden size 256, then mapped to the token dimension.
Step 5: the robot controller §4 Robot Controller app. C.2.4. The decoder is a causal stack of L blocks, each alternating cross-attention and causal self-attention. Queries come from the trajectory tokens and keys and values come from the prompt tokens. The cross-attention step is written as
\mathcal{H}' = \mathrm{softmax}\!\left(\frac{Q_\mathcal{H} K_\mathcal{P}^\top}{\sqrt{d}}\right) V_\mathcal{P}
with residual connections, where d is the embedding dimension §4. The paper's appendix pseudocode adds a feed-forward block after each attention step app. C.2.4, Pseudocode 1. The number of blocks per model size is in tab. 8 and tab. 9; the paper does not give L in the text, so reading it from "Num Blocks" is an inference.
# Robot controller: cross-attention, then causal self-attention
# [§4] [app. C.2.4]
# Shapes: prompt (L_p, d); trajectory (2T-1, d), obs and action tokens
def controller(prompt, trajectory):
# Add learned positional embeddings to both sequences [app. C.2.4]
x = trajectory + trajectory_position_embedding
prompt = prompt + prompt_position_embedding
# Repeat for L blocks [app. C.2.4]
for block in range(num_blocks):
# Trajectory tokens query the prompt [§4]
x = x + cross_attention(query=x, key_value=prompt)
x = x + feed_forward(x) # [app. C.2.4, Pseudocode 1]
# Causal self-attention over the trajectory [§4]
x = x + causal_self_attention(x)
x = x + feed_forward(x)
# The last token is the predicted action token [app. C.2.4]
return x[-1]Step 6: decode the action app. C.2.5 tab. 4. An action is two SE(2) poses, each with a position and a quaternion rotation. Each pose uses six independent categorical heads: two for position (50 bins for x, 100 bins for y) and four for the quaternion (50 bins each). The heads are integrated and mapped to continuous values by an affine transform. The paper reports that independent heads are as good as autoregressive decoding in early ablations app. C.2.5.
Training §4 Training app. D tab. 7. Behaviour cloning minimises the negative log-likelihood of the expert actions over the T steps of each trajectory §4. Object augmentation randomly injects false-positive detections into every observation to make the model robust to detector errors §4:
# One behaviour-cloning update [§4 Training] [app. D]
# Each observation receives extra false-positive objects [app. D]
def training_step(prompt, history, expert_actions):
# Sample how many fake objects to add: 0 with p=0.95, 1 with p=0.05
extra = sample_categorical(values=[0, 1], probs=[0.95, 0.05])
# Add that many random boxes and crops to the object tokens [app. D]
objects = add_random_objects(history.objects, count=extra)
# Predict per-head action distributions [app. C.2.5]
dists = policy(prompt, objects, history.actions)
# Negative log-likelihood summed over the trajectory [§4 Training]
loss = -sum(dists[t].log_prob(expert_actions[t]) for t in steps)
return lossCheckpoints are chosen by aggregated accuracy on a held-out validation set. The evaluation itself uses rollouts in the physics simulator §4 Training.
Data. Expert trajectories come from scripted oracles with privileged state in VIMA-Bench, built on the Ravens simulator §3. The paper says it has 50K trajectories per task and 650K successful trajectories in total §3. See Pitfalls for the arithmetic.
Model sizes. Seven robot controllers from 2M to 200M parameters; the T5 encoder (111M) is not counted §5.2 tab. 8 tab. 9.
Hyperparameters
Complete training hyperparameters tab. 7:
| Setting | Value | Where | Notes |
|---|---|---|---|
| Learning rate | 0.0001 | tab. 7 | AdamW app. D |
| Warmup steps | 7K | tab. 7 | |
| LR cosine annealing steps | 17K | tab. 7 | minimum LR not stated |
| Weight decay | 0 | tab. 7 | |
| Dropout | 0.1 | tab. 7 | |
| Gradient clip threshold | 1.0 | tab. 7 | |
| Activation | GEGLU | app. D | all methods |
| Batch size | not stated | ||
| Total training steps or epochs | not stated | ||
| AdamW betas, epsilon | not stated | ||
| Max prompt length | not stated in paper | code: 256 prompt positions vima_policy.py |
Prompt tokenization tab. 2:
| Setting | Value |
|---|---|
| Tokenizer | t5-base tokenizer |
| Text embedding size | 768 |
| Crop size (ViT input) | 32 × 32 |
| Patch size (ViT) | 16 |
| Width (ViT) | 768 |
| Depth (ViT) | 4 |
| Attention heads (ViT) | 24 |
| Box MLP width | 768 |
| Box MLP hidden layers | 2 |
| Language model | t5-base |
| Fine-tuned final layers | 2 |
| Position encoding | absolute |
| Adapter MLP hidden layers | 2 |
Observation encoding tab. 3:
| Setting | Value |
|---|---|
| Observation token size | 768 |
| End-effector embedding size | 2 |
| Position encoding | absolute |
Action decoder tab. 4:
| Setting | Value |
|---|---|
| Hidden width | 512 |
| Hidden layers | 2 |
| Activation | ReLU |
| Bins for x | 50 |
| Bins for y | 100 |
| Bins per rotation component | 50 |
Other settings in the text: object augmentation K=2 with probabilities \{0: 0.95, 1: 0.05\} app. D; action-token MLP hidden size 256 app. C.2.3; Mask R-CNN fine-tuning uses learning rate 5\times10^{-4} and 10 epochs, with 100 trajectories per task giving 22,741 images and 61,822 annotations app. C.4; the model with high recall is favoured for the detector app. C.4.
Controller configurations for cross-attention models (VIMA and VIMA-Flamingo) tab. 8:
| Model size (M) | Embedding dim | Num blocks | X-attn heads | Self-attn heads |
|---|---|---|---|---|
| 2 | 256 | 1 | 8 | 8 |
| 4 | 256 | 2 | 8 | 8 |
| 9 | 320 | 3 | 10 | 10 |
| 20 | 384 | 4 | 12 | 12 |
| 43 | 512 | 5 | 16 | 16 |
| 92 | 640 | 7 | 20 | 20 |
| 200 | 768 | 11 | 24 | 24 |
Controller configurations for causal self-attention models (VIMA-Gato and VIMA-GPT) tab. 9:
| Model size (M) | Embedding dim | Num blocks | Self-attn heads |
|---|---|---|---|
| 2 | 64 | 1 | 2 |
| 4 | 96 | 2 | 3 |
| 9 | 192 | 3 | 6 |
| 20 | 320 | 4 | 10 |
| 43 | 512 | 5 | 16 |
| 92 | 768 | 7 | 24 |
| 200 | 768 | 18 | 24 |
Baseline settings: the Gato-style ViT uses image size 64 × 128, patch size 32, width 768 and 4 layers tab. 5. The Flamingo-style Perceiver Resampler uses 4 latent queries, 4 blocks, 4 self-attention layers per block and 24 heads tab. 6.
Results
Author-reported. Benchmark: VIMA-Bench on the Ravens simulator, 17 task templates in six categories, evaluated on a four-level zero-shot protocol §3. Level 1 is placement generalisation, Level 2 combinatorial generalisation, Level 3 novel objects and textures, and Level 4 novel tasks §3 fig. 2. Each task gives a binary success signal §3. Baselines are VIMA-Gato, VIMA-Flamingo and VIMA-GPT, each re-implemented by the authors §5.1 app. C.3.
Headline comparison at 200M parameters, average success % tab. 10:
| Level | VIMA | VIMA-Gato | VIMA-Flamingo | VIMA-GPT |
|---|---|---|---|---|
| L1 | 81.5 | 58.0 | 47.4 | 46.9 |
| L2 | 81.5 | 53.1 | 46.0 | 46.9 |
| L3 | 78.7 | 46.0 | 40.7 | 42.2 |
| L4 | 48.6 | 16.8 | 12.1 | 12.1 |
Model scaling, all sizes tab. 10 (columns are controller parameters):
| Level | Method | 2M | 4M | 9M | 20M | 43M | 92M | 200M |
|---|---|---|---|---|---|---|---|---|
| L1 | VIMA | 76.5 | 79.2 | 77.4 | 77.1 | 78.2 | 79.3 | 81.5 |
| L1 | VIMA-Gato | 37.6 | 42.6 | 44.2 | 46.1 | 49.5 | 57.0 | 58.0 |
| L1 | VIMA-Flamingo | 42.4 | 48.9 | 45.6 | 46.6 | 47.0 | 47.2 | 47.4 |
| L1 | VIMA-GPT | 30.0 | 37.0 | 44.9 | 48.5 | 48.0 | 47.9 | 46.9 |
| L2 | VIMA | 77.1 | 79.2 | 78.2 | 77.6 | 77.6 | 80.1 | 81.5 |
| L2 | VIMA-Gato | 35.9 | 39.3 | 41.3 | 44.1 | 46.6 | 53.9 | 53.1 |
| L2 | VIMA-Flamingo | 41.0 | 46.5 | 44.6 | 44.6 | 45.4 | 47.1 | 46.0 |
| L2 | VIMA-GPT | 29.8 | 35.0 | 43.3 | 45.8 | 45.9 | 47.4 | 46.9 |
| L3 | VIMA | 77.3 | 77.8 | 78.5 | 77.3 | 81.8 | 81.9 | 78.7 |
| L3 | VIMA-Gato | 29.0 | 33.2 | 37.5 | 40.2 | 42.5 | 45.6 | 46.0 |
| L3 | VIMA-Flamingo | 35.0 | 41.9 | 39.2 | 40.5 | 40.3 | 42.1 | 40.7 |
| L3 | VIMA-GPT | 25.3 | 29.3 | 39.0 | 43.5 | 43.0 | 42.6 | 42.2 |
| L4 | VIMA | 25.7 | 49.0 | 47.1 | 48.8 | 49.0 | 49.6 | 48.6 |
| L4 | VIMA-Gato | 13.3 | 13.2 | 12.2 | 12.3 | 12.8 | 13.5 | 16.8 |
| L4 | VIMA-Flamingo | 12.3 | 11.6 | 10.7 | 12.1 | 10.7 | 11.1 | 12.1 |
| L4 | VIMA-GPT | 11.1 | 10.3 | 12.7 | 14.2 | 11.8 | 12.1 | 12.1 |
Data scaling, fraction of the imitation dataset tab. 11 fig. 4. Baselines that learn from pixels use an MVP-pretrained ViT-B with MAE fine-tuning on the detector's in-domain data app. E.3:
| Level | Method | 0.1% | 1% | 10% | 100% |
|---|---|---|---|---|---|
| L1 | VIMA | 0.0 | 36.3 | 76.3 | 79.3 |
| L1 | VIMA-Gato | 0.0 | 11.5 | 41.5 | 57.5 |
| L1 | VIMA-Flamingo | 0.0 | 2.0 | 37.7 | 52.3 |
| L1 | VIMA-GPT | 0.0 | 6.0 | 30.9 | 52.8 |
| L2 | VIMA | 0.0 | 34.3 | 75.8 | 80.1 |
| L2 | VIMA-Gato | 0.0 | 10.1 | 37.9 | 41.2 |
| L2 | VIMA-Flamingo | 0.0 | 2.0 | 33.8 | 32.6 |
| L2 | VIMA-GPT | 0.0 | 6.0 | 29.7 | 40.3 |
| L3 | VIMA | 0.0 | 15.4 | 73.2 | 81.9 |
| L3 | VIMA-Gato | 0.0 | 10.2 | 34.8 | 40.9 |
| L3 | VIMA-Flamingo | 0.0 | 1.0 | 33.1 | 33.6 |
| L3 | VIMA-GPT | 0.0 | 5.5 | 28.6 | 39.2 |
| L4 | VIMA | 0.0 | 17.0 | 46.0 | 49.6 |
| L4 | VIMA-Gato | 0.0 | 2.7 | 10.8 | 12.2 |
| L4 | VIMA-Flamingo | 0.0 | 0.5 | 11.2 | 12.0 |
| L4 | VIMA-GPT | 0.0 | 1.1 | 7.1 | 14.3 |
Other reported results (all author-reported):
- Progressive generalisation: VIMA's drop from L1 to harder levels is small, especially L1 to L2 and L1 to L3; baselines degrade by as much as 20%; on L4 VIMA's drop is about half that of the other variants §5.2 fig. 5.
- T5 encoder size, 200M controller tab. 13: t5-small (30M) / t5-base (111M) / t5-large (368M): L1 78.8 / 81.5 / 80.8; L2 79.0 / 81.5 / 81.0; L3 80.3 / 78.7 / 81.0; L4 49.1 / 48.6 / 49.3. The paper finds no significant difference and uses t5-base §5.3 app. E.4.
- Distractors, 200M tab. 14: adding one distractor object per task lowers L1 81.5 → 78.5, L2 81.5 → 78.6, L3 78.7 → 72.9, L4 48.6 → 47.8 (relative drops 3.6%, 3.5%, 7.3%, 1.6%) app. E.5.
- Imperfect prompts, 200M tab. 15: incomplete prompts (words masked with
<UNK>) L1 80.8, L2 81.1, L3 77.0, L4 48.0; corrupted prompts (words swapped) L1 78.2, L2 78.1, L3 73.8, L4 45.3 app. E.5. - Ablations §5.3 fig. 6 fig. 7: object tokens beat raw-pixel tokenizers (image Perceiver, image patches, single image embedding) at every level; passing the variable-length object sequence beats compressing it with a Perceiver; cross-attention conditioning beats a GPT-style concatenated sequence, most clearly at small sizes and on L4. Using the oracle boxes instead of Mask R-CNN gives only a small gain, which the paper reads as the detector pipeline losing little. The per-task numbers are in tab. 16 to tab. 19.
- Compute: the largest experiment takes about one day on nodes with 8 V100 GPUs using DDP app. E.1.
Paper vs code
Code: official repository vimalabs/VIMA at commit 8449837 (cloned 2026-10-18), MIT
licence LICENSE. The repository has the policy and model code and the
pretrained model links; it does not contain the training script, the Mask R-CNN
training code, or the object-augmentation code. The arXiv version used here is v2 (2023-05-28).
- Cross-attention block. §4 gives the bare formula \mathrm{softmax}(QK^\top/\sqrt{d})V with a residual §4. The code uses learned query, key and value projections, an output projection, a pre-LayerNorm, and a GEGLU feed-forward with residuals components.py. The attention logits are scaled by the per-head dimension, not d components.py. The appendix pseudocode matches the code, not the §4 formula app. C.2.4.
- Self-attention block normalisation. The causal GPT-style block is post-LayerNorm:
n = ln_1(x + a),h = ln_2(n + m)components.py, while the cross-attention block is pre-LayerNorm components.py. The paper does not specify either. - Position ids use the object mask. The paper says "learned absolute" positions app. C.2.2. The code takes position ids as a cumulative sum of the token mask, so masked or absent objects do not consume positions vima_policy.py xattn_gpt.py.
- Prompt length cap. The code asserts that the prompt has at most 256 tokens xattn_gpt.py (constructor argument at vima_policy.py). The paper gives no cap.
- Bounding-box normalisation. The paper says boxes are divided by an upper bound, without giving it app. C.2.1. The code divides by 256 for width and 128 for height, in the order it uses obj_encoder.py obj_encoder.py.
- Action embedding. The code embeds each pose component with a one-hidden-layer MLP of width 256 vima_policy.py, which is the paper's "two-layer MLP" app. C.2.3. The
hidden_depthargument counts hidden layers utils.py. The four component embeddings are concatenated and mapped to the token dimension by a linear layer action_embd.py; the paper does not mention this. - Action decoder heads. Six categorical heads per pose, 50/100 bins for x/y and 50 bins for each of four quaternion components, match the paper vima_policy.py tab. 4.
- Discretisation. Bin boundaries are
linspace(0, 1, n)withbucketize, but de-discretisation divides the index byn, notn-1vima_policy.py. See Pitfalls. - T5 fine-tuning. The paper fine-tunes only the last two T5 layers with layer-wise learning-rate decay app. C.2.1 app. E.4. The released policy loads all of
t5-baseprompt_encoder.py and contains no freezing. A search forfreezeandrequires_gradfound no freezing logic; the onlyrequires_graduse is inside the T5 attention code prompt_encoder.py. The fine-tuning setup therefore cannot be confirmed from the code. - Object augmentation. Described only in the paper §4 app. D. Not in the repository.
- Training data. The paper says 650K successful trajectories in total §3. The model card says 600K for training and 50K held out for validation model-card.md. The training data link is in README.md.
- Action bounds. The mapping from normalised values to simulator bounds is in the example script, not the policy example.py. The bounds are read from the environment metadata and are not in the repository.
- Dropout and GEGLU. Dropout 0.1 and GEGLU match the paper vima_policy.py tab. 7.
Pitfalls
- The headline ratios use different conventions, and one baseline is wrong. The "2.7×" in the abstract and introduction is computed as the gap over the baseline, divided by the baseline and truncated: (46.0 − 12.2) / 12.2 ≈ 2.77 app. E.3. The baseline used is Gato at full data (12.2), but GPT is higher at full data (14.3) tab. 11. Using GPT gives (46.0 − 14.3) / 14.3 ≈ 2.2. The "2.9×" in the introduction is not explained. At 200M on L4 it equals the plain ratio 48.6 / 16.8 tab. 10. Ratios at matched size reach about 3.8× (43M: 49.0 vs 12.8 for Gato). Quote success rates, not these ratios.
- Dataset arithmetic. "50K trajectories per task" over 17 tasks would give 850K, not the stated 650K §3. The number per task is therefore not reliable. The model card gives 600K training plus 50K validation model-card.md.
- Discretisation is not an exact inverse. The encoder places bin edges at k/(n-1) for n bins, but the decoder maps index k to k/n vima_policy.py vima_policy.py. A pose exactly at 1.0 decodes to 0.98 for x and rotation, and 0.99 for y. Errors are up to about one bin width. A reimplementation that decodes to bin centres, or to k/(n-1), will not reproduce the released action values exactly.
- Unstated training details. Batch size, total steps or epochs, AdamW betas, minimum learning rate of the cosine schedule, and number of evaluation episodes per task are not stated app. D §3. The released code does not include the training loop, so these cannot be filled from code.
- Layer count L. The text says "L alternating" blocks §4 but gives no value. tab. 8 and tab. 9 give "Num Blocks" per size; reading that as L is an inference.
- Attention masks. The causal mask uses fill value -10^4 rather than -10^9 components.py. Cross-attention padding masks use the dtype's minimum value components.py. Keep logits in float32 as the code does components.py.
- Object-token cost. Observation tokens scale with the number of detected objects, typically 3 to 8 per step tab. 1. Sequence length grows with the number of objects in each view. Direct sequence modelling of the prompt is quadratic in the number of observation tokens app. C.1; cross-attention avoids putting the prompt in the trajectory sequence §4. The paper gives no latency figures.
- Detector dependency. Object tokens depend on a Mask R-CNN fine-tuned on about 22,741 simulated images app. C.4. The paper reports minimal loss versus oracle boxes §5.3, but that is in simulation. Real-robot transfer is not tested; the authors say the checkpoints may not generalise to other simulators or the real world model-card.md.
- Baselines are the authors' reimplementations. The paper says it made its "best effort" to re-interpret Gato, Flamingo and GPT-style designs for multimodal prompts §5.1. Gains against these baselines measure the authors' versions, not the originals.
- Robustness of the T5 choice. The paper attributes robustness to the T5 backbone §5.3 app. E.5, but the T5 size ablation shows little difference between sizes tab. 13.
Lineage
- Builds on: T5 as prompt encoder §4, following the approach the paper cites as "Frozen" §4; object detection with Mask R-CNN app. C.4; the Gato, Flamingo and Decision Transformer designs for the baselines §5.1 app. C.2.3.
- Compared against: VIMA-Gato, VIMA-Flamingo, VIMA-GPT §5.1.
- Benchmark: VIMA-Bench, built on the Ravens simulator §3. The simulator is a separate repository,
vimalabs/VimaBenchmodel-card.md. - Superseded by: not known from content in this wiki.
- Superseded by: not known from content in this wiki.
Source and license
Adapted from “VIMA: General Robot Manipulation with Multimodal Prompts” by Yunfan Jiang, Agrim Gupta, Zichen Zhang, Guanzhi Wang, Yongqiang Dou, Yanjun Chen, Li Fei-Fei, Anima Anandkumar, Yuke Zhu, Linxi Fan (arXiv:2210.03094), used under CC BY 4.0. Changes: condensed and restructured for implementation, with tables, equations and algorithms taken from the paper and its code, each cited to its source. Not affiliated with or endorsed by the authors. Code citations refer to https://github.com/vimalabs/VIMA at commit 8449837aa453 (MIT). Any quoted code is shown under that license.