Large Model Multimodality
Large Model Multimodality
Multimodal large models allow AI to process multiple information formats such as text, images, audio, and video simultaneously, which is one of the most core development directions for large models currently.
This article explains the concept, development process, internal principles, and typical capabilities of multimodality from scratch, and provides a runnable example of building the first multimodal application in the end.
I. What is Multimodality?
Traditional large models can usually only process one type of information—text; if you give a traditional AI an image and ask it "How many cats are in the picture?", it cannot do so if it does not support multimodality.
But the real world is not composed of text, but of various sensory information:
| Senses | Corresponding information |
|---|---|
| Eyes | Images |
| Ears | Sounds |
| Mouth | Language |
| Hand | Action |
| Video | Image + Time |
| Webpage | Text + Image + Structure |
Therefore, the concept of Multimodal emerged.
Understand in one sentence:
Multimodal = a model that can simultaneously understand and generate multiple types of information.
Look at two typical examples:
-
1. Input image plus question:"Is the food in this picture high in calories?", the model answers:"This is fried chicken and fries, estimated to be about 1200 kcal."
-
2. Input voice:"Summarize this meeting for me", the model outputs a text summary and includes action items.
This ability to describe images and summarize audio is the most direct manifestation of multimodal capabilities.
II. What is a Modality?
Modality is the form in which information is presented.
Different modalities correspond to different inputs and outputs; the table below lists common modalities and their typical applications:
| Modality | Input Example | Output examples | Typical applications |
|---|---|---|---|
| Text | Novels, chat logs | Answers, articles | Q&A, writing, translation |
| Image | Photos, screenshots | Image understanding, image generation | OCR, visual question answering |
| Audio | Speech, music | Transcription, speech synthesis | Meeting summarization, voice assistant |
| Video | Video stream | Video analysis, timeline | Tutorial summary, content retrieval |
| Sensor | GPS, temperature | Control signal | Robot, autonomous driving |
| Action | Mouse click, keyboard input | Execute actions | GUI Agent, automation |
The more modalities a model supports, the closer its capabilities are to human-like, which is why all top labs are upgrading text models to multimodal models.

III. The Development Process of Multimodal Large Models
Multimodal large models have gone through three distinct stages, from only being able to process text to being able to see, hear, and output video.
Stage One: Language Models (LLM)
In this stage, both the input and output of the model are text, and representative products include OpenAI GPT series, Anthropic Claude, and Google Gemini.
They can write code, write articles, translate, and answer questions, and their capabilities are very strong, but there is a fundamental limitation: they cannot see.
Phase Two: Vision-Language Models (VLM)
VLM adds "image viewing" capability on top of LLMs; a typical use case is uploading a screenshot of a webpage and asking "why is the layout wrong," with the model answering "CSS conflict."
In this phase, the model begins to possess capabilities such as image understanding, OCR, and chart understanding.
Phase Three: Native Multimodal Models
Native multimodal models no longer treat "images" and "text" as two spliced modules, but unify the processing of images, audio, video, and text from the start of training.
It possesses complete capabilities: seeing, hearing, speaking, reasoning, and executing, which is also the mainstream direction in the industry today.
Four, how do multimodal models work internally?
The internal workings of multimodal models can be summarized in one sentence: converting all data into a unified vector space.
For example:
Three expressions, "a cat", "cat", and cat.png, although from different modalities, will fall into close regions in the vector space after encoding.
The overall process is shown in the figure below:
The figure above shows the complete link from input to output, and the following breaks down each step.
Step 1: Encoding
Different modalities must first be converted into numbers for the model to process.
| Modality | Raw data | Encoded |
|---|---|---|
| Text | "Hello" | [2034, 789] A set of token ids |
| Image | Pixel matrix | Visual feature vector |
| Audio | Waveform | Spectral feature vector |
Step 2: Unifying semantic space
The key step in encoding is to make "cat", "cat", and cat.png close to each other in the vector space.
This is the essence of "cross-modal understanding": projecting features from different modalities into the same space.
Step 3: Generating output
After inference in the unified space, the model "reconstructs" the results into different modalities as needed.
The output can be: text, image, audio, or video.
For example: upload an image → describe → then generate an introductory video, this is a complete multimodal generation chain.
V. Why can Transformer unify multiple modalities?
There is only one core reason: the Attention mechanism.
The core formula of Transformer is Attention(Q, K, V), which means "the model decides what to focus on itself."
For example: when the user asks "Who is playing basketball in the picture?", the model will:
- First look at the image and identify all people in the picture.
- Identify the basketball in the picture.
- Determine the relationship between "who" and "basketball".
- Generate answers with comprehensive context
This "self-determined focus" capability makes the Transformer naturally suitable for processing multimodal inputs:
| Input | What the model is focusing on |
|---|---|
| Pure text | Semantic relationships between sentences |
| Image + text | Correspondence between image regions and text descriptions |
| Video + Text | Association between timeline segments and questions |
This is also why Attention has almost become a "standard feature" of all modern large models—it is inherently designed for cross-modal tasks.
VI. Typical Multimodal Capabilities
Multimodal models possess five typical capabilities, and the figure below shows the relationship between them.
1. Image Understanding
Input a screenshot, and the model outputs page questions, UI analysis, or OCR results.
The most common scenario for programmers is: screenshot an error and have the AI locate the problem.
2. Image Generation
Input a text description such as "generate a futuristic city," and the model returns an AI image.
Typical applications: posters, covers, game assets, product sketches.
3. Voice Interaction
Speak to input, the model responds in real-time, with capabilities covering ASR (Automatic Speech Recognition), TTS (Text-to-Speech), and dialogue.
4. Video Understanding
Upload a tutorial video, and the model outputs a summary, timeline, and key answerable segments.
5. Agent
When you input "Help me make a PPT", the model begins executing a complete action chain: search for materials → generate outline → create slides → revise → export.
An Agent is the final form that combines "seeing, hearing, speaking" and "hands-on execution".
VII. Five Terms Beginners Must Understand
The terms in the table below will appear repeatedly when reading multimodal-related documentation; memorize them first:
| Term | Meaning | Example |
|---|---|---|
| Token | The smallest unit processed by the model, text is split by words | "Hello world" → [you][good][world] |
| Embedding | The process of converting information into numerical coordinates | "Cat" → [0.12, 0.78, 0.33, ...] |
| Context | The history and background information of the current conversation | When the user says "apple" + "context: phone" = iPhone, not fruit |
| Attention | Deciding which part of the input the model should focus on | When looking at an image, the model first looks at the "person" and then the "basketball" |
| Inference | The process of the model generating output based on the input | After the user inputs a question, the model "thinks and answers" |
These five terms run through all large model documentation; first build intuition, and refer back for details.
VIII. Hands-on Experience: Build Your First Multimodal Application in 5 Minutes
Goal of this section: Upload an image and have the AI output a text description.
The entire process does not require any deep learning foundation, only knowledge of Python.
8.1 Prepare the project
First, create a project named multimodal-demo and test it using the openai library:
Example
Create project
mkdir
multimodal-demo
Enter the project directory
cd
multimodal-demo
Install the official OpenAI SDK (compatible with multiple multimodal models)
pip
install
openai
Upload an image cat-cartoon.webp to the multimodal-demo directory, as shown below (you can right-click and save it to test):
8.2 Write the calling code
This example uses Ark's Coding Plan, whose doubao-seed-2.0-pro model supports multimodality.
Save the following code as test.py:
Instance
import
base64
import
os
from
io
import
BytesIO
from
openai
import
OpenAI
from
PIL
import
Image
==================== Ark Configuration ====================
ARK_API_KEY
=
"ark-xxxx"
Enter your Key here
ARK_BASE_URL
=
"https://ark.cn-beijing.volces.com/api/coding/v3"
It is recommended to use the general v3 interface
MODEL_ENDPOINT
=
"doubao-seed-2.0-pro"
Supports multimodal models
Initialize client
client
=
OpenAI
(
api_key
=
ARK_API_KEY
,
base_url
=
ARK_BASE_URL
,
timeout
=
60
)
def
prepare_image_base64
(
image_path:
str
,
max_size:
int
=
1024
)
str
:
"""
Read local image, process alpha channel, resize, and convert to base64 string
"""
if
not
os
.
path
.
exists
(
image_path
)
:
raise
FileNotFoundError
(
f
"Test image not found: {image_path}"
)
with
Image.
open
(
image_path
)
as
img:
1. Process RGBA transparent background
if
img.
mode
==
"RGBA"
:
background
=
Image.
new
(
"RGB"
,
img.
size
,
(
255
,
255
,
255
)
)
background.
paste
(
img
,
mask
=
img.
split
(
)
[
1
]
)
img
=
background
elif
img.
mode
!=
"RGB"
:
img
=
img.
convert
(
"RGB"
)
2. Proportional scaling (to prevent large images from overflowing Payload/Token)
img.
thumbnail
(
(
max_size
,
max_size
)
)
3. Convert to Base64
buf
=
BytesIO
(
)
img.
save
(
buf
,
format
=
"JPEG"
,
quality
=
85
)
Appropriate compression quality
b64
=
base64
.
b64encode
(
buf.
getvalue
(
)
)
.
decode
(
"utf-8"
)
return
f
"data:image/jpeg;base64,{b64}"
def
multimodal_chat
(
img_path:
str
,
prompt:
str
)
:
"""Multimodal conversation test"""
try
:
(
f
"Processing image: {img_path} ..."
)
img_b64
=
prepare_image_base64
(
img_path
)
(
"Sending request to Volcengine Ark platform..."
)
res
=
client.
chat
.
completions
.
create
(
model
=
MODEL_ENDPOINT
,
messages
=
[
{
"role"
:
"user"
,
"content"
:
[
{
"type"
:
"text"
,
"text"
: prompt
}
,
{
"type"
:
"image_url"
,
"image_url"
:
{
"url"
: img_b64
}
}
]
}
]
,
temperature
=
0.7
,
max_tokens
=
1024
)
(
"\n"
"="
10
" Recognition result "
"="
10
)
(
res.
choices
[
0
]
.
message
.
content
)
(
"="
30
)
return
res
except
FileNotFoundError
as
e:
(
f
"【Error】{e}"
)
except
Exception
as
e:
(
f
"【API Request Failed】Please check the network or if the Endpoint/Key is correct. Error message:\n{e}"
)
return
None
if
name
==
"main"
:
Test configuration
image_file
=
"./cat-cartoon.webp"
question
=
"Provide a detailed description of the content in this image, analyzing the main subject, colors, and scene."
Simulate creating a temporary test image (if the corresponding image is not locally available, for quick visual debugging)
if
not
os
.
path
.
exists
(
image_file
)
:
(
f
"No {image_file} detected, generating a temporary test image..."
)
Image.
new
(
'RGB'
,
(
200
,
200
)
,
color
=
(
73
,
109
,
137
)
)
.
save
(
image_file
)
multimodal_chat
(
image_file
,
question
)
Running Python, the output is as follows:
Original prompt (Chinese, left untranslated)
在发送请求至火山引擎方舟平台...
========== 识别结果 ==========
这是一张**Q版萌系卡通风格的数字角色插画**,整体背景为纯净的纯白色,没有任何环境元素,所有视觉重心都集中在中心的小猫主体上,是典型的独立角色立绘/吉祥物设计。
---
### I. Detailed description of the main subject
The main subject is a well-composed, sitting cartoon kitten, a domesticated orange and white tabby cat image designed to be cute, with an overall temperament that is gentle, innocent, and friendly:
1. **比例与姿态**:采用萌系设计特有的大头短身比例,头部占整体高度的60%左右,
...
Opening the browser console will show the model's text description of the image. The entire process is:
User uploads image -> Browser sends image URL to OpenAI SDK -> Multimodal model understands the image -> Returns text description -> Prints to console.
8.3 Common Extensions
After completing the above minimal runnable code, you can continue to extend:
| What you want to do | How to modify |
|---|---|
| Change to upload local files | After the user uploads the image, read it and convert it to base64, then assign it to image_file |
| Support continuous multi-turn conversations | Append the history of questions and answers to the messages array |
| Switch to other vendor models | Specify baseURL when constructing the OpenAI client, such as for Qwen, OpenAI, or Anthropic compatible endpoints |
| Handle speech | Change type: "image_url" to type: "input_audio" and provide base64 audio |
IX. Learning Roadmap (Recommended)
If you are new to large models, the figure below is a verified 6-week learning path.
X. What's Next?
Reviewing the evolution of software forms, a clear trend can be seen:
Past: Software = Functionality.
Present: Software = Model.
Future: Software = Multimodal Agent.
This means that in the future, users only need to say a sentence, such as "make a website," and the model will automatically complete the entire process of design, coding, deployment, and operation.
Multimodality is not as simple as "giving the model an image viewing function."
What it truly changes is:
Allowing computers to directly understand the real world.
This is the most important paradigm shift in the current AI industry and a direction all developers are worth investing in.
Frequently Asked Questions
Which is better, multimodal models or regular LLMs?
It depends on the scenario: for pure text writing, code generation, or translation, regular LLMs offer better cost-effectiveness; when needing to view images, listen to audio, or understand videos, multimodal models are the only option.
Can multimodal models run locally?
Yes, but the cost is higher. Small parameter VLMs (like Qwen2-VL-7B) can run on consumer-grade GPUs with 16GB of VRAM; larger models usually require cloud GPUs or API calls.
Is the output of a multimodal model always text?
Not necessarily. Native multimodal models can output text, images, audio, or even video; pure VLM usually only outputs text.
How to choose a multimodal API?
If only doing image understanding: OpenAI gpt-4o, Gemini 2.5 Flash, and Qwen2-VL are all cost-effective choices; if you want "sight + hearing + real-time voice," it is recommended to use the OpenAI Realtime API or Gemini Live directly.
