---
title: "Vision Language Models Explained"
description: "Vision language models combine an image encoder, a projector that aligns image features with text embeddings, and a text decoder that generates text from both inputs."
url: "https://swe.quest/articles/vision-language-models-explained-92cc71897cd36570"
canonical: "https://huggingface.co/blog/vlms"
source: "Hugging Face"
published: "2024-04-11"
difficulty: "medium"
kind: "How-to"
reading_minutes: 8
tags: ["computer-vision","llms","model-training","evals","python"]
---

# Vision Language Models Explained

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2024-04-11, 8 min read, How-to. Original: [https://huggingface.co/blog/vlms](https://huggingface.co/blog/vlms)

## Summary

Vision language models combine an image encoder, a projector that aligns image features with text embeddings, and a text decoder that generates text from both inputs. LLaVA trains in two stages: first only the projector with the encoder and decoder frozen, then the projector together with an unfrozen decoder. KOSMOS-2 instead trains end to end, and Fuyu-8B skips the image encoder entirely. The guide compares open VLMs by license, size and resolution, explains model selection via Vision Arena, the Open VLM Leaderboard and benchmarks like MMMU and MMBench, then shows inference with transformers' LlavaNext and supervised fine-tuning of Llava 1.5 using TRL's new experimental VLM support in SFTTrainer.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Computer vision](https://swe.quest/tags/computer-vision.md) (AI & ML)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [Model training](https://swe.quest/tags/model-training.md) (AI & ML)
- [Evaluation](https://swe.quest/tags/evals.md) (AI & ML)
- [Python](https://swe.quest/tags/python.md) (Languages)

## Prerequisites

- transformer models
- PyTorch basics
- Hugging Face transformers

## Keywords

LLaVA, TRL, SFTTrainer, Hugging Face transformers, MMMU, MMBench, CLIP, KOSMOS-2

## Related posts

- [A Dive into Vision-Language Models](https://swe.quest/articles/a-dive-into-vision-language-models-1c708a70976bf2ac.md): Hugging Face · 2023-02-03 · Hard · 18 min read · Computer vision, Model training, Machine learning, LLMs
  Vision-language models pair an image encoder and a text encoder with a strategy for fusing the two, and the pre-training objective determines which downstream tasks they handle well.
- [PaliGemma – Google's Cutting-Edge Open Vision Language Model](https://swe.quest/articles/paligemma-google-s-cutting-edge-open-vision-language-model-eb2d13e0b9bcd3ec.md): Hugging Face · 2024-05-14 · Medium · 11 min read · Computer vision, LLMs, Model training, Inference & serving, Python
  PaliGemma is Google's open vision-language model family that pairs a SigLIP-So400m image encoder with a Gemma-2B text decoder through a linear projector.
- [Vision Language Models (Better, faster, stronger)](https://swe.quest/articles/vision-language-models-better-faster-stronger-e122b57ac9aa84ed.md): Hugging Face · 2025-05-12 · Easy · 23 min read · LLMs, Computer vision, Machine learning, RAG & retrieval, Inference & serving
  Vision language models shifted over the past year toward smaller yet stronger models, any-to-any architectures, multimodal reasoning, Mixture-of-Experts decoders and vision-language-action models for robotics.
- [nanoVLM: The simplest repository to train your VLM in pure PyTorch](https://swe.quest/articles/nanovlm-the-simplest-repository-to-train-your-vlm-in-pure-pytorch-58371792838c4fd0.md): Hugging Face · 2025-05-21 · Medium · 9 min read · Model training, Computer vision, LLMs, Python
  nanoVLM is a minimal, readable pure-PyTorch toolkit for training small Vision Language Models, inspired by nanoGPT and runnable on a free Colab notebook.
- [Preference Optimization for Vision Language Models](https://swe.quest/articles/preference-optimization-for-vision-language-models-a84799e96613bf21.md): Hugging Face · 2024-07-10 · Hard · 11 min read · Model training, Computer vision, LLMs, Python
  TRL now supports direct preference optimization (DPO) for vision language models, trained on chosen/rejected answer pairs rather than fixed labels.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
