Skip to content

B.14 Pass 12: Multimodal

This pass extends the text system to images and audio. A language model reads tokens, so an image or a clip of speech must become a sequence of vectors in the same space as text, and the model sees only the tensor its training processor produced. The pass builds that path from first principles: the signal and image mathematics (convolution as a matrix, layouts, resampling, the FFT, the STFT, and mel filterbanks), the vision models (conv layers, 2D RoPE and M-RoPE, a ViT encoder, dynamic resolution and tiling, image preprocessing to a written specification, and CLIP and SigLIP), and the speech models (Whisper’s log-mel frontend, encoder, decoder, and decoding).

Concepts from other sections (21)

This section uses these ideas. Each has a short definition and a link to the section that explains it in full. Tap a dotted term in the text to preview it.

Every piece is a Python reference on the course’s own autograd and numpy, built on the attention, RoPE, tokenizers, and checkpoints of earlier passes. The pass ends with the metrics that score transcripts and image answers, and with the consent and evidence rules for biometric data: voices and faces are biometric, so consent, not just access, decides what may be measured and published. Serving the multimodal models in the Rust engine and gateway is not part of this pass yet; the text system from Pass 11 keeps working unchanged.

Learning objectives

  • Explain convolution as a linear map, image layouts, resampling kernels, the FFT, the STFT, and mel filterbanks.
  • Explain how a ViT embeds patches, how 2D positions and tiling preserve geometry and detail, and how contrastive training aligns images with text.
  • Explain how Whisper turns audio into log-mel frames, encodes them, and decodes a transcript with special tokens and fallbacks.
  • Compute WER, CER, and the other multimodal metrics with confidence intervals, and explain why each needs consent-backed evidence.

This pass needs Pass 11. It leans most on the encoder-decoder transformer and RoPE from Pass 5.

  1. Convolution as a linear map. Afterwards you can explain why convolution is a linear map and how it is written as a matrix.
  2. Image tensors and layouts. Afterwards you can explain image tensor layouts (HWC, CHW) and how to convert between them.
  3. Resampling and interpolation. Afterwards you can explain how resampling and interpolation (nearest, bilinear, bicubic, antialiasing) compute output pixels.
  4. DFT and FFT. Afterwards you can explain the DFT as a matrix and how the FFT computes it in O(n log n).
  5. Sampling, Nyquist, windows, and the STFT. Afterwards you can explain the Nyquist limit, why windows reduce leakage, and how the STFT frames a signal.
  6. Mel scale and filterbanks. Afterwards you can explain the mel scale and how a mel filterbank is built from triangular filters.
  7. Signals and images problem set. Afterwards you can work every problem in the set and explain each answer.
  8. Conv layers and pooling. Afterwards you can explain how conv layers run through im2col and how pooling reduces resolution.
  9. 2D RoPE and M-RoPE. Afterwards you can explain how 2D RoPE and M-RoPE extend rotary position to images.
  10. Vision transformer encoder. Afterwards you can explain how the ViT encoder embeds patches and runs transformer blocks over them.
  11. Dynamic resolution and tiling. Afterwards you can explain how dynamic resolution tiles an image and how pixel shuffle reduces tokens.
  12. Image preprocessing. Afterwards you can explain each step of image preprocessing to the written spec.
  13. Contrastive image-text. Afterwards you can explain how CLIP and SigLIP train image-text alignment with contrastive losses.
  14. Audio frontend. Afterwards you can explain how the audio frontend parses WAV and computes Whisper’s log-mel features.
  15. Whisper encoder. Afterwards you can explain how the Whisper encoder’s conv stem and transformer blocks process log-mel frames.
  16. Whisper decoder and weights. Afterwards you can explain how the Whisper decoder cross-attends to the encoder and how its weights are loaded.
  17. Whisper decoding and transcription. Afterwards you can explain how Whisper decoding uses special tokens, timestamps, beam search, and temperature fallback.
  18. Multimodal eval metrics. Afterwards you can explain how WER, CER, and the other multimodal eval metrics are computed.
  19. Consent and biometric evidence. Afterwards you can explain why the model card’s numbers must match runnable evidence and why every source needs valid consent records.
  20. What the System Does After Pass 12. Afterwards you can explain how the system sees and hears: images and audio flow through preprocessing, encoders, and decoders that match their reference models.

The stages are also in this pass’s manifest, path.tsv. After this pass the system sees and hears, and the text system is unchanged.

Generated from path.tsv.

StageReadDone when
1Multimodal pass plan
B.14 Pass 12: Multimodal
You can explain the image, speech, and evaluation work in Pass 12 and how it builds on the text system.
2Convolution as a linear map
18.1 Convolution as a linear map
You can explain why convolution is a linear map and how it is written as a matrix (M12.1).
3Image tensors and layouts
18.2 Image tensors and layouts
You can explain image tensor layouts (HWC, CHW) and how to convert between them (M12.2).
4Resampling and interpolation
18.3 Resampling and interpolation
You can explain how resampling and interpolation (nearest, bilinear, bicubic, antialiasing) compute output pixels (M12.3).
5DFT and FFT
18.4 DFT and FFT
You can explain the DFT as a matrix and how the FFT computes it in O(n log n) (M12.4).
6Sampling, Nyquist, windows, and the STFT
18.5 Sampling, Nyquist, windows, and the STFT
You can explain the Nyquist limit, why windows reduce leakage, and how the STFT frames a signal (M12.5).
7Mel scale and filterbanks
18.6 Mel scale and filterbanks
You can explain the mel scale and how a mel filterbank is built from triangular filters (M12.6).
8Signals and images problem set
18.7 Signals and images problem set: convolution, sampling, Fourier, mel, contrastive losses, and WER
You can work every S-M12 problem and explain each answer.
9Conv layers and pooling
14.1 Conv layers and pooling on autograd
You can explain how conv layers run through im2col and how pooling reduces resolution (L13.1).
102D RoPE and M-RoPE
14.2 2D RoPE and M-RoPE
You can explain how 2D RoPE and M-RoPE extend rotary position to images (L13.2).
11Vision transformer encoder
14.3 Vision transformer encoder
You can explain how the ViT encoder embeds patches and runs transformer blocks over them (L13.3).
12Dynamic resolution and tiling
14.4 Dynamic resolution and tiling
You can explain how dynamic resolution tiles an image and how pixel shuffle reduces tokens (L13.4).
13Image preprocessing
14.6 Image preprocessing to the specification
You can explain each step of image preprocessing to the written spec (L13.6).
14Contrastive image-text
14.5 Contrastive image-text: CLIP and SigLIP
You can explain how CLIP and SigLIP train image-text alignment with contrastive losses (L13.5).
15Audio frontend
15.1 Audio frontend: WAV parsing and Whisper’s log-mel
You can explain how the audio frontend parses WAV and computes Whisper’s log-mel features (L14.1).
16Whisper encoder
15.2 Whisper encoder: conv stem, sinusoids, pre-LN blocks
You can explain how the Whisper encoder’s conv stem and transformer blocks process log-mel frames (L14.2).
17Whisper decoder and weights
15.3 Whisper decoder and checkpoint weights
You can explain how the Whisper decoder cross-attends to the encoder and how its weights are loaded (L14.3).
18Whisper decoding and transcription
15.4 Whisper decoding and long-form transcription
You can explain how Whisper decoding uses special tokens, timestamps, beam search, and temperature fallback (L14.4).
19Multimodal eval metrics
15.5 Multimodal eval metrics: WER, CER, VQA, captions, zero-shot
You can explain how WER, CER, and the other multimodal eval metrics are computed (L14.5).
20Consent and biometric evidence
34.2 Consent and biometric evidence in model cards
You can explain why the model card’s numbers must match runnable evidence and why every source needs valid consent records (ethics.08).
21What the system does after Pass 12
B.14.1 What the System Does After Pass 12
You can explain how the system sees and hears: images and audio flow through preprocessing, encoders, and decoders that match their reference models.