Search

Search papers and lessons

VIMA: General Robot Manipulation with Multimodal Prompts

Yunfan Jiang, Agrim Gupta, Zichen Zhang et al. · 2023

VIMA turns robot tasks into prompts that mix text and images, and one transformer policy follows them, generalising to tasks it never saw, in simulation.

On this page

  • Colour = topic mix
  • Architectures
  • Calculus
  • Discrete math
  • Probability
  • Neural network basics
  • Linear algebra
  • ReadReady to readNot yet

TL;DR

VIMA is a robot policy that takes its instructions as a prompt that can mix words and pictures. "Put the object shown here into the container shown there" is one example; "move the objects to match this scene" is another. The authors show that many robot tasks fit this one format, and they build a benchmark, VIMA-Bench, with 17 such tasks in simulation. A transformer reads the prompt and the robot's history and outputs the next arm motion, and it generalises to tasks it never saw in training better than the baselines they compare against.

Builds on: Encoder-Decoder Architecture, Vision Transformer (ViT), Behavior Cloning · Leads to: PaLM-E: An Embodied Multimodal Language Model (a related multimodal robot model, discussed in the paper's related work)

Why it mattered

Robots have usually needed a different system for each way of telling them what to do. A goal picture needed one policy, a demonstration video another, and a spoken command a third. Each system had its own architecture and training pipeline, so they could not easily be combined. The paper's answer is to write every such task as one sequence of text and images, and to train one model on it.

The paper's benchmark, VIMA-Bench, is also a contribution in its own right. It is built on the Ravens tabletop simulator and includes an evaluation protocol with four levels of generalisation. The authors released the simulator, the training data, the code and model checkpoints, so later work can use the same tests. The model itself is a useful reference point for a design choice that matters for robots: an object-centric input, where the model sees a list of objects rather than raw pixels, combined with cross-attention to the prompt.

The problem

A robot that follows many kinds of instruction has to solve three problems at once.

First, it has to understand the instruction. A prompt can name an object by text, show it in a picture, or refer to a new word that is explained by example images inside the prompt. The paper lists six categories of task specification: simple object manipulation, visual goal reaching, novel concept grounding, one-shot video imitation, visual constraint satisfaction, and visual reasoning.

Second, it has to see the scene. Raw camera images are large and mostly irrelevant to a grasp. The paper argues that a model trained on raw pixels has to spend much of its capacity learning to find objects in the first place, which slows learning.

Third, it has to decide the motion. Each task is solved by a sequence of motor actions, and the robot must keep track of what has happened so far.

Earlier systems solved these problems in separate pieces, so the question was whether one transformer, given the right inputs, could handle all three. The paper argues that it can, if the inputs are object tokens and the prompt is connected to the controller in the right way.

How it works

Here is one tiny task traced from start to finish. The prompt says, in words, "put the object shown in image A into the container shown in image B", and the simulator shows a table with three objects. The numbers and object names are illustrative.

  1. The prompt is tokenised. Each piece of text becomes word tokens with a pre-trained T5 tokenizer. Each image of a single object becomes object tokens. Check: the prompt is now a list of text and visual tokens in order.
  2. The scene is turned into objects. A Mask R-CNN detector finds the three objects. Each object gets a bounding box and a cropped image, and each is encoded as one object token. Check: the scene is now three object tokens, not a grid of pixels.
  3. The prompt is encoded. The whole prompt, text and object tokens together, passes through a pre-trained T5 encoder. The result is a set of prompt features that carry the meaning of "the object in image A" and "the container in image B". Check: the instruction now lives in the prompt features.
  4. The controller reads the history and attends to the prompt. The controller is a transformer decoder. At each step it has the history of past observations and actions, and it uses cross-attention to look at the prompt features. Here the first observation is the only item in history, and the controller attends to image A to decide which object to pick. Check: the output depends on both what the robot has done and what the prompt asks for.
  5. The action is decoded. The controller outputs an action as tokens that map to discrete poses of the robot arm's end effector, the part that grips. Here it is a pick at the location of the chosen object.
  6. The simulator executes the action and returns a new observation. The new observation is added to the history, and the loop goes back to step 2. Check: the history grows by one observation and one action per step.
  7. The task ends. A task has a binary success criterion. If the object is in the container when the episode ends, the attempt counts as a success.
flowchart TD
  A["Prompt: text and images"] --> B["T5 encoder: prompt features"]
  C["Current scene"] --> D["Mask R-CNN: object boxes and crops"]
  D --> E["Object tokens"]
  B --> F["Controller: cross-attention to prompt"]
  E --> F
  H["Interaction history"] --> F
  F --> G["Next action: end-effector pose"]
  G --> I["Simulator runs the action"]
  I --> C

The controller is built from alternating cross-attention and self-attention layers. Self-attention lets it look at its own history, and cross-attention lets it look at the prompt. The paper says this design has three advantages: a stronger connection to the prompt, an intact and deep flow of the prompt tokens through the network, and lower compute than putting the prompt into the same sequence as the history.

The math

The policy is a probability distribution over actions. Symbols are named in words the first time they appear.

Let P be the prompt, an ordered sequence of l text and image elements interleaved, and let H be the interaction history of observations o and actions a:

P=[x1,x2,…,xl],H=[o1,a1,o2,a2,…,ot]\mathcal{P} = [x_1, x_2, \ldots, x_l], \qquad \mathcal{H} = [o_1, a_1, o_2, a_2, \ldots, o_t]

The policy pi with parameters theta gives the probability of the next action given the prompt and the history:

πθ(at∣P,H)\pi_\theta(a_t \mid \mathcal{P}, \mathcal{H})

Step 1 in symbols: turning the prompt into features

The prompt is encoded by a pre-trained T5 encoder. Each image object token passes through a small learned projection, an MLP, so it sits in the same space as the word features. Call the resulting key and value sequences K_P and V_P, computed from the prompt, and let d be the embedding dimension.

Step 2 in symbols: cross-attention to the prompt

At each controller layer, the query Q_H comes from the history and the keys and values come from the prompt. The output is the usual scaled dot-product attention:

H′=softmax(QHKP⊤d)VP\mathcal{H}' = \text{softmax}\left(\frac{Q_{\mathcal{H}} K_{\mathcal{P}}^{\top}}{\sqrt{d}}\right) V_{\mathcal{P}}

The softmax turns the similarity between each history position and each prompt token into weights that add to one. A history position about to pick the object in image A puts most of its weight on the tokens for image A.

Step 3 in symbols: the training loss

Training is behavioural cloning: the model copies the expert trajectories that the simulator's scripted oracles produce. For a trajectory of T steps, the loss is the negative log-likelihood of the expert action at each step:

min⁡θ∑t=1T−log⁡πθ(at∣P,H)\min_{\theta} \sum_{t=1}^{T} -\log \pi_\theta(a_t \mid \mathcal{P}, \mathcal{H})

The training set has 50,000 trajectories for each task and 650,000 successful trajectories in total. Minimising this sum is ordinary maximum likelihood on the expert's actions, which is why it sits naturally in the same framework as language modelling.

Step 4 in symbols: the score

A task's score is its success rate over several evaluation episodes, and the headline number averages over tasks:

SRtask=#{successful episodes}#{episodes}\text{SR}_{\text{task}} = \frac{\#\{\text{successful episodes}\}}{\#\{\text{episodes}\}}

The paper's data-scaling claim is a relative gain. Let SR_V be VIMA's success rate at 10% of the data and SR_B the best baseline's rate at full data. The gain is (SR_V - SR_B) / SR_B. The paper reports this as 2.7 times on Level 4. The Results section below works through how that figure was computed and why the choice of baseline matters.

Results

All results are in simulation on VIMA-Bench. The four evaluation levels are, from easiest to hardest: placement generalisation (the objects are placed differently), combinatorial generalisation (new combinations of seen objects and textures), novel object generalisation (new objects and textures), and novel task generalisation (new prompt templates).

SettingVIMAStrongest baseline shown in the table
Level 1, full training data79.3%VIMA-Gato, 57.5%
Level 4, full training data49.6%VIMA-GPT, 14.3% (VIMA-Gato, 12.2%)
Level 4, 10% of training data46.0%Best full-data baseline, VIMA-GPT, 14.3%
Level 4, 1% of training data17.0%Above the 14.3% of the best full-data baseline

The paper's most-quoted gains come from three findings.

Data efficiency. With 1% of the data, VIMA reaches levels close to baselines trained on ten times as much data on Levels 1 and 2. On Level 4, 1% of the data already beats the best baseline trained on everything.

Generalisation to new tasks. The authors measure how much each method drops when moving from the easiest level to the hardest. The paper reports that the baselines can degrade by as much as 20% on the harder levels, while on the novel-task level VIMA's drop is only half as severe as any baseline's.

Architecture. Cross-attention to the prompt beats a plain decoder-only design that puts the prompt into the sequence, especially for small models and on the hardest level. Object tokens beat raw pixel tokens in every variant the authors tried, and passing the full variable-length object list to the controller beats compressing it to a fixed number of tokens.

Two numbers need careful reading. The paper's own note says the 2.7 times figure is computed from 46.0% at 10% of the data against 12.2% for VIMA-Gato trained on everything, giving (46.0 - 12.2) / 12.2, which is about 2.77, truncated to 2.7. The note calls VIMA-Gato the best competing variant, but in the same table VIMA-GPT trained on everything reaches 14.3% on Level 4, higher than VIMA-Gato. Measured against that baseline, the gap is about 2.2 times. The gain is still large; it is just smaller than the headline suggests.

The limits matter too. Everything is in simulation, and the demonstrations come from scripted oracles that can see the true object positions and the correct answer to each prompt. The object detector is imperfect, and the authors add false detections during training to make the policy robust to that, with a small cost compared with perfect boxes. The task suite is 17 tasks, so it is a broad test of the approach rather than a test of general manipulation. The success criterion is binary, with no partial credit.

Reading guide

Read the paper in this order. Each section depends on the concepts listed with it.

Check yourself

QuestionIn one sentence, what is the paper's claim about how robot tasks should be specified?Show answer
Many different robot tasks, such as goal reaching, video imitation, and visual constraint satisfaction, can be written as one multimodal prompt that interleaves text and images, so that a single sequence model can be trained to handle all of them.
QuestionUsing the Level 4 numbers in the text, compute the gap between VIMA at 10% of the data (46.0%) and VIMA-GPT at full data (14.3%), relative to VIMA-GPT, to one decimal place.Show answer
The gap is 46.0 minus 14.3, which is 31.7 percentage points. Dividing by 14.3 gives about 2.2, so the relative gain is about 2.2 times. This is smaller than the 2.7 times headline, which is measured against VIMA-Gato at 12.2%.
QuestionWhy does the controller use cross-attention to the prompt instead of putting the prompt into the same sequence as the history?Show answer
Cross-attention keeps the prompt tokens intact and lets the history query them directly at each step, which keeps the controller focused on the instruction. The paper reports that this matters most for small models and for the hardest generalisation level, and it is also cheaper than concatenating the prompt into a long sequence.
QuestionA robot policy's loss is the sum over steps of the negative log probability of the expert action. Why does minimising this sum make the policy copy the expert?Show answer
The sum is minimised when each expert action has high probability under the policy at the state the expert was in. So the policy learns to put most of its probability on the actions the expert chose, which is behavioural cloning. The expert in VIMA-Bench is a scripted oracle that can see the true object positions and the intended meaning of each prompt, so the policy is copying behaviour that the simulator's program produces.

Sources

  • Yunfan Jiang et al., VIMA: General Robot Manipulation with Multimodal Prompts, arXiv:2210.03094, 2022. arxiv.org/abs/2210.03094
  • VIMA project page, with code, the VIMA-Bench simulator and videos. vimalabs.github.io

Read the full paper

Yunfan Jiang, Agrim Gupta, Zichen Zhang et al., 2023. arXiv:2210.03094