Multimodal Transformers Need an Input and Fusion Contract

Calculate image patch records and distinguish modality tokenization from concatenation, cross-attention, adapters, objectives, data, and evaluation.

“Multimodal Transformer” does not identify one architecture. First ask how each modality becomes records and where information from different modalities can mix.

Tokenize an Image into Patches

An image of height HH, width WW, and CC channels can be divided into non-overlapping P×PP\times P patches. The number of patch tokens is

Timage=HPWP,T_{image}=\frac{H}{P}\frac{W}{P},

when both dimensions are divisible by PP. Each flattened patch has P2CP^2C values before projection to dmodeld_{model}.

For a 32×3232\times32 RGB image and P=8P=8:

Timage=4×4=16,P2C=82×3=192.T_{image}=4\times4=16, \qquad P^2C=8^2\times3=192.

This changes the input contract. The resulting records can still pass through ordinary Transformer blocks. Vision Transformer is one influential instance of this approach under its stated pretraining and transfer settings.

Choose Where Modalities Meet

Image and text records can be concatenated into one sequence, processed by separate encoders and joined by cross-attention, or connected through learned adapter/resampler modules. These are different fusion contracts.

QuestionExample answer
image representationprojected patch records
text representationtoken embeddings
fusion sitetext layers cross-attend to compressed visual records
objectivenext-token prediction conditioned on image and text
evidencedeclared image-text tasks and datasets

Flamingo provides one image-language fusion design. It does not define all multimodal systems.

Q1. Calculate image patch tokens

A 64×3264\times32 image is divided into non-overlapping 8×88\times8 patches. How many patch tokens result?

Compute it first, then check your number.

Hint
Calculate (64/8)(32/8)(64/8)(32/8).
Solution
The image produces 8×4=328\times4=32 patch tokens.
Not attempted
Review

Not marked done.

Do Not Hide the Data Contract

Architecture alone does not establish grounding or cross-modal understanding. Alignment data, objectives, negative examples, resolution, augmentation, and evaluation are part of the evidence. Their full treatment belongs to a later multimodal subject.

Pause and reflect

In your own words, note what you understood, what remains unclear, or what you want to revisit. The note stays with this lesson.

0 of 1 exercises marked done

Review

Not marked done.

LLM PrimerMultimodal Transformers Need an Input and Fusion Contracthttps://llmprimer.com/transformers/variants-scaling-and-boundaries/multimodal-transformers-need-an-input-and-fusion-contract© 2026 LLM Primer