# Vision transformer (ViT)

> Canonical: https://skillalmanac.com/glossary/vision-transformer | Last verified: 2026-11-25 | Index status: index-eligible

A vision transformer (ViT) is an image model that cuts a picture into fixed-size patches, treats the patches like a sequence of words, and processes them with a transformer, the neural-network design used in transformer language models.

Also called: ViT, ViT model, vision transformers, ViT transformer, image transformer.

## In plain language

A vision transformer looks at a photo the way a language model reads a sentence. It cuts the image into small square tiles, lines the tiles up like words, and lets the model work out which tiles matter for each other. With a classification head and matching checkpoint, it can label what is in the picture, for example cat or car. It is usually trained first on a large collection of labelled pictures and then adjusted for a narrower task. A standalone image-classification version returns class outputs, not prose. A bare ViT returns representations and can be a component of a larger system.

## Technical definition

The vision transformer was introduced in the paper "An Image is Worth 16x16 Words" (Dosovitskiy et al., submitted to arXiv on 22 October 2020). The abstract states that a pure transformer applied directly to sequences of image patches can perform very well on image classification. Hugging Face's documentation describes ViT as splitting an image into fixed-size patches treated as a sequence of tokens, and its classification model puts a linear layer on top of the final hidden state of the [CLS] token. The same documentation says supervised pretraining gives the best results and that fine-tuning at a higher image resolution can help.

## How it shows up when you use agents

You meet vision transformers indirectly. Image tools, classifiers and the image input of some chat models may use a ViT or a design derived from it, and a coding agent may load one through a library such as Hugging Face Transformers, whose documentation describes ViT checkpoints. In a session it shows up when you ask an agent to label images, sort photos or build an [image classification](/glossary/image-classification) step.

The practical choices are about the model file, not the idea. The Hugging Face notes say the checkpoint name encodes the patch size and the image size it was fine-tuned at, for example a 16 by 16 patch and 224 by 224 resolution, and that inputs should be resized and normalised with the matching image processor. Use the matching image processor, as the Hugging Face notes say. The same notes say best results come from supervised pretraining, and a closed-set classification checkpoint has its configured labels; this is a head/checkpoint constraint, not the whole architecture’s definition.

What breaks when it is misunderstood: treating ViT as a replacement for other vision methods. It is one architecture in [computer vision](/glossary/computer-vision), next to the [convolutional neural network](/glossary/convolutional-neural-network). Next step: when an agent proposes a vision model, ask which checkpoint, which labels it was trained on, and how input images will be prepared.

## Common confusions

- **ViT versus a CNN.** A [convolutional neural network](/glossary/convolutional-neural-network) slides small filters over an image. A ViT splits it into patches and uses [attention](/glossary/attention-mechanism) between them. The paper argues that convolutions are not required for strong image recognition.
- **ViT versus a language transformer.** Both use the [transformer](/glossary/transformer) design. A ViT takes image patches as input, where a language model takes tokens of text.
- **ViT versus a multimodal chat model.** A bare ViT encodes images into representations; a classification head adds label predictions. A chat model that reads images is a larger system that may contain a vision component.
- **Myth.** A ViT understands a scene. A classifier outputs a label from the set it was trained on.

## Worked examples in this catalogue

### [alt-text-writer](https://skillalmanac.com/skills/skill-almanac/alt-text-writer)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: Image alt text and long descriptions written and checked in HTML and Markdown, per image function.

Why it exercises the concept: Adjacent, not a ViT tool. It deals with describing images in words, a task a vision model also touches, and it shows what a person still has to judge about an image.

### [image-spec-check](https://skillalmanac.com/skills/skill-almanac/image-spec-check)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: Exported images checked against your own spec table, with exact advice on what to resize, crop, re-export or replace.

Why it exercises the concept: A contrast case. It checks file properties against rules you supply and does not look at what is in the picture, which is the job a vision transformer does.

### [pdf](https://skillalmanac.com/skills/anthropic/pdf)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: PDF files read, merged, split, filled, created and OCRed.

Why it exercises the concept: A contrast case. OCR turns an image of text into characters. A ViT with a classification head can classify an image; a bare ViT supplies representations rather than labels. The two are different tasks on the same kind of input.

## Related terms

- [Transformer](https://skillalmanac.com/glossary/transformer.md)
- [Computer vision](https://skillalmanac.com/glossary/computer-vision.md)
- [Image classification](https://skillalmanac.com/glossary/image-classification.md)
- [Convolutional neural network (CNN)](https://skillalmanac.com/glossary/convolutional-neural-network.md)
- [Attention mechanism](https://skillalmanac.com/glossary/attention-mechanism.md)
- [Deep learning](https://skillalmanac.com/glossary/deep-learning.md)

## Sources

- [An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale](https://arxiv.org/abs/2010.11929), arXiv (Dosovitskiy et al.) (accessed 2026-11-24)
- [Vision Transformer (ViT)](https://huggingface.co/docs/transformers/model_doc/vit), Hugging Face (accessed 2026-11-24)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-25. [Glossary index](https://skillalmanac.com/glossary.md).
