A patch is a small, fixed-size piece of an image represented as numbers. Dividing an image into patches gives a transformer a sequence of inputs, much as tokenization gives a language model a sequence of text units. section 6.3.1 section 6.4
A typical patch-processing pipeline works like this:
- Divide the image into fixed-size tiles, commonly 16 × 16 pixels. section 6.3.1
- Convert each pixel’s red, green, and blue values into one long numerical vector; a 16 × 16 RGB patch contains 768 values. section 6.3.1
- Pass the vectors through a small neural network before sending the resulting sequence to the transformer. section 6.3.1
Figure 6.12 On the left, this simplified diagram shows how text input is tokenized and embedded before going to the transformer. An unembedding layer then converts the transformer output into the desired text representation. The input and output will be images when performing a computer vision task. The transformer stays the same, but then we modify the method for breaking the image into a sequence of vectors to perform patch extraction instead of tokenization. The LLM produces image output using a patch combiner, analogous to the unembedding layer for text LLMs.
Trace how patch extraction replaces tokenization while the transformer remains central, and how a patch combiner reconstructs image output. section 6.3.1




