TL;DR
Reed and colleagues asked whether one network could act as a generalist agent, the way large language models handle many text tasks. Their agent, Gato, is a single transformer of about 1.2 billion parameters. Every input and output is turned into a flat sequence of tokens, and the model predicts the next token. The same weights can caption images, chat, play Atari games, and stack blocks with a real robot arm, deciding from context whether to emit text, joint torques, or button presses.
Builds on: Transformer, Autoregressive Model, Behavior Cloning, Markov Decision Process, Subword Tokenization · Leads to: Neural Scaling Laws, since the paper's own scaling study asks how performance grows with model size
Why it mattered
Before Gato, the usual route to a capable agent was a specialist. Each domain got its own architecture, observation format, and training recipe, and a robot policy shared almost nothing with a game-playing one. The paper argues that a single sequence model removes that split: it needs no hand-built inductive bias per domain, it can ingest any data that can be serialised into a sequence, and its performance keeps improving with scale.
The result is a concrete demonstration rather than a theory. On the 604 tasks the paper describes, Gato performs more than 450 of them above half of the expert score for that task. On the real-robot RGB stacking benchmark it matches a single-task behaviour-cloning baseline, with an average success of 50.2 percent against 49 percent. The paper also shows that the model can learn a new task from 500 demonstrations, reaching 60 percent success on a stacking variant that the pretraining data never contained, where a baseline trained from scratch reached 0.5 percent.
The paper matters as a design statement. Its authors choose to serve every modality through one tokenizer and one objective, the same objective used for language models, and they accept the costs. Those costs are a fixed context window, a reliance on expert data, and a model small enough to run in real time on the robot.
The problem
To build a generalist, three things have to be solved at once. The model must read very different inputs, from text and images to proprioception and discrete button presses. It must output very different things, from words to continuous joint torques. And it must know which task to perform when several tasks share the same robot or the same observation format.
Robot learning adds a data problem. Teleoperated demonstrations are slow and costly, so behaviour cloning on a real arm needs a lot of pretraining data from elsewhere. Reinforcement learning from scratch on each task needs far more trials than a real arm can supply. The paper's bet is that expert data from many simulated and real tasks, mixed into one training corpus, can give the model enough breadth to adapt quickly to a new task.
Finally, a fixed sequence model has a fixed context. At deployment the model attends to at most 1024 tokens, so a long episode or demonstration is cut down to whatever recent window fits, which limits how much of a demonstration the model can see when it is asked to imitate a task.
How it works
Gato's pipeline has six steps, from raw data to an action on a robot.
flowchart LR A["Raw data: text, image patches, discrete and continuous values"] --> B["Tokenize into integers"] B --> C["Embed each token; add position encodings"] C --> D["1.2B-parameter decoder-only transformer predicts next token"] D --> E["Loss on text and actions only; deploy by sampling action tokens"]
- Tokenise one robot timestep. Take the two 128 by 128 camera images from the RGB stacking robot. Cut each into non-overlapping 16 by 16 patches. A 128 by 128 image gives 8 by 8, which is 64 patches. Check: two cameras give 128 image tokens for the timestep, before any joint readings or actions.
- Tokenise the continuous readings. Each joint angle or torque is first squashed into the range from minus one to one by a mu-law curve, then split into 1024 uniform bins. Each bin becomes an integer token in the range from 32000 to 33023. Check: a value near the middle of the range lands near bin 512, which is token 32512 or close to it.
- Order the tokens. Observation tokens come first for the timestep, then a separator, then action tokens. Episodes are the timesteps in time order. Check: the sequence is the same flat stream a language model would read.
- Embed and predict. A lookup table embeds text and discrete or continuous tokens, a ResNet block embeds image patches, and learned position encodings are added. A transformer with 24 layers and an embedding size of 2048 predicts the next token from all earlier ones. Check: image tokens are inputs only, so the loss does not ask the model to predict them.
- Choose what to learn from. The loss counts only text tokens and logged agent actions, so it is a masked sum of log-probabilities. During training 25 percent of sequences start with a prompt drawn from the same task. Check: the prompt tells the model which task it is in when observations alone would be ambiguous.
- Act. At deployment, Gato reads a demonstration prompt, reads the new observation, samples the action tokens one at a time, decodes them into joint commands, and repeats. The context is 1024 tokens. On the real robot the paper shortens the context to one timestep so the 20 Hz control loop can keep up. Check: at 128 image tokens per timestep for two cameras, the images alone fill about eight timesteps of context, which is why the paper calls the short context a real limit.
The math
The model is a sequence model, so the probability of a whole sequence is the product of next-token probabilities. With tokens and parameters , the chain rule gives
This is the Autoregressive Model factorisation, and it is the same one that trains a Language Model.
Step 5 in symbols: the masked loss
For a batch of sequences, let if token of sequence is text or a logged agent action, and otherwise. The training loss is the masked negative log-likelihood
Each term is a Cross-Entropy Loss on the true next token. Masking the image and observation tokens means the model does not spend capacity predicting pixels or sensor readings that it never has to output.
Step 1 in symbols: image patches
An image of pixels with patch size becomes tokens. For the robot cameras, , so there are patches per camera. Each pixel is scaled to lie in and then divided by .
Step 2 in symbols: continuous values
A continuous value is first mapped by a mu-law curve to , then discretised into 1024 bins. If the bin index is , the token is . Text uses ids from 0 to 31999 from a SentencePiece vocabulary, and discrete values such as button presses use ids in .
Step 6 in symbols: context budget
If each timestep contributes tokens and the context is , the number of timesteps the model can see is about . With from two cameras alone, this is . Adding joint readings and actions reduces it further.
Results
The paper's headline numbers are summarised below, as reported.
| Result | Number in the paper |
|---|---|
| Tasks with a single network and weights | 604 in the figure; 596 in the dataset table |
| Simulated control tasks above 50 percent of expert | Over 450 of 604 |
| ALE Atari, average human or better | 23 games, with over twice human score on 11 |
| BabyAI, above 80 percent of expert | Nearly all levels; BossLevel at 75 percent |
| Meta-World, above 50 percent of expert | 44 of 45 tasks |
| RGB stacking, real robot skill generalisation | 50.2 percent average, against 49 percent for BC-IMP |
| RGB stacking, real robot skill mastery | 75.6 percent average, against 74.6 percent for BC-IMP |
| Out-of-distribution "stack blue on green", real robot | 60 percent after fine-tuning on 500 real demonstrations (with simulated ones mixed in); 0.5 percent for a behaviour-cloning baseline trained from scratch |
| Specialist Meta-World agent, 79M parameters | 96.6 percent average success over 50 tasks |
| Specialist Atari agent, 1.18B parameters | Better than average human on 44 games |
Scaling. The paper compares three sizes: 79 million, 364 million, and 1.18 billion parameters. For an equal number of tokens, the larger models reach higher normalised return, and the authors read this as a consistent improvement with capacity. The scaling law is not fitted in the paper as a formula, so the claim rests on the curves.
Fine-tuning. On the RGB stacking tasks, fine-tuning on a few episodes recovers expert performance with 10 episodes and peaks at 100 or 1000. The paper also finds that the larger model adapts with fewer episodes than the smaller ones, and that pretraining on all the data helps more than pretraining on the same domain alone.
Specialists. A 79-million-parameter specialist trained on all 50 Meta-World tasks, distilled from expert agents, reaches 96.6 percent average success. A 1.18-billion-parameter specialist on Atari beats average human on 44 games, against 23 for the generalist. The paper says it chose Gato's size to run in real time on the robot, so the generalist is smaller than its specialists on purpose.
Limits. The context of 1024 tokens restricts how much of a demonstration the model sees, especially with image observations, and the authors say quadratic self-attention is the reason longer contexts are hard. Gato learns from expert data, so its quality is capped by the experts that produced it, and the paper notes that building a web-scale control dataset is an open problem. Some tasks show no benefit from pretraining, such as the Atari game boxing, where the authors suspect visually distinct inputs make transfer hard. The dataset table and the figure give different task counts.
Reading guide
- Section 2.1, Tokenization. Read Subword Tokenization for the 32,000-piece text vocabulary, Mu-Law Companding for the continuous-value encoding, and Vision Transformer (ViT) for the patch idea.
- Section 2.2, Embedding. The ResNet block on image patches is in Deep Residual Learning for Image Recognition (ResNet), and the position encodings are described in Positional Encoding.
- Section 2.3, Training. The masked loss is an Autoregressive Model objective trained with Cross-Entropy Loss. The model is a Transformer of the kind described in its lesson.
- Section 2.4, Deployment. Acting as a policy is a Markov Decision Process loop, and the agent learns from demonstrations, which is Behavior Cloning.
- Section 3, Datasets. The control data is expert experience from reinforcement-learning agents, as described in Reinforcement Learning.
- Section 5.1, Scaling. The size comparison is the empirical side of Neural Scaling Laws.
- Section 5.2 and 5.3, Out-of-distribution tasks and fine-tuning. These are few-shot adaptation experiments: pretrain on the mixed data, then fine-tune on a few demonstrations. The comparison baselines are Behavior Cloning agents trained from scratch.
- Section 6, Related work. The closest architectures are Decision Transformer: Reinforcement Learning via Sequence Modeling, which also models control as a sequence, and Transformer-XL: Attentive Language Models beyond a Fixed-Length Context, which the paper borrows for memory at deployment time.
- Section 8, Limitations. The quadratic cost of attention is the limit set by Transformer.
Check yourself
QuestionWhich tokens contribute to Gato's training loss, and why are the others masked?Show answer
QuestionA robot has two 128 by 128 cameras and the context is 1024 tokens. Using image tokens alone, how many timesteps fit in the context?Show answer
QuestionWhy does Gato use a demonstration prompt for 25 percent of training sequences instead of a task identifier?Show answer
QuestionA team wants Gato-style control for a new arm with a different set of joint sensors. What should they do, and what result from the paper supports it?Show answer
Sources
- Reed S, Żołna K, Parisotto E, et al. (2022). A Generalist Agent. Transactions on Machine Learning Research. https://arxiv.org/abs/2205.06175
- DOI for the arXiv preprint: https://doi.org/10.48550/arXiv.2205.06175