C.W.K.
Stream
Lesson 07 of 10 · published

Beyond Text: Vision, Audio, Biology

~14 min · vision, audio, biology, multimodal

Level 0Token
0 XP0/94 lessons0/10 achievements
0/120 XP to next level120 XP to go0% complete

The Transformer's most surprising property is that it doesn't really care what its input represents. Once you turn a domain into a sequence of embeddings, the same attention machinery that learns English grammar will learn image structure, audio spectrograms, or protein folding rules.

Three concrete examples that have already shipped at scale:

  • Vision Transformers (ViT, 2020). Split an image into 16×16 patches, linearly project each patch into an embedding, and feed the patch sequence through a Transformer encoder. ViT-H/14 reaches 88.5% top-1 on ImageNet. DINOv2 produces frozen visual features that LLaMA 3.2 vision and many multimodal LLMs reuse.
  • Whisper (audio). An encoder-decoder Transformer where the encoder consumes log-mel spectrograms (audio frames) and the decoder generates text via cross-attention. Same unit cell, different tokenization at the input.
  • AlphaFold 2 / ESMFold (biology). Variants of the Transformer applied to amino-acid sequences, predicting 3D protein structures. The attention matrix turns out to be a natural place to encode pairwise residue interactions.

The lesson: the Transformer is not a language architecture that happens to work on other things. It's a sequence-of-embeddings architecture. Anything you can tokenize fits.

Code

Same architecture, three input pipelines·python
# Text:    text -> BPE/WordPiece -> token ids -> embedding -> Transformer
# Vision:  image -> 16x16 patches -> linear proj -> embedding -> Transformer
# Audio:   waveform -> mel spectrogram -> patches -> linear proj -> Transformer
# Protein: sequence -> aa indices -> embedding -> Transformer

# After tokenization, the rest of the stack is identical.

External links

Exercise

Run a pretrained ViT (timm or torchvision) on three of your own photos and visualize the attention maps for the [CLS] token in the last layer. Where does the model 'look'? Compare against your intuition. Then redo the experiment with a fine-tuned classifier and see if attention concentrates differently.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.