Search

Search papers and lessons

PaLM-E: An Embodied Multimodal Language Model

Danny Driess, Fei Xia, Mehdi S. M. Sajjadi et al. · 2023

PaLM-E feeds images and robot sensor readings into a large language model as vectors, so one model can plan robot actions, answer questions about scenes and still write text.

On this page

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

TL;DR

PaLM-E is a large language model that also reads the world. Camera images and robot state estimates are encoded as vectors and placed in the same sequence as the words of a prompt, so the model can reason about what it sees and output text, such as a plan of robot skills. Its largest version has 562 billion parameters, and as one generalist model it scored 80.0 on VQAv2, a standard visual question answering benchmark, without being fine-tuned for that task.

Builds on: Vision-Language Model, Behavior Cloning, Language Model · Leads to: Vision-Language-Action Model

Why it mattered

The paper showed that a single pretrained language model could be turned into a robot planner and a visual question answerer at once. Before it, robot planners such as SayCan kept the language model blind: it saw only text descriptions from separate affordance functions. PaLM-E feeds the sensor data directly into the model.

The model also made transfer a central claim. Its authors reported that training on internet-scale vision and language data improved robot planning, which suggests that robot data alone is not the only route to embodied skill. Later work on vision-language-action models is a related line that also puts images in and actions out in one model.

The problem

Language models are trained on text, and text is only loosely connected to the physical world. A language model can know that a cup is usually on a table, but it cannot see whether this cup is on this table, or whether the drawer is open. Robots need answers to such questions to plan. The earlier SayCan approach avoided the problem by giving the language model a list of skills and asking it which one fits the instruction, while separate learned value functions decided which skill is possible now. The language model never saw the scene. That made long plans brittle.

The obvious alternative, a vision-language model, could answer questions about images but was not built for planning. The paper's authors also showed that a state-of-the-art vision-language model trained on typical vision question answering tasks could not directly solve the robotic reasoning tasks they studied. The gap was grounding: the model needed to take continuous sensor readings as input, and to do so without losing its language skills.

How it works

Trace one planning step in a kitchen. A person says, "I spilled my drink, can you bring me something to clean it up?", and the robot has just taken a photo of the counter.

flowchart LR
  I["Camera image"] --> E["Image encoder"]
  S["Robot state vector"] --> M["Small MLP"]
  T["Text tokens"] --> G["Token embedding"]
  E --> Q["Vectors in the language model's space"]
  M --> Q
  G --> P["Interleaved prompt"]
  Q --> P
  P --> D["Decoder-only language model"]
  D --> O["Text: next skill"]
  O --> L["Low-level policy runs the skill"]
  L --> I
  1. The prompt is built as one sequence. The instruction and the history of steps are written as text, and the photo is placed where it belongs, after "I see". Check: the prompt reads Human, instruction, Robot, history, and then the image, in order.
  2. Words become vectors. Each word token is looked up in the language model's embedding table. The paper uses a vocabulary of 256,000 tokens. Check: the image is still not a word, so it needs a different path.
  3. The image becomes several vectors. A Vision Transformer cuts the image into patches and produces a set of token embeddings, which a learned affine map projects to the language model's width. A state vector is handled more simply: a small MLP maps it to one or more vectors. Check: a two-number state such as (x, y) becomes a vector of the model's width.
  4. The vectors are interleaved with the text. The image vectors take the place of the special token in the sequence. Because the language model already uses positional encodings, the image vectors are placed among the words and need no fixed slot. Check: the sequence has the same kind of entries as a sentence, some from words and some from pictures.
  5. The decoder writes the next step. The model generates text one token at a time, as a decoder-only language model does. For this scene it might write "1. Find a sponge." Check: the output is ordinary text, not robot commands.
  6. A robot policy carries out the step. The step is mapped to a low-level skill. The paper's mobile manipulation experiments use RT-1 policies for this. The robot takes a new photo and the model is asked for the next step, until it outputs "terminate". Check: each step is decided from the newest observation, so the plan can change after a failure.
  7. Training adjusts the model. The loss is cross-entropy on the target text only, so the observation vectors are inputs and never predicted. Encoders and projections can be trained with the language model frozen, or everything can be trained together. Check: in both cases the model is taught to predict the next word, given the images and text before it.

The math

Definition: Multi-modal sentence

A multi-modal sentence is a sequence of vectors x1,…,xnx_1, \ldots, x_n in the language model's embedding space X\mathcal{X}. Each vector is either a word embedding γ(wi)\gamma(w_i) for a text token, or one of the vectors ϕj(Oj)i\phi_j(O_j)_i produced by an encoder ϕj\phi_j from an observation OjO_j.

Step 1 in symbols: the encoder maps observations into the space

An encoder ϕ\phi maps an observation, such as an image or a state vector, to qq vectors in X\mathcal{X}. The paper's encoders include a Vision Transformer with a learned affine projection ψ\psi, and an MLP for state vectors. Check: the output of every encoder has the width of the word embeddings, so the two kinds of entries can be mixed freely.

Step 2 in symbols: the sentence is decoded as in any language model

The language model gives the probability of a text sequence as a product of next-token probabilities, conditioned on the multi-modal prefix:

p(wn+1:L∣prefix)=∏l=n+1LpLM(wl∣prefix,wn+1:l−1)p(w_{n+1:L} \mid \text{prefix}) = \prod_{l=n+1}^{L} p_{\text{LM}}(w_l \mid \text{prefix}, w_{n+1:l-1})

Here wn+1:Lw_{n+1:L} is the target text, and the prefix holds all the image and text vectors before it.

Step 3 in symbols: the training loss

Only the target text is scored. The loss averages the negative log probability over the target tokens:

L=−1L−n∑l=n+1Llog⁡pLM(wl∣prefix,wn+1:l−1)\mathcal{L} = -\frac{1}{L-n} \sum_{l=n+1}^{L} \log p_{\text{LM}}(w_l \mid \text{prefix}, w_{n+1:l-1})

Check: if the model gives probability 0.5 to each of two target tokens, the loss is −log⁡0.5≈0.69-\log 0.5 \approx 0.69 per token.

Results

The paper evaluates on three robot environments and on general vision-language and language benchmarks. The numbers below are the paper's.

  • Mobile manipulation. On failure detection, PaLM-E with a frozen language model scored F1 0.91 against 0.73 for zero-shot PaLI, a vision-language model that had no robot training. On affordance prediction, asking whether a skill can be executed here, it scored 0.87 against 0.62 for PaLI and 0.63 for a value-function thresholding baseline, QT-OPT.

  • Planning data efficiency. On the task and motion planning environment, the paper's 1 percent data setting trains on 320 examples per planning task. In the summary the authors list 10 to 80 examples for the Language-Table environment and 320 for TAMP. Co-training on the full mixture of internet and robot data more than doubled planning performance for the ViT-4B variant, which the authors describe as transfer across embodiments and tasks.

  • Language-Table. With only 10 demonstrations per task, joint training on internet vision and language gave a more effective planner than SayCan, which the authors ran with oracle affordances, and than zero-shot PaLI. Neither SayCan nor zero-shot PaLI solved the easiest task tested.

  • Real robots. In a real tabletop environment, PaLM-E outputs language subgoals at 1 Hz, which low-level policies execute at 5 Hz. It was robust to adversarial disturbances, and it was fine-tuned on 100 long-horizon tasks with one example each.

  • General vision-language tasks. The 562B model, PaLM-E-562B, scored 80.0 on VQAv2 test-dev and 138.7 on COCO captioning (Karpathy test split), and the paper reports it as the highest number on OK-VQA among the models it compares. The 12B model with a frozen language model scored 70.3 on VQAv2, against 48.4 for the earlier frozen-model approach of Tsimpoukelli et al. (2021).

  • Language retention. Multimodal training makes a model forget some of its language skills, a problem called catastrophic forgetting. The paper reports that PaLM-E-12B lost 87.3 percent of its generation performance, relative, during multimodal training, while PaLM-E-562B lost 3.9 percent.

Limits: many embodied results use very few examples per task and depend on the quality of low-level policies that PaLM-E does not learn itself. The largest model is far too large for most labs to train or run, and the robot results come from specific environments, so the claim of a general robot planner is still a claim about these tasks.

Reading guide

Check yourself

QuestionRecall: how do images enter PaLM-E?Show answer
They are encoded into vectors in the same embedding space as word tokens, and those vectors are interleaved with the text inside one sequence. The language model reads them as it reads words.
QuestionComputation: the paper's 1 percent setting for a TAMP planning task has 320 examples. How many examples does that task's full dataset have?Show answer
The full dataset has 320/0.01=32000320 / 0.01 = 32000 examples, because 1 percent of the whole is 320, so the whole is 100 times 320.
QuestionWhy: why does PaLM-E use a decoder-only language model and not a separate image classifier?Show answer
Because the output is text, which can be a plan of skills or an answer to a question, and a decoder that predicts the next token can produce both. Its input is one sequence, so images and words can be mixed in any order.
QuestionApplied: a team wants a robot to answer questions about a room and to plan a sequence of skills, but wants to keep the language model's writing skills intact. What training choice from the paper helps, and what does it cost?Show answer
Freezing the language model and training only the input encoders keeps the language skills, but the paper notes this approach occasionally struggled on robotics tasks. Training everything end-to-end lets the model learn the robot tasks more fully, at the cost of some language forgetting, which the paper shows shrinks as the model gets larger.

Sources

Read the full paper

Danny Driess, Fei Xia, Mehdi S. M. Sajjadi et al., 2023. arXiv:2303.03378