Perceiver and Perceiver IO
A general architecture that decouples input size from compute complexity by cross-attending high-dimensional byte arrays into a fixed, small set of latents.
Paper: Perceiver IO: A General Architecture for Structured Inputs & Outputs
Authors: Andrew Jaegle, Sebastian Borgeaud, Jean-Baptiste Alayrac, Carl Doersch, Catalin Ionescu, David Ding, Skanda Koppula, Daniel Zoran, Andrew Brock, Evan Shelhamer, Olivier Hénaff, Matthew M. Botvinick, Andrew Zisserman, Oriol Vinyals, João Carreira · 2021
Read the paperThe Problem
Standard Transformers scale quadratically with their input size. If you double the length of a sequence, the self-attention operation takes four times as much memory and compute, because every token must attend to every other token.
This works perfectly for text, where a page is only a few hundred tokens. However, it completely breaks down for raw, high-dimensional modalities like high-resolution images, long audio waves, or video streams, which easily contain hundreds of thousands of individual pixels or samples. To apply Transformers to vision, researchers traditionally relied on domain-specific hacks, like chunking an image into large 16x16 patches (as in the Vision Transformer) or using 2D convolutions first to compress the image into a smaller grid. There was no single, generic architecture that could natively swallow a massive, unstructured byte array of raw sensory data without blowing up memory.
The Idea
DeepMind researchers realized that the compute bottleneck comes from forcing the entire input to attend to itself. Their breakthrough, introduced in the original Perceiver and expanded in Perceiver IO, was to introduce an asymmetric cross-attention bottleneck.
Instead of performing self-attention directly on the massive input array, the architecture maintains a small, fixed-size array of "latent vectors" (e.g., 512 vectors, compared to 50,000 input pixels). The model first uses cross-attention to let these small latents "look at" the massive input and extract only what is relevant. All the heavy, deep processing (self-attention) is then performed strictly on this small latent bottleneck. Because the complex processing happens only on a fixed number of vectors, the architecture's memory and compute costs decouple entirely from the raw size of the input.
How It Works
The architecture handles massive dimensionality by framing the problem as three distinct phases: Encode, Process, and Decode (in Perceiver IO).
Encode (Cross-Attention). The model initializes a small set of trainable, latent query vectors (e.g., N = 512). It projects the massive input array (e.g., M = 50,000) into Keys and Values. It then performs one cross-attention operation, using the small latents to query the massive input. This condenses the high-dimensional data into a tight, fixed-size latent representation. The complexity of this step is linear O(M * N), not quadratic.
Process (Self-Attention). Now that the information is trapped in the small latent array, the model can apply standard Transformer self-attention blocks. Since N is small (512), the O(N^2) cost is tiny and constant, regardless of whether the original input was 50,000 pixels or 100,000 audio frames. This self-attention stack can be made extremely deep to learn complex representations.
Decode (Cross-Attention). The original Perceiver only did classification, outputting a single label. Perceiver IO generalized the architecture to output arbitrarily structured data. It introduces a set of "Output Queries" (e.g., coordinates for an image, or time steps for audio) which cross-attend to the processed latent array. This allows the model to flexibly project the latents back into whatever shape is required for the task.
Why It Mattered
Perceiver IO provided the first truly modality-agnostic architecture that scaled linearly with input size. By confining the quadratic self-attention to a fixed-size latent bottleneck, it allowed a single, unmodified architecture to process language, vision, point clouds, audio, and video without requiring any domain-specific preprocessing like 2D convolutions, image patching, or audio spectrograms.
It proved that deep learning architectures no longer needed customized inductive biases for different types of sensory input. As long as you provide positional encodings, a single general-purpose bottleneck mechanism can dynamically route and process arbitrary byte streams.
What Came After
The Perceiver architecture deeply influenced the trend toward true multimodal models and unpatched vision models. Its core idea of asymmetric cross-attention into a latent bottleneck was directly adopted by architectures like DeepMind's Flamingo (which uses a very similar mechanism called the Perceiver Resampler to compress vision into language tokens). It paved the way for "byte-level" or "token-free" models that process raw data streams without domain-specific chunking.