Multimodal

Patch embedding

Slices the image into fixed-size patches and projects each one into a token - how pixels become a sequence.

Vision transformers do not see pixels; they see patches. The image is cut into a grid of fixed-size squares, each flattened and linearly projected into an embedding - one 'visual token' per patch. From that point on the vision encoder is just a transformer over a sequence, which is exactly why the same machinery works for text and images.

See it in real models

Open any of these on hfviewer to find this block in the interactive architecture graph.

Related concepts

hfviewer renders the full architecture of 2,300+ Hugging Face models as interactive graphs - hover any block to see what it does, with this model's real numbers.

Browse all model graphs →