Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.One model for pictures, sound and words
To answer ‘is the light on the left wing green?’ you need both the picture and the question: neither alone tells you the answer. Early multimodal systems glued separate models together at the end. Newer models turn images, sound and text into one long stream of tokens and let a single transformer read it all, so every word can look at every patch of the image. The demo shows how much of such a stream is image, audio and text.
A robot that hears a command, sees the scene and reads a label needs all three at once; unified models make that possible in one network.
- 1. Late fusion combines…
- 2. Early fusion uses…
- 3. Answering a question about an image needs…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.By hand
- Late fusion: combine predictions or scores of separate models; simple, robust to a missing input, but cannot model interactions.
- Cross-attention fusion: a language model with inserted cross-attention layers reading visual features (Flamingo), often through a resampler that compresses them to 64 latents.
- Projector fusion: LLaVA-style; visual tokens projected into the LLM’s input sequence (early fusion of continuous embeddings).
- Native early fusion: images and audio quantised to discrete tokens and trained jointly with text from scratch (Chameleon, Gemini, GPT-4o); can generate any modality; Transfusion mixes next-token and diffusion losses.
- Token budgets: images (hundreds to thousands of tokens) and audio (25–50 per second) dominate sequence length; attention cost grows with its square. Resamplers (Q-Former, Perceiver) and token merging cut it.
- Missing modalities: modality dropout during training; masks in attention.
- Any-to-any: speech-to-speech assistants stream audio tokens in and out with low latency.
- 1. Flamingo fuses vision through…
- 2. Natively multimodal models represent images as…
- 3. BLIP-2's Q-Former reduces…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.Building with multimodal models
Exercise 1.
- An interleaved image-text sequence.
- Late fusion of probabilities.
- Cross-attention from text to image features.
Practice.
- Use hosted natively multimodal models (GPT-4o, Gemini, Claude) for mixed inputs; open models: Qwen2.5-Omni, Llama 3.2 Vision, Pixtral, Chameleon.
- Pass images at the lowest resolution that keeps the needed detail; crop to the region of interest.
- For speech-to-speech, use realtime APIs that stream audio tokens; measure end-to-end latency.
- For sensor fusion in robotics, start with late fusion as a baseline; move to joint models when interactions matter.
- Test each modality missing or corrupted.
from transformers import AutoProcessor, AutoModelForImageTextToText
proc = AutoProcessor.from_pretrained("Qwen/Qwen2.5-VL-7B-Instruct")
model = AutoModelForImageTextToText.from_pretrained("Qwen/Qwen2.5-VL-7B-Instruct", device_map="auto")
msgs = [dict(role="user", content=[dict(type="image", image=img), dict(type="text", text="Is the left wing light green?")])]
inputs = proc.apply_chat_template(msgs, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt")
print(proc.decode(model.generate(**inputs, max_new_tokens=50)[0]))- 1. A sensible first baseline for sensor fusion:
- 2. To cut image tokens…
- 3. Always test…
Level 3: Advanced
★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.Theory
Interactions. Late fusion with logits f(x) + g(q) is additive: it can raise or lower the answer by image and by question but cannot express ‘yes for this object and this question, no otherwise’. Any table T[object, question] that is not a sum of a row and a column effect is beyond it. A joint network on the concatenated inputs can represent any such table.
Attention cost. For n text and m visual tokens, self-attention costs O((n + m)²); cross-attention costs O(n m) and keeps the language model’s own sequence short, which is why Flamingo-style designs were attractive for many images.
Discrete tokens. Vector-quantised tokenizers map an image patch grid to codebook indices; generation becomes next-token prediction, at the cost of reconstruction detail and long sequences.
Missing inputs. A joint model trained on complete pairs sees out-of-distribution inputs when a modality is absent; modality dropout trains for that case. Whether it helps depends on how the absent input is represented.
- 1. Late fusion with summed logits is…
- 2. Cross-attention cost scales with…
- 3. VQ tokenizers map patches to…
Level 4: Expert
★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.When does joint (early) fusion beat late fusion, and does modality dropout make a joint model robust to a missing image?
History.
- J.-B. Alayrac et al., “Flamingo” (2022).
- J. Li et al., “BLIP-2” (2023).
- Chameleon Team, “Chameleon: mixed-modal early-fusion foundation models” (2024).
Exercise 2. Miniature visual question answering.
- Task: an ‘image’ vector (16 dimensions) shows one of 8 objects; a ‘question’ vector (8 dimensions) asks one of 4 yes/no questions; the answer is a fixed random table with question base rates 0.85, 0.7, 0.5 and 0.3; noise 0.5 on both inputs.
- Models (Adam, 1500 steps of 128): text-only MLP; image-only MLP; late fusion (sum of an image MLP and a text MLP logit); early fusion (one MLP on both); early fusion with the image zeroed for 30% of training examples (modality dropout).
- Missing image: test with the image vector set to zero. 4000 test examples.
| model | accuracy | image missing |
|---|---|---|
| text only | 0.715 | 0.715 |
| image only | 0.591 | 0.469 |
| late fusion | 0.787 | 0.716 |
| early fusion | 0.996 | 0.715 |
| early fusion + modality dropout | 0.993 | 0.694 |
- Neither modality alone answers: text gets the base rates, image the object’s average answer.
- Late fusion adds the two but cannot express the object × question table.
- Early fusion learned the table almost perfectly.
- Missing image: early fusion fell back to the text-only guess even without dropout; modality dropout gave no gain (seed 0 slightly worse; seeds 1 and 2 equal). A zero vector is close to the average image here, so the model was not out of distribution; with other encodings of absence the result may differ.
- Seeds 1 and 2: late fusion 0.756 and 0.737, early fusion 0.989 and 0.994, text only 0.623 and 0.681.
Unified multimodal models in AI, robotics and aerospace
- Vision-language-action models: RT-2 and OpenVLA put camera images, instructions and robot actions in one token sequence.
- Sensor fusion: aircraft and spacecraft combine cameras, radar and lidar; learned joint fusion is studied alongside classical filters, which remain the certified baseline.
- Mission assistants: speech-in, speech-out assistants that also read displays and documents.
References
- J.-B. Alayrac et al. (2022). “Flamingo: a visual language model for few-shot learning.” NeurIPS.
- J. Li, D. Li, S. Savarese and S. Hoi (2023). “BLIP-2.” ICML.
- Chameleon Team (2024). “Chameleon: mixed-modal early-fusion foundation models.” arXiv.
- C. Zhou et al. (2024). “Transfusion: predict the next token and diffuse images with one multi-modal model.” arXiv.