Bookmarks

Multimodal model

A model that takes in or produces several kinds of data at once — text, images, audio, video — and links them in a single response.

Also: multimodal neural network, VLM, vision language model, vision-language model, image-text-to-text

checked 18 Nov

All terms

An ordinary language model reads only text. A multimodal model also accepts other kinds of data and answers about them: it describes a photograph, reads a scan, answers a question about a chart. The most common variant is a model with images and text as input and text as output.

VLMs: image and text

These models are called vision language models (VLMs). In the Hugging Face documentation they fall under the image-text-to-text task: unlike image-to-text models, which solve one narrow task, VLMs accept an arbitrary text prompt together with the picture.

What a VLM consists of

PartWhat it does
Image encoderturns the picture into a set of vectors; often a Vision Transformer, such as CLIP-ViT
Projectormaps the image vectors into the same space in which text tokens work; in LLaVA 1.5 it is a small MLP network
Language modelreceives text tokens and “image tokens” interleaved, and writes the answer

In LLaVA, a picture takes up a noticeable share of the context: in the Transformers configuration, the default length of one image is 576 tokens (image_seq_length). So several pictures quickly eat up the context window, and the prompt text contains an <image> marker, which is replaced by these tokens.

Other kinds of data

  • Audio: speech recognition models and models that understand audio input.
  • Video: a sequence of frames, which produces even more tokens.
  • As output: images and audio are more often created by separate models, such as diffusion models.

The idea of connecting a ready-made image encoder to a language model and fine-tuning the combination on “image — instruction” pairs is described in the LLaVA paper (Liu et al., 2023).

Sources

the term is written from these pages

Verified 18 Nov

Not to be confused with

what it is mixed up with and how it differs

  • LLMlarge language model

    An ordinary LLM works only with text, while a multimodal model also accepts other kinds of data.

  • embedding (vector representation)

    An embedding is a vector that describes data; a VLM’s image encoder produces such vectors, but the language model writes the answer.

In depth in the references

where the topic is covered in detail