Intermediate5 min read51 of 52

Multimodality

Models that process and generate across text, images, audio, and video simultaneously.

SPEC: Multimodality

Definition

[Definition] Multimodality in LLMs refers to the ability of a model to process, understand, and generate content across multiple types of data modalities — not just text, but also images, audio, video, and structured data. A multimodal LLM (MLLM) can accept mixed inputs and reason across modalities.

Modalities in AI Models

ModalityDescriptionInput ExampleOutput Example
TextNatural languagePrompts, documentsResponses, summaries
ImageStatic visualsPhotos, diagrams, screenshotsDescriptions, captions
AudioSound/speechVoice recordingsTranscriptions, speech
VideoMoving imagesRecorded clipsDescriptions, timestamps
CodeProgramming languagesSource filesGenerated code
Structured dataTables, JSON, CSVSpreadsheetsAnalysis, SQL queries
DocumentsPDFs with layoutBusiness reportsExtraction, Q&A

Input vs. Output Modalities

Not all models are symmetric — many accept multi-modal inputs but produce text output only:

CapabilityExamples
Text + Image → TextGPT-4o, Claude 3.5, Gemini
Text + Audio → TextWhisper, GPT-4o Audio
Text → ImageDALL-E 3, Midjourney, Stable Diffusion
Text → AudioElevenLabs, OpenAI TTS
Text + Image + Video → TextGemini 1.5 Pro
Any → Any (native)GPT-4o (approaching this)

How Image Understanding Works in Transformers

Vision Encoder

Images are processed by a visual encoder (typically a Vision Transformer / ViT) before being fed to the language model:

  1. Image → split into patches (e.g., 14×14 pixel patches)
  2. Each patch → linear projection → patch embedding vector
  3. Sequence of patch embeddings → fed to the LLM's attention layers
  4. LLM reasons over both text tokens and image patch tokens together

Connector / Projection Layer

A projection layer maps vision encoder outputs to the LLM's embedding dimension:

Image → [Vision Encoder] → visual features → [Projection MLP] → LLM embedding space → [LLM]

End-to-End Training

Modern multimodal models are trained end-to-end or fine-tuned on (image, text) paired datasets:

  • Image captioning datasets (COCO, CC12M)
  • Visual QA datasets (VQA, GQA, ScienceQA)
  • Document understanding datasets (DocVQA)
  • Interleaved image-text web data (MMC4)

Multimodal Tasks

TaskInputOutput
Image captioningImageText description
Visual QAImage + QuestionText answer
OCR / Document Q&ADocument imageExtracted text/answers
Chart/diagram analysisChart imageData interpretation
Code from screenshotUI screenshotHTML/CSS/code
Medical image analysisX-ray/MRIClinical description
Video understandingVideo framesSummary/events
Audio transcriptionAudio fileText transcript

Leading Multimodal Models (2024–2025)

ModelModalitiesNotes
GPT-4oText, Image, AudioNative multimodal, real-time
Claude 3.5 SonnetText, Image, PDFStrong document understanding
Gemini 1.5 ProText, Image, Audio, Video1M token context, video native
LLaVA / LLaVA-1.6Text, ImageOpen-source vision model
Qwen2-VLText, Image, VideoStrong open-source option
PixtralText, ImageMistral's vision model

Audio Multimodality

Speech-to-Text (ASR)

  • Whisper (OpenAI): industry-standard open-source ASR
  • Deepgram, AssemblyAI: API-based transcription

Text-to-Speech (TTS)

  • OpenAI TTS, ElevenLabs, Azure Cognitive Services

Native Audio LLMs

  • GPT-4o Audio: processes raw audio natively (not speech-to-text first)
  • Gemini: native audio understanding

Multimodal Challenges

ChallengeDescription
Hallucination on imagesModel describes objects not present in image
Cultural/context biasImages from underrepresented contexts misunderstood
Small text in imagesOCR quality degrades at small font sizes
Complex chartsMathematical/scientific charts require specialized training
Long videoProcessing many frames within context limits
Audio with noiseBackground noise degrades transcription quality

Multimodal RAG

[Key Insight] Extend RAG to handle images and mixed documents: - Index document pages as images + extracted text - Retrieve relevant page images - Feed retrieved images + query to multimodal LLM - Particularly powerful for PDFs with charts, tables, diagrams

Practical Use Cases

IndustryUse CaseModalities
HealthcareMedical report analysisImage + Text
FinanceChart interpretation from reportsImage + Text
RetailProduct image search + descriptionImage → Text
LegalContract image OCR + analysisImage + Text
EducationDiagram explanationImage + Text
AccessibilityImage-to-audio descriptionImage → Text → Audio

Related Concepts

  • LLM, Embeddings, Vision Transformer, RAG, Inference, Token, Fine-Tuning