Table of Contents

The Qwen-VL Series: Long-Form Lecture Notes

阅读中文版 →

Guide: How to Read These Notes

Guide: How to Read These Notes

If you picture the whole history of Qwen-VL as an open-world RPG, these notes are your official strategy guide: where the main quest goes, where the side quests and hidden bosses are, and exactly which skill points each generation decided to spend.

To help you find your way, the notes roughly follow this structure:

01

Background and Motivation

Why we need Qwen-VL at all, and which pain points of text-only models it addresses.

02

Catch-up Basics

Lay the groundwork on visual encoding, alignment losses and other concepts we will need later.

03

Family Tree

Draw the "academic family tree" of Qwen-VL and see how a small sapling grew into a whole forest.

04

Method, Generation by Generation

The core material: the architecture of each generation from Qwen-VL to Qwen3-VL, and the logic behind each change.

05

Experiments and Data

What actually matters in the results, rather than memorising numbers.

06

Reproduction and Outlook

Practical advice for reproduction and engineering, plus possible future research directions.

I will try to keep this conversational throughout: I will keep throwing out small questions like "What happens if we do it this way?" or "Can we be a bit greedier?", and then walk you through the answer with intuition plus formulas.

1 Part 1: Why Should We Care About Qwen-VL?

1 Part 1: Why Should We Care About Qwen-VL?

Picture this: you are chatting with an LLM that can only talk. It can explain anything, but the moment you hand it a picture, it turns into a "blind philosopher": happy to discuss the meaning of life, yet unable to see the world.

That is the typical predicament of a text-only model. Its brain is big and its memory is strong, but its input is one-dimensional text, so when it faces the real world's stream of interleaved images and text, a piece is simply missing.

Reference: Figure 1 from Qwen-VL Paper
Qwen-VL Capability Radar
Figure 1: Radar chart of Qwen-VL on a range of vision-centric tasks. Compared with other general-purpose models, Qwen-VL pushes outward on dimensions such as VQA, captioning and grounding. Think of it as an all-rounder in the making.

What the Qwen-VL series sets out to do is give this talking philosopher a pair of eyes, and while it is at it, a pair of AR glasses too: not only seeing every pixel in a picture, but also understanding time, space, text, formulas, UI actions, and even cause and effect across long videos.

To be more concrete, it has to get past at least three kinds of real-world "stuck levels":

  • Sees it but doesn't understand it: traditional OCR or detection models can circle text and draw boxes, but they don't know "where the problem is", let alone "what to do next".
  • Understands one image, but not a pile of them: faced with long documents, slide decks, web pages, GUIs and videos, the model cannot build stable memory and reasoning chains across dozens of pages or thousands of frames.
  • Understands the present, but not the history: many tasks require combining earlier context, previous dialogue turns, or the state of the previous screen, which demands genuine "long-context, multimodal" ability.

The Qwen-VL series has been upgrading along exactly these three pain points: from the original "describe what you see", to Qwen2-VL's "any resolution + video + multilingual", to Qwen2.5-VL's stronger reasoning, and finally Qwen3-VL, which pushes context length, long video and thinking ability to a new level.

So instead of treating the Qwen-VL papers as separate technical reports, think of them as a gradually upgraded "skill tree": each generation maxes out or rebuilds a few branches, and the goal of these notes is to help you see that tree clearly, from root to leaf.

2 Part 2: Catch-up Basics: From “a Brain That Only Reads” to “a Brain That Sees the World”

2 Part 2: Catch-up Basics: From "a Brain That Only Reads" to "a Brain That Sees the World"

Before we take Qwen-VL apart, we need to reach some common ground.
Many students find multimodal learning hard because it straddles two fields: CV (computer vision) and NLP (natural language processing). CV people are used to pixels, convolutions and IoU; NLP people are used to tokens, attention and perplexity.

But in fact, mathematically they are entirely compatible.
In this section we will use intuition first and run quickly through the three most essential concepts: ViT (turning vision into language), RoPE (rotary position encoding), and Cross-Attention (the bridge between modalities). These three are the foundation for understanding all of Qwen-VL's later clever tricks (such as M-RoPE and DeepStack).

2.1 Turning Vision into Language: ViT (Vision Transformer)

2.1 Turning Vision into Language: ViT (Vision Transformer)

If we want an LLM to understand images, the first step must be turning the image into a form the LLM can understand. What can an LLM understand? Only a sequence.
So ViT does exactly one thing: it chops a 2D image into a 1D sequence of vectors.

🎨 Illustrated: From Pixel to Patch Embedding

Image (H x W) x₁ x₉ Flatten Linear Proj (E) Sequence of Embeddings z₁ ... z₉ [CLS] z_i = Linear(Flatten(Patch_i)) + Pos_Embed_i

💡 Why cut the image into patches?

If every pixel were a token, a 224x224 image would have 50,176 tokens, and the attention cost would explode ($O(N^2)$).
After cutting into 16x16 patches, there are only $14 \times 14 = 196$ tokens, which strikes a balance between computational efficiency and information retention.

⚠️ Foreshadowing for Qwen-VL

A standard ViT needs a fixed resolution (say 224 or 336).
Question: What if a tall phone screenshot (1080x2400) comes in? Forced resizing distorts it, and zero-padding wastes compute. This problem is exactly the core pain point that Qwen2-VL Dynamic Resolution sets out to solve.

2.2 Elegant Position Encoding: RoPE (Rotary Positional Embedding)

2.2 Elegant Position Encoding: RoPE (Rotary Positional Embedding)

The attention mechanism in a Transformer is essentially "position-agnostic" (permutation invariant). If you shuffle the words of a sentence, the attention scores come out the same. So we have to tell the model "who comes before whom".
RoPE is currently the most elegant solution. Instead of adding a position vector, it rotates the word vector by some angle in space.

The geometric intuition of RoPE: relative distance = difference in rotation angle

q (pos m) k (pos n) Δθ = (n-m)θ Attention Score = q · k = |q||k| cos((n-m)θ)

Why does RoPE matter so much for Qwen-VL?
Because the Qwen-VL series has to handle not just 1D text, but also 2D images and 3D video.
In Qwen2-VL, to unify these modalities, the authors proposed M-RoPE (Multimodal RoPE), which extends the rotation into 3D space (time, height, width). If you don't grasp RoPE's core intuition that "relative position is determined by the rotation angle", you won't be able to see how M-RoPE "decouples" position information across three dimensions.

2.3 The Bridge Between Modalities: Cross-Attention

2.3 The Bridge Between Modalities: Cross-Attention

This is the key mechanism by which Qwen-VL injects visual features into the LLM. In self-attention, the query, key and value all come from the same sequence. In cross-attention, they part ways.

LLM Q Queries Vision K V Keys / Values Attn Fused Features

💊 The pharmacy analogy

Imagine the LLM is an old-school herbal pharmacist, and the vision encoder is a giant cabinet of herb drawers.

  • Query (Q): the "prescription" in the pharmacist's hand (what information does the current text context need? e.g. "Where is the cat in the picture?").
  • Key (K): the "label" on each drawer (the texture, shape and position features of the image).
  • Value (V): the actual "herbs" inside the drawer (the concrete visual feature vectors).

Cross-attention is the pharmacist taking the prescription (Q), matching it against the drawer labels (K), pulling out the corresponding herbs (V), and mixing them into the current diagnosis (text generation).

Note:

The first Qwen-VL used a similar mechanism (an adapter), but later versions (Qwen2-VL) switched, for efficiency, to a more direct MLP Merger (a C-Former variant). We study cross-attention to understand "why we map visual features into the language space at all".

2.4 Discretising Coordinates: Turning “Drawing a Box” into “Speaking”

2.4 Discretising Coordinates: Turning "Drawing a Box" into "Speaking"

Qwen-VL can do more than look at images; it can also draw boxes around objects in them (grounding).
Many students intuitively assume: surely this is done with regression? Predicting continuous values for x and y?
Wrong! Completely wrong! In an LLM's world there are only tokens. For an LLM to output coordinates, we must force continuous pixel coordinates into discrete vocabulary words.

🎯 Illustrated: Binning, or putting the world on a grid

Image (1000 x 1000) (300, 400) (700, 700) Quantize Range [0, 1000] LLM Vocabulary ... ID: 32001 -> "apple" ID: 32002 -> "banana" ID: 40300 -> <300> ID: 40400 -> <400> ID: 40700 -> <700> ... Output: <box> <300> <400> <700> <700> </box>

What Qwen-VL does:

  • Add 1000 special tokens to the vocabulary: <0>, <1>, ... <999>.
  • Normalise the image's width and height to [0, 1000].
  • When the model needs to output a coordinate, it is actually answering a 1000-way multiple-choice question.

🤔 A question from the teacher: Why cut into 1000 bins? Would 100 work? Would 10000?
Answer: too few (100) and localisation isn't precise enough, so boxes are off; too many (10000) and the vocabulary blows up, and the classification head becomes extremely hard to train (far too many classes). 1000 is an empirical sweet spot.

2.5 The Art of Masking: Causal vs. Bidirectional Mask

2.5 The Art of Masking: Causal vs. Bidirectional Mask

One last key point: how time and space differ inside attention.
An LLM (GPT-style) is unidirectional (causal), because you cannot see the tenth word while saying the first one (that would be cheating).
But looking at an image is bidirectional! When you look at a photo, do you scan from the left eye to the right, or the right to the left? You take it all in at once! Pixels in an image have no "order".

Here comes the conflict: when we stuff "bidirectional image tokens" into a "unidirectional LLM", how should the attention mask be drawn?

Hybrid Attention Mask Matrix

Visible (1) Masked (0) Vision ↔ Vision (all visible) Text → Vision 🚫 Vis ↛ Text Text → Text (causal triangle) Image Tokens Text Tokens Image Text
Key rules:
  • Inside the image (top left): all-ones matrix. All patches of the image can see each other, because they are spatial information that exists all at once.
  • Inside the text (bottom right): lower-triangular matrix. Text must obey causality: token $t$ can only see $1 \dots t-1$.
  • Text looking at image (bottom left): all ones. Wherever the text has got to, it can look back at the whole image.
  • Image looking at text (top right): all zeros. When the image is there, the text that follows has not been generated yet, so of course it cannot be seen (to prevent leakage).

This special mask design is the underlying guarantee that lets decoder-only models like Qwen-VL handle both understanding and generation tasks.

3 Part 3: The Qwen Family Tree: From Qwen-LM to Qwen3-VL

3 Part 3: The Qwen Family Tree: From Qwen-LM to Qwen3-VL

Let's first take a bird's-eye view: what does the Qwen family actually look like? Which members are "text-only siblings", which are "vision editions", which "specialise in images", and which "focus on long context and reasoning"?

The earliest is the Qwen-LM family, which laid the foundation for the text-only world. On that foundation, Qwen-VL plugged in the ability to "see images". Then the Qwen2 series upgraded both language and vision, giving rise to Qwen2-VL. After that came Qwen2.5 and Qwen2.5-VL, with stronger reasoning and longer context. Finally, Qwen3-VL brings everything together with a 256K context and strong thinking ability.

Let's draw this whole lineage as a "version evolution tree" in one diagram.

Illustrated: The Qwen Family Phylogeny Tree

Language Foundation (text-only base) Vision-Language Evolution (multimodal) Qwen-7B Qwen2 Qwen2.5 / 3 Qwen-VL Basic VQA + Grounding Qwen2-VL Dynamic Res + M-RoPE Qwen3-VL 256K Context Thinking Mode Based on

Key fact:A vision-language model is not a separate species; it is a branch growing on the tree of large language models. Whenever the underlying language model is upgraded, the vision version has to be rebuilt too, and that rebuild often brings new training strategies and new vision module designs along with it.

So to understand the Qwen-VL branch, it helps to keep an invisible timeline of "Qwen text-only history" in mind: every upgrade of the text backbone (from Qwen to Qwen2, then Qwen2.5 and Qwen3) brings the vision version longer context, better alignment and stronger reasoning.

3.1 Generation 1: Qwen-VL

Built on Qwen-LM, with a carefully designed visual receptor and input/output interface, this was the first time the model could reliably "describe images + ground objects + read text". The focus of this generation was filling in all the basic visual abilities.

3.2 Generation 2: Qwen2-VL

Key words: Dynamic Resolution and M-RoPE. No longer bound by a fixed resolution, and no longer willing to treat video as a pile of unrelated images. It gained a clear edge on documents, UIs and long videos.

3.3 Generation 3: Qwen2.5-VL

Its role was "refining inner strength": stronger mathematical reasoning, code understanding and structured extraction (JSON, tables), plus a longer context so the model holds steady on long documents.

3.4 Generation 4: Qwen3-VL

256K context + DeepStack + thinking mode. It completely rebuilt the relationship between "long context + multimodality + reasoning": visual information is injected at multiple layers, a thinking mode is supported, and it aims squarely at top closed-source models.

In the next few sections we will go version by version, breaking each of the four Qwen-VL generations into four modules: model architecture, loss design, training pipeline and typical abilities. That way you can clearly feel how each generation upgrades, step by step, on top of the "V1 naive solution".

4 Part 4: First Stop: Qwen-VL, or the Art of Giving a Brain “Prosthetic Eyes”

4 Part 4: First Stop: Qwen-VL, or the Art of Giving a Brain "Prosthetic Eyes"

Welcome, everyone, to the world of Qwen-VL. If we think of the text-only model (Qwen-7B) as a learned but blind sage, then what the Qwen-VL project sets out to do is perform delicate surgery on him: fitting a pair of "prosthetic eyes".

But this surgery isn't simple! You can't wire the optic nerve straight into the language centre, because they speak completely different "languages": the optic nerve carries pixel signals, while the language centre wants semantic symbols (tokens).

Qwen-VL's core contribution is a clever "translator" (the adapter) plus a rigorous "rehabilitation programme" (3-stage training), which together teach two modules that never used to talk to each other to work as a team.

4.1 Architecture: The Philosophy Behind Choosing the Three Parts

4.1 Architecture: The Philosophy Behind Choosing the Three Parts

This is what I always call Step 1: Define a Function Set. Qwen-VL's network architecture is a classic, built from three core components. It looks like stacking building blocks, but every block was chosen with care (SOTA selection).

🧠
The Brain

Qwen-7B

LLM Backbone

This is the base. Why choose Qwen-7B? Because at the time (2023) it performed very well among models of its size. Note: in the first training stage it is frozen, like a proud professor who refuses to change his parameters lightly.

👁️
The Eyes

ViT-bigG

OpenCLIP Init

A full 1.9B parameters! This is a huge vision encoder. It cuts high-resolution 448×448 images into small patches and turns them into a sequence of dense feature vectors. It, too, is frozen first and unfrozen later.

🔗
Key Innovation

VL Adapter

Position-aware C-Attn

This is the "translator". Unlike LLaVA's simple, brute-force linear projection, Qwen-VL uses a single-layer cross-attention module that "compresses" the visual features to a fixed length (256).

🔍 Under the microscope: Qwen-VL's data flow

🖼️ Input Image 448x448 ViT-bigG ... ~1000 patches VL Adapter (Single Layer Cross-Attn) Trainable Queries (256) ⬇ Attend ⬇ Image Features (Keys/Values) + 2D Positional Embedding Qwen-LM Visual Tokens (256) Text Tokens ⬇ Generate

🎓 The teacher's aside: why use attention for compression?

Think about it: if we only used a fully connected (linear) layer or a pooling layer, wouldn't that be too "rigid"? The beauty of cross-attention lies in its query mechanism. We set up 256 learnable query vectors; you can think of them as 256 "probes". During training these probes learn to "search" the image features for different kinds of information: some specialise in texture, some in shape, some in position. That is why Qwen-VL can keep very few tokens (256) while still retaining rich visual detail.

4.2 Training in Three Acts: Teaching a Model Like Teaching a Student

4.2 Training in Three Acts: Teaching a Model Like Teaching a Student

Qwen-VL's training process is a classic, practically a textbook for multimodal training. It uses a 3-stage training pipeline. It's a lot like how we teach human students: first learn to read, then learn to solve problems, and finally learn to hold a polite conversation.

1

Stage 1: Pre-training: "Visual Alignment"

Target: Vision-Language Alignment Data: Image-Text Pairs

Task: teach the model to match images with simple descriptions (captions).
State:

  • Vision Encoder: Frozen (not updated)
  • Adapter: Learnable (updated)
  • LLM: Frozen (not updated)

"At this point the brain (LLM) and the eyes (ViT) are both locked, and only the translator in the middle (the adapter) is working hard to learn how to turn what the eyes see into a language the brain can understand."

2

Stage 2: Multi-task Pre-training ("Unlocking the Brain")

Target: Fine-grained Understanding Data: VQA, OCR, Grounding

Task: bring in higher-resolution input (448x448) and train harder tasks, such as "box the cat in the picture" or "read out the text in the image".
State:

  • Vision Encoder: Learnable (finally unfrozen!)
  • Adapter: Learnable
  • LLM: Learnable (the brain starts adapting to visual signals)

"This step is a qualitative leap. We unfreeze the whole model (full fine-tuning). Why unfreeze? Because the translator alone is no longer enough; the brain itself has to learn to handle new visual knowledge, especially to adapt to higher resolution and finer-grained tasks (such as grounding)."

3

Stage 3: Supervised Fine-tuning (SFT): "Learning to Chat"

Target: Instruction Following Data: Chat Data (Human-like)

Task: use dialogue-formatted data (ChatML) to teach the model to talk like an assistant, rather than coldly spitting out labels.
State:

  • Vision Encoder: Frozen (usually, for stability)
  • Adapter: Learnable
  • LLM: Learnable

4.3 The Core Trick: How Does the Model “Point Where You Ask”? (Grounding)

4.3 The Core Trick: How Does the Model "Point Where You Ask"? (Grounding)

You may have noticed that one of Qwen-VL's most impressive abilities is visual grounding. Ask it "Where is the dog?" and it not only says "on the grass", it also draws you a box [x1, y1, x2, y2]. How does it do that?

🔴 The pain point of traditional approaches

A traditional LLM vocabulary has no concept of coordinates at all. If we output numbers like "256, 334..." directly, they get split into several tokens, and it is hard for the model to understand that these tokens represent one continuous position in 2D space.

🟢 Qwen-VL's answer

Position normalisation + special tokens.
1. Normalise all coordinates to the range [0, 1000).
2. Introduce two special symbols, <box> and </box>.
3. The training data looks like this: Describe the dog <ref>the dog</ref><box>(200,200),(500,600)</box>

This design is extremely clever. It turns a "detection task" into a "language generation task". For an LLM, outputting (200,200) is no different in essence from outputting a word. That is the charm of next-token prediction unifying everything!

Summary: Qwen-VL showed that with a good adapter and a staged training strategy, even a 7B language model can achieve SOTA-level visual understanding. But it still had one regret: the resolution was fixed (448x448), so long images or tall, narrow documents get distorted. The next chapter, Qwen2-VL, solves this problem in a revolutionary way.

5 Part 5: Second Stop: Qwen2-VL, or No More Cutting the Foot to Fit the Shoe

5 Part 5: Second Stop: Qwen2-VL, or No More Cutting the Foot to Fit the Shoe

🤔 Question for the class: where did Qwen-VL’s “short-sightedness” come from?

🤔 Question for the class: where did Qwen-VL's "short-sightedness" come from?

Everyone, remember Qwen-VL from the last chapter? It was a fine "describe the picture" player, but it had one fatal weakness: "short-sightedness".

Whether you give it a tall screenshot of a long social media post or a widescreen IMAX movie poster, it bluntly resizes the image into a 448×448 square.

The consequences are serious:

  • Lost detail: lots of small text turns into noise once the image is shrunk.
  • Distorted proportions: tall, thin people become short and stout, circles become ellipses, and the model's view of the world gets warped.
  • Wasted compute: for a small 256x256 image, you have to upscale or pad it to reach 448, wasting precious compute.

Qwen2-VL's mission is to solve this problem once and for all. It introduces two killer features that sound academic but are, at heart, very intuitive:

Naive Dynamic Resolution + M-RoPE (Multimodal Rotary Position Embedding).

5.1 Dynamic Resolution (Naive Dynamic Resolution): Handling Images Like Playing Tetris

5.1 Dynamic Resolution (Naive Dynamic Resolution): Handling Images Like Playing Tetris

The most fundamental change in this generation: we no longer force-resize images! Or, more precisely, we no longer resize images to one fixed square.

But a Transformer still fundamentally needs a sequence. If images come in different sizes, the number of tokens differs, so how do we squeeze them into the same batch for training? Qwen2-VL didn't invent some extremely complicated mathematical transform; it came up with a very engineering-minded, very practical method, which we'll call "dynamic patching".

Step 1: What does "Naive" mean here?

It refers to the simplest possible strategy: we still resize the image, but the target is no longer a fixed $H \times W$; it is the multiple of $14 \times 14$ closest to the original resolution .

Input: 100x200
Target: (14*N) x (14*M)
Result: 98x196 (closest)

Step 2: 2x2 Pooling (feature compression)

To cut the token count further, the patch features output by the ViT (14x14) go through a 2x2 pooling step. This means every visual token that finally enters the LLM actually represents a 28x28 pixel region of the original image.

🎨 Illustrated in depth: the full transformation from "any image" to "token stream"

1. Raw input Any aspect ratio (e.g. tall screenshot) H_raw × W_raw Resize to Grid (14x14) 2. Grid alignment Snap to multiples of 14 Patch (14x14) H' = 14×M W' = 14×N ViT Encode 3. ViT & compression ViT Encoder 4 Patches T 2x2 Pooling (C-Former) Much shorter sequence Flatten 4. Variable-length sequence <S> Visual Tokens... <E> Length = (H'×W') / (14×14×4) No Padding! No filler!
1 What does "Naive" mean?

"Naive" here is modesty. It doesn't mean the algorithm is childish; it means the strategy is plain: no complicated object-detection crops, no multi-scale pyramids, just the simplest thing:
Resize to the nearest multiple of 14 -> cut patches -> feed the ViT.
This simplicity keeps training stable and also makes the engineering implementation (FlashAttention VarLen) possible.

2 Why the 2x2 pooling works so well

Why do a 2x2 pooling at the end?
Because the ViT patch size is 14x14, so for high-resolution images the token count explodes (448x448 already gives 1024 tokens).
2x2 pooling halves each side of the feature map (each token now covers 28x28 pixels), so the token count drops by 75%! That greatly lightens the LLM's load while keeping enough visual semantics.

5.2 M-RoPE: Giving Tokens a “3D GPS”

5.2 M-RoPE: Giving Tokens a "3D GPS"

With resolution solved, we face a thornier problem: loss of positional awareness.

In a traditional text-only LLM, position is one-dimensional (1st word, 2nd word...). That's simple, and RoPE handles it perfectly.

But in Qwen2-VL, visual tokens arrive "flattened". If you flatten a 2D image into a 1D sequence, the original up-and-down neighbour relations are completely scrambled. Not to mention video, which is 3D (time + space); flattening that is a disaster.

"It's like taking a jigsaw puzzle apart and laying the pieces out in a single row. If you don't write the row and column number on the back of each piece, not even God could put it back together."

🧭 The core idea of M-RoPE: decoupling 3D position

Qwen2-VL's M-RoPE (Multimodal Rotary Positional Embedding) takes an approach with real geometric elegance: it introduces no extra embedding layer, and instead operates directly on the rotation matrix. It splits each token's embedding vector into three segments, each controlled by its own rotation matrix, corresponding to time, height and width.

Time (t) Height (h) Width (w) Embedding Vector Splitting Temporal Rotary( t ) Height Rotary( h ) Width Rotary( w ) Mapping Total Dim = D Section 1: 0 ~ D/3 --> t Section 2: D/3 ~ 2D/3 --> h Section 3: 2D/3 ~ D --> w

📊 A close reading of the paper's Figure 3

M-RoPE Illustration from Paper

This figure (Figure 3) is the key to understanding M-RoPE. It shows how the three components "collapse" or "activate" under different modalities:

  • 📄
    Text Text is a 1D linear stream. So for the text part, we make the temporal, height and width IDs exactly the same (all equal to the sequence index $i$). This collapses M-RoPE into ordinary 1D RoPE, staying compatible with the pre-trained language model.
  • 🖼️
    Image An image is a static 2D plane. So the temporal ID is frozen to a constant (say 0), while the height and width IDs change as we scan the pixel grid. This way the model can sense 2D spatial structure.
  • 🎬
    Video A video is a stack of images. Here all three dimensions fire at full power: the temporal ID gives the frame number (Frame 1, Frame 2...), and within each frame the 2D H/W variation is kept. The model thus gets full 3D spatio-temporal awareness.

5.X Going Deeper: The Puzzle of the Adapter’s “Reverse Evolution”

5.X Going Deeper: The Puzzle of the Adapter's "Reverse Evolution"

🤔 Teacher's Blackboard: why "take a step back"?

Sharp-eyed students may have noticed:
Qwen-VL (v1) used Cross-Attention (256 Queries), which looks sophisticated and compresses an image into a very short sequence.
Qwen2-VL (v2), however, went back to a simple 2x2 Pooling + MLP, which looks like a technical "step backwards".
Why?

The cost of cross-attention

The queries are a set of learnable vectors. Like a swarm of "probes", they roam all over the image features.
Drawback: they scramble the spatial topology! The position encoding is still there, but the physical intuition that "pixel A is to the left of pixel B" gets weaker. That is bad news for tasks that need precise coordinate localisation (grounding).

The return of the MLP merger

2x2 pooling is a hard-wired connection. It forces tokens to keep the original 2D spatial structure.
Advantage: there are more tokens (lower compression), but it perfectly preserves the spatial information of "where am I". This is exactly the secret behind Qwen2-VL's dominance in document parsing and UI operation.

"Sometimes preserving the original physical structure matters more than extracting abstract semantics." (Qwen2-VL's design philosophy)

5.3 New Family Members: 2B / 7B / 72B, from Edge to Cloud

5.3 New Family Members: 2B / 7B / 72B, from Edge to Cloud

Qwen2-VL is no longer a lone soldier: it comes in three sizes, covering everything from on-device phones to cloud supercomputers. There's a very interesting design detail here: however large the LLM, they all share the same 600M-parameter vision encoder (ViT)!

This means even the smallest 2B model has "eyes" as sharp as the 72B model; only the "brain's" ability to process information differs.

📱

Qwen2-VL-2B

Edge / Mobile

  • ✓ Runs smoothly on a phone
  • ✓ Document scanning, live translation
  • ✓ No cut in visual perception
Mainstream
💻

Qwen2-VL-7B

Consumer GPU

  • ✓ Best value for money
  • ✓ Runs on a single RTX 3090/4090
  • ✓ The default pick for most demos and apps
🚀

Qwen2-VL-72B

SOTA Killer

  • ✓ Goes head to head with closed GPT-4V
  • ✓ Complex long-video analysis
  • ✓ Agent planning and decision-making

🌟 All-round performance (Capabilities Overview)

Qwen2-VL Capabilities

Figure 2: Overview of Qwen2-VL's capabilities. Whether it is identifying plant species, following a complex plot in a video, solving hard geometry problems or doing multilingual OCR, it handles them with ease.

Chapter summary

Qwen2-VL cured "short-sightedness" with Naive Dynamic Resolution and cured "directional blindness" with M-RoPE. It's like a super assistant whose vision has been corrected, who now wears 3D glasses, and whose IQ is still fully online.

But the story isn't over. Faced with especially complex documents (dense invoices, financial reports) or scenarios that need very strong logical reasoning, it still sometimes "sees more than it can do". At the next stop we meet Qwen2.5-VL, and see how it polishes the details further and becomes a true "document expert".

6 Part 6: Third Stop: Qwen2.5-VL, the Detail Fanatic Who Goes from “Can See” to “Masters It”

6 Part 6: Third Stop: Qwen2.5-VL, the Detail Fanatic Who Goes from "Can See" to "Masters It"

🥪 Why do we need Qwen2.5-VL?

🥪 Why do we need Qwen2.5-VL?

If Qwen2-VL solved "can it see images of different shapes clearly", then Qwen2.5-VL sets out to solve "can it understand the most complicated details".

In the technical report, the authors use a vivid metaphor: current multimodal models are like "the cream filling of a sandwich cookie". They can do many tasks, but they are still a bite short of the top level (the tasty cookie layers on either side).

Where exactly is that "one bite" missing?

  • Document parsing: dense tables, sheet music and chemical structures used to make earlier models dizzy at first glance.
  • Precise grounding: not just drawing a box, but pinpointing individual points and even counting.
  • Time awareness: video isn't a slideshow played at constant speed. With fast-forward, slow motion and hour-long videos, how do you locate the moment at 59 minutes 30 seconds?

To fill in this last piece of the puzzle, Qwen2.5-VL brings out four big moves: Native Dynamic ViT Window Attention Absolute Time M-RoPE and 4.1T Tokens Data.

6.1 Architecture Overview: More Native, Better at Time

6.1 Architecture Overview: More Native, Better at Time

First, let's look at a full-body portrait of Qwen2.5-VL (Figure 1). If you compare it carefully with the previous generation, the structure looks similar, but the internals have been replaced.

Qwen2.5-VL Framework

Figure 1: Qwen2.5-VL architecture. Note the prominent "Native Resolution Input" and "Align with Absolute Time" in the middle.

🖼️ Spatial: Native Dynamic ViT

No longer just "slice + resize". Qwen2.5-VL trains from scratch a Vision Transformer that natively supports dynamic resolution. It introduces window attention, bringing the cost down from $O(N^2)$, so it can easily swallow 4K or even higher-resolution images.

⏱️ Temporal: Absolute Time M-RoPE

No longer just counting "which frame". Qwen2.5-VL aligns the temporal dimension of M-RoPE with absolute physical time (seconds). Even if the video speeds up and slows down (dynamic FPS), the model knows that this is "second 30" rather than simply "frame 150".

6.2 Native Dynamic Resolution: The Evolution from Naive to Native

6.2 Native Dynamic Resolution: The Evolution from Naive to Native

Everyone, Qwen2-VL's version is called Naive Dynamic Resolution, and Qwen2.5-VL's is called Native Dynamic Resolution. What does that one-letter difference actually change?

Naive vs. Native: how visual processing evolved

🔴 Naive (Qwen2-VL)

Take an off-the-shelf ViT (usually trained at a fixed resolution) and force images of different proportions into patches to feed it.

Attention = Global (Full N²)

Pain point: if the image is too large (say a long document), the token count explodes and global attention blows straight through GPU memory.

🟢 Native (Qwen2.5-VL)

Train a ViT from scratch that is used to variable-length input from birth, and add window attention inside it.

Attention = Windowed (Linear O(N))

Advantage: cut the image into 112x112 windows. Most layers only look inside their window; only a few layers look globally. Compute cost drops sharply!

🪟 Illustrated: how window attention saves GPU memory

Input Feature Map Window 1 Window 4 Global Attn (Full) Dense O(N²) Window Attn (Sparse) Masked (0) Deep Insight: Most ViT layers only exchange information inside a window (e.g. 112x112). Only a few layers (Full Attention Block Indexes) break the windows and go global. This keeps fine local detail while greatly reducing GPU memory use.

6.3 Absolute Time Encoding: Solving the “Variable-Speed Motion” Problem

6.3 Absolute Time Encoding: Solving the "Variable-Speed Motion" Problem

Qwen2-VL used M-RoPE to introduce a temporal ID, which was a huge step forward. But the old temporal ID was based on frame index: frame 1, frame 2 ...

What's the problem with that? In real life, the video sampling rate (FPS) changes!
Scenario A: sample 1 frame per second. Frame 5 means second 5.
Scenario B: sample 5 frames per second. Frame 5 means second 1.
If the model only knows "this is frame 5", it has no idea how much time that represents.

⏱️ Illustrated: Relative Index vs. Absolute Time

Old: Frame Index ID:1 ID:2 Video A (Slow) ID:1 ID:2 Video B (Fast) "ID:2 means 2 s on top but 1 s below. The model is lost!" New: Absolute Time (Qwen2.5-VL) 1.0s 3.0s ID: X ID: Y "IDs map straight to physical time. At any sampling rate, 1 s is 1 s!"

Qwen2.5-VL ties the temporal ID directly to absolute time (seconds). This way the model understands not only "what comes first" but also "how fast things move". That is crucial for understanding long videos (such as an hour-long film).

6.4 Data Engineering: Not Just “More”, but “Better”

6.4 Data Engineering: Not Just "More", but "Better"

The architecture is just the skeleton; data is the soul. Qwen2.5-VL's pre-training data reached a staggering 4.1 trillion tokens (more than three times Qwen2-VL's).

But what deserves more attention is how it built the data for its special abilities.

📄 Document Omni-Parsing

To turn the model into an "all-round document reader", the Qwen team synthesised a large amount of document data in HTML format.

<html><body>
# paragraph
<p bbox="x1 y1 x2 y2"> content </p>
# table
<table bbox="..."> ... </table>
...

Key Innovation: every piece of content (text, tables, formulas) carries a bounding box. The model learns not only to read characters but also the layout.

🎯 Absolute Grounding

To support high-precision grounding, Qwen2.5-VL uses absolute coordinates (based on the original resolution) instead of the earlier normalised coordinates (0-1000).

The data sources are serious stuff:

  • PixMo (Pointing & Counting)
  • Synthetic Data from Grounding DINO & SAM
  • Oven-Vocabulary Detection Data

6.5 Showing Its Strength: A Leap in DocVQA and Agent Abilities

6.5 Showing Its Strength: A Leap in DocVQA and Agent Abilities

In the Qwen2.5-VL technical report, the most eye-catching results are in document understanding and agent abilities.

🏆 DocVQA & InfoVQA report card

Model DocVQA (test) InfoVQA (test) ChartQA (test)
GPT-4o 91.1 80.7 86.7
Claude 3.5 Sonnet 95.2 74.3 90.8
Qwen2.5-VL-72B 96.4 👑 87.3 👑 89.5

* Source: Technical Report Table 5

On DocVQA, Qwen2.5-VL-72B reached a remarkable 96.4, which shows that when it comes to document details it has already surpassed most closed-source models.

On top of that, on agent-related benchmarks (such as Android World and OSWorld), Qwen2.5-VL also shows impressive decision-making. This comes from bringing large amounts of GUI screenshots and action traces into the training data.

Chapter summary

Qwen2.5-VL is a "refinement" revolution in the Qwen-VL family.
It uses Native Dynamic Resolution + Window Attention to solve compute efficiency at ultra-high resolution;
it uses Absolute Time M-RoPE to solve time awareness in long videos;
it uses DocOmni Data to solve structured understanding of complex documents.

At this point we seem to have pushed perception as far as it goes. But if we want to handle ultra-long contexts of hundreds of thousands of tokens, or carry out complex logical reasoning (Thinking Mode), is the existing architecture still enough?
Next stop, the final form: Qwen3-VL takes the stage.

6 Fourth Stop: Qwen3-VL, the Final Form: 256K Context and DeepStack Change the Game

6
Fourth Stop: Qwen3-VL The final form: 256K context and DeepStack change the game

🚀 The Leap from “Understanding” to “Thinking”

🚀 The leap from "understanding" to "thinking"

Everyone, if we compare Qwen2.5-VL to a sharp-eyed "document expert" who misses nothing, then Qwen3-VL is a "sage" with near-limitless memory who thinks things through.

In this generation, the Qwen team is no longer content to "see clearly" one image or a few seconds of video; they go after three "holy grails" of the multimodal field:

📚

Native 256K context

Not just a simple RoPE extension: from the start of training, the model gets used to "devouring" whole books and whole films. At this scale, vision and text are truly free to interleave.

🧠

System 2 Thinking

Introduces a "slow thinking" mode similar to OpenAI o1. Faced with a hard geometry problem or reasoning task, the model first generates a long chain of thought (CoT) and then gives the answer.

🏗️

DeepStack architecture

Breaks with the tradition of "injecting vision only at the input layer" and builds a "visual highway" straight into the deep layers. An important small innovation in large-model architecture.

7.1 Architectural Innovation: DeepStack and the “Seepage” of Visual Signals

7.1 Architectural Innovation: DeepStack and the "Seepage" of Visual Signals

Let's first look at this extremely important architecture diagram (Figure 1). Please focus on the seemingly complicated connection structure on the far right: that is DeepStack.

Qwen3-VL Architecture

Figure 1: Qwen3-VL architecture overview. Note the dashed box on the right: visual features are no longer a one-off delivery, but are injected layer by layer at different depths of the LLM.

Why do we need DeepStack? (The Vanishing Vision Problem)

Traditional LVLMs (such as LLaVA and Qwen-VL v1/v2) usually adopt an "early fusion" strategy: visual tokens and text tokens are concatenated and fed together into the LLM's first layer.

But as LLMs get deeper and deeper (Qwen2.5-72B has 80 layers!), the low-level visual signal, after passing through dozens of layers of self-attention and FFN transformations, is gradually diluted or even drowned out by "language patterns". It's like looking at a picture in first grade and then being asked, in a PhD thesis written after 80 years of schooling, to describe its details: you'd have forgotten it all long ago.

DeepStack's solution: if you're afraid of forgetting, "take a few more looks".

🏗️ Illustrated in depth: DeepStack's "gradient highway"

Vision Encoder (SigLIP-2) High Level Low Level LLM Backbone (Qwen3) Block N Block M Block 1 Merger (MLP) Merger (MLP) Merger (MLP) Backprop path Gradient Highway Mechanism: multi-level Vision Encoder features, each via its own Merger, are added to LLM hidden states. No extra tokens, more depth.
🎯 What it solves
  • Forgetting: it ensures the LLM's deep layers (responsible for complex reasoning) can directly access the original visual features, instead of relying only on "second-hand information" passed up from earlier layers.
  • Vanishing gradients: during training, gradients can flow back to the vision encoder directly through these lateral shortcuts, speeding up convergence.
⚡ A clever design detail

Note that DeepStack adds the visual tokens to the LLM's hidden states, or injects them as the key/value of a cross-attention (depending on the implementation; Qwen3-VL uses a residual connection). That means it does not increase the LLM's context length! At inference time, this is a nearly free performance boost.

7.2 Interleaved MRoPE: Rebalancing the Frequency Spectrum

7.2 Interleaved MRoPE: Rebalancing the Frequency Spectrum

Qwen2-VL's M-RoPE was already strong, but ultra-long video understanding exposed a hidden flaw: spectral imbalance.

🧐 What is spectral imbalance?

A property of RoPE: the first dimensions of the embedding vector correspond to high-frequency rotations (attending to local position), and the later dimensions to low-frequency rotations (attending to global, long-range distance).
In Qwen2-VL, we split the vector like this: [time T | height H | width W].
This means: temporal information T always occupies the high-frequency band, while spatial information W always occupies the low-frequency band.
The result: the model is sensitive to "local changes in time" but weak at sensing "long-range temporal dependencies" (because the low-frequency band is taken by H and W). That is very bad for long-video understanding.

🌊 Illustrated: the "weaving" of Interleaved MRoPE

High Frequency (Local) Low Frequency (Global) Old (Block): Time (T) Height (H) Width (W) ← T: high freq only! New (Interleaved): T H W ✅ T, H and W spread evenly across all frequency bands, so each captures both local and global information.

7.3 The Return of Video Timestamps: Text-based Time Alignment

7.3 The Return of Video Timestamps: Text-based Time Alignment

Compared with Qwen2.5-VL, there is one more major change in how video is handled: drop the pure absolute position ID and go back to text-based timestamps.

Absolute Pos ID (Old)

Map second $t$ directly to a very large position ID (e.g. ID=30000).

Problem: very long videos push the IDs beyond RoPE's extrapolation limit, and it is very sensitive to variable frame rates (variable FPS).

Explicit Text Timestamp (New)

Insert timestamps written as text directly into the visual token sequence.

[Image Frame 1] ... <00:01> ... [Image Frame 2] ... <00:05>

Advantage: "time awareness" becomes a "text reading" task. The model only needs to read the string <00:05> to know which second it is, with no limit from ID size.

7.4 Post-training: The Birth of Thinking Mode

7.4 Post-training: The Birth of Thinking Mode

Qwen3-VL's post-training stage introduces an exciting feature: System 2 Thinking (slow-thinking mode). It is clearly inspired by OpenAI o1, but what does it mean in the multimodal setting?

Thinking Process in VLM

1
Extracting visual information (Perception)

"I see a red triangle and a blue square in the picture, partly overlapping..."

2
Logical deduction (Reasoning)

"The question asks for the overlapping area. First I need to work out the triangle's equations from the coordinates, then..."

3
Self-reflection (Reflection)

"Wait, I misread that. It's not a square, it's a rectangle. I need to recalculate..."

4
Final answer (Conclusion)

"The overlapping area is 5.5 square centimetres."

Qwen3-VL comes in two versions: Thinking and Non-thinking.
For simple OCR or description tasks, the Non-thinking version is fast and cheap.
For hard geometry problems or long-video reasoning, the Thinking version is slower (it generates lots of CoT tokens), but its accuracy takes a qualitative leap.

7.5 Experimental Highlights: Topping the Leaderboards

7.5 Experimental Highlights: Topping the Leaderboards

MMMU (Reasoning)
80.6

Qwen3-VL-235B (Thinking)

MathVista (Math)
85.8

State-of-the-Art

DocVQA (Doc)
96.5

Near Perfect

* Source: Table 2 from Qwen3-VL Technical Report. Comparison models include GPT-4o, Claude 3.5 Sonnet, Gemini 1.5 Pro.

Series summary

From Qwen-VL "first seeing the light", to Qwen2-VL's "vision correction", to Qwen2.5-VL's "attention to fine detail", and finally to Qwen3-VL, "widely read, with a long memory, and thoughtful".

Along the way, we have watched multimodal models overcome one technical bottleneck after another: resolution, position encoding, modality alignment, long context. Qwen3-VL is not just a model but a synthesis of everything before it; it represents the current state of the art in open-source multimodal models, and it lights a lamp on the road towards AGI.

7 Part 8: Experiments and Data Lineage: The Real Story Behind the Numbers, from Leaderboard Chasing to Emergent Abilities

7
Part 8: Experiments and Data Lineage The real story behind the numbers: from leaderboard chasing to emergent abilities

📊 Don’t Just Look at SOTA; Look at How the “Capability Frontier” Expands

📊 Don't just look at SOTA; look at how the "capability frontier" expands

Everyone, when we pick up a hefty technical report like Qwen3-VL's, the easiest mistake is to flip straight to the final table, glance at the bold numbers, sigh "wow, SOTA again", and close the paper.

That is an extremely shallow way to read!

The experiments section is actually the most honest part of a paper. It isn't just showing off muscle; it tells you: What exactly did we teach the model? What can it do now? Where does it still fall over?

"A benchmark is a projection of a model's abilities. If we connect these scattered numbers, we see a clear evolutionary curve: from the most basic 'reading characters' (OCR), to 'understanding' (VQA), and now to 'thinking' (reasoning)."

⛰️ Illustrated: the capability pyramid of the Qwen-VL series

Level 1: Basic Perception OCR, Caption, Detection (Qwen-VL's strength) Level 2: Structured Understanding ChartQA, DocVQA, VideoQA (Qwen2/2.5-VL's strength) Level 3: Complex Reasoning MMMU, MathVista, Agent (Qwen3-VL's strength) Data Quality & Context Length ↑

8.1 Image Captioning and General VQA: The Touchstone of Basic Ability

8.1 Image Captioning and General VQA: The Touchstone of Basic Ability

This is like a primary-school pupil's sentence-making and picture-description exercises. Simple, yes, but it is the foundation of every complex ability. If a model can't even say correctly how many people are in a picture or what they're wearing, there's no point talking about reasoning.

🖼️ Zero-shot Captioning

On datasets such as Nocaps and Flickr30k, even the early versions of Qwen-VL showed remarkable generalisation. This shows that its visual encoder (ViT-bigG) and alignment layer (adapter) really did translate image features into a language the LLM can understand.

Qwen2.5-VL: CIDEr score far above models of its class

❓ General VQA

VQAv2, GQA, OKVQA. These tasks test "localisation + recognition". Qwen3-VL's gains here owe more to the huge volume of real-world images it saw during pre-training (world knowledge); it is no longer a bookworm that has only ever looked at ImageNet.

MMBench: Qwen3-VL reaches 88.8 (Thinking)

8.2 Document Understanding and Structured Extraction: From “Reading Characters” to “Understanding the Logic”

8.2 Document Understanding and Structured Extraction: From "Reading Characters" to "Understanding the Logic"

This is where Qwen2.5-VL and Qwen3-VL rule absolutely.

💡 Question: does a high OCR score mean strong document understanding?

Some models score 99 on OCR but only 60 on DocVQA. Why?
Because OCR only recognises the characters (perception), while DocVQA requires you to understand the layout, the table structure and the semantic links across lines and pages.
For example: "What is the number in row 3, column 2 of the table minus the one in row 1, column 2?" That needs extremely precise spatial awareness.

Benchmark Task Description Qwen3-VL Performance Key Enabler
DocVQA QA on scanned documents 96.5 (SOTA) Native Dynamic Res (sharpness)
ChartQA Chart data analysis 90.3 High-res Input + CoT
InfoVQA Complex infographic understanding 89.5 DeepStack (deep semantics)

8.X The Secret Weapon: The Synthetic Data Factory

8.X The Secret Weapon: The Synthetic Data Factory

Why can Qwen2.5-VL understand such complicated HTML pages and PDFs? Did they hire a million annotators to label everything by hand?
Of course not. Its secret weapon is a fully automated "synthetic data factory".

🏭 The Data Synthesis Pipeline

Raw PDF / HTML / ArXiv Specialized Parser (LayoutLM / PDFMiner) Extract Layout Rendering Engine Markdown → Title "We know the GT!" Training Pair Image + Struct JSON
💡 The core logic:

If annotating real documents is hard, why not generate the documents ourselves?
1. Take clean Markdown / LaTeX text.
2. Render it into images with a browser rendering engine (Chrome/Puppeteer).
3. Because we control the rendering, we naturally know the exact coordinates (bounding box) of every character and every table cell.
This gives us unlimited, perfectly annotated OCR and layout data!

8.3 Video Understanding: The “Needle in a Haystack” Challenge

8.3 Video Understanding: The "Needle in a Haystack" Challenge

For video, Qwen3-VL ran a very demanding test: Video Needle-in-a-Haystack (NIAH). This isn't just checking whether the model can remember a video; it checks whether, faced with an hour-long video (tens of thousands of frames), it can pinpoint a tiny detail in that one frame.

Video NIAH Heatmap

Figure 3: Heat map of the video needle-in-a-haystack test. All green means 100% recall.

📊 Reading the experiment

Look at the heat map on the left: almost all of it is green. That means:
even when the video is 30 minutes or even an hour long (context length maxed out), Qwen3-VL can still pinpoint events happening at any moment.

Who deserves the credit?
1. Interleaved MRoPE: ensures the time dimension doesn't lose high-frequency information over long sequences.
2. Text-based Timestamp: explicit timestamp tokens provide strong anchors.

8.4 Multimodal Reasoning: Thinking Mode in a League of Its Own

8.4 Multimodal Reasoning: Thinking Mode in a League of Its Own

This is the most exciting part of Qwen3-VL. On hard reasoning benchmarks such as MMMU and MathVista, Qwen3-VL's Thinking mode shows impressive strength.

Comparision (Score)

🕸️ Radar chart of multimodal reasoning ability

MMMU MathVista MathVision DynaMath ZeroBench LogicVista Qwen3-VL (Thinking) Competitors (Avg)

Look at the MathVista and MMMU scores. With Thinking mode on, Qwen3-VL can generate reasoning steps thousands of tokens long, which greatly improves how it handles complex geometry and physics problems.

A key insight: We found that adding dedicated chain-of-thought (CoT) data to training not only improved maths ability but also generalised to code generation and agent planning. This suggests that "reasoning ability" is general in the deep semantic space.

Chapter summary

The experimental data tell us that each upgrade in the Qwen-VL series was not just "piling on parameters", but an architecture-level breakthrough aimed at a specific pain point (resolution, time, reasoning).
By now you understand where it came from and why it is so strong. Next, it's time to move this big fellow into your own project.

🚀 Next chapter: a guide to reproduction and practice

8 Part 9: A Guide to Reproduction and Practice: Moving the Qwen-VL of the Papers into Your Own Engineering

8
Part 9: A Guide to Reproduction and Practice Moving the Qwen-VL of the papers into your own engineering

🛠️ Don’t Just Read the Paper; Running It Is the Real Test

🛠️ Don't just read the paper; running it is the real test

After the architecture walkthrough, I trust you now have a solid theoretical grasp of the Qwen-VL series. But as an engineer or researcher who has to put the model to work, you probably still have three ultimate questions:

🤔

Which version?

2B/7B/72B? Qwen2.5 or Qwen3?

💻

How do I call it?

How do I fit multiple images, videos and long documents into a prompt?

🔧

How do I fine-tune it?

I have private data. Can I make it understand my domain better?

9.1 Choosing a Model: Pick It Like Picking a Class in an RPG

9.1 Choosing a Model: Pick It Like Picking a Class in an RPG

The Qwen-VL family is big these days, and picking the wrong model is like putting your mage's points into strength: lots of effort, little reward. I've put together a "lazy person's decision tree" for you.

Q1: How much GPU memory do you have?
< 16GB (single 3090/4090)
Qwen2.5-VL-7B

Best value for money. Runs most demos, supports video and documents.

Plan B: Qwen2-VL-2B (phone / Raspberry Pi)

> 48GB (A100/H800)
Q2

What tasks do you need to handle?

General VQA / simple documents Qwen2.5-VL-72B
Complex reasoning / long video Qwen3-VL (Thinking)

9.2 Minimal End-to-End Code: From Pixels to Tokens

9.2 Minimal End-to-End Code: From Pixels to Tokens

Talk is cheap, show me the code. Below is a minimal inference script based on the Hugging Face transformers library.
Pay attention to the comments marked Teacher's key point: that is where people trip up most often.

inference_demo.py
from transformers import Qwen2_5_VLForConditionalGeneration, AutoProcessor
from qwen_vl_utils import process_vision_info
import torch
# [Teacher's key point]: be sure to add device_map="auto", or a large model may overflow a single GPU's memory
model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
"Qwen/Qwen2.5-VL-7B-Instruct", 
torch_dtype=torch.bfloat16, 
device_map="auto"
)
# The processor handles image resizing and tokenization
# It is the "magic black box" of the Qwen-VL series and handles Dynamic Resolution automatically
processor = AutoProcessor.from_pretrained("Qwen/Qwen2.5-VL-7B-Instruct")
messages = [
{
"role": "user",
"content": [
{
"type": "image",
"image": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg",
},
{"type": "text", "text": "Describe this image in detail."},
],
}
]
# Prepare inputs: turn image pixels into tensors and text into input IDs
text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
image_inputs, video_inputs = process_vision_info(messages)
inputs = processor(
text=[text],
images=image_inputs,
videos=video_inputs,
padding=True,
return_tensors="pt",
)
inputs = inputs.to("cuda")
# [Teacher's key point]: generated_ids contains input + output
# so slice before decoding and decode only the new tokens, or you'll see the question repeated back
generated_ids = model.generate(**inputs, max_new_tokens=128)
generated_ids_trimmed = [
out_ids[len(in_ids) :] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
]
output_text = processor.batch_decode(
generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
)
print(output_text)

9.3 Advanced Use: Multiple Images and Long Context

9.3 Advanced Use: Multiple Images and Long Context

📚 Handling long documents (PDF)

When you feed a 10-page PDF to the model, don't naively treat each page as an unrelated image.

Prompt:
[Img Page 1]
[Img Page 2]
...
"Using the table on page 1 and the conclusion on page 5, analyse..."

Tip: put a text anchor before each page image, e.g. Image 1: Page 1. That makes it easier for the model, during attention, to locate a specific page.

🎬 Handling long videos

Frame sampling is the key. Qwen2.5-VL supports dynamic FPS, but you have to keep the total token count under control.

Sample Strategy:
1 fps (for short clip)
0.1 fps (for long movie)

Tip: thanks to Qwen2.5-VL's absolute time encoding, you can ask in the prompt "What happens at around 00:15?", and the model can use the timestamps to answer precisely.

9.4 Fine-tuning in Practice: LoRA Is Your Friend

9.4 Fine-tuning in Practice: LoRA Is Your Friend

Don't jump straight into full fine-tuning unless you have a few hundred A100s. For most domain-specific tasks (such as medical imaging reports or industrial quality inspection), LoRA (Low-Rank Adaptation) is enough.

💡 Fine-tuning pitfalls to avoid

  • Freeze the ViT: normally the visual encoder doesn't need to change. It has already seen trillions of tokens of data and understands vision better than the few thousand images you have.
  • Tune only the LLM and projector: attach LoRA to the LLM's `q_proj` and `v_proj`, or even fine-tune only the MLP Merger (projector), and you can get decent domain adaptation.
  • Match the data format: your fine-tuning data must strictly follow the ChatML format, including special tokens such as `<|vision_start|>`, or the model will get badly confused.

9.5 Common Failure Scenes (Common Pitfalls)

9.5 Common Failure Scenes (Common Pitfalls)

🚫

OOM (GPU memory blow-up)

Symptom: CUDA Out of Memory partway through a run.
Cause: Qwen2-VL uses dynamic resolution, so if you feed it a huge 8K image it cuts out thousands of tokens and instantly blows up GPU memory.
Fix: set a max_pixels limit in process_vision_info, or manually resize very large images.

😵‍💫

Parrot mode

Symptom: the model keeps repeating the same sentence, or outputs gibberish.
Cause: usually the prompt format is wrong: a missing <|im_end|>, or a system prompt that is way off.
Fix: carefully check the string produced by apply_chat_template and make sure the special tokens are intact.

Ready to Build?

The theory is covered and the demo code is there. You now have everything you need to tame Qwen-VL, this multimodal giant.
Whether you're doing academic research or building the next hit AI application, the road is right in front of you.

🔮 Next chapter: looking ahead

9 Part 10: Looking Ahead: Where Is the Next “Holy Grail” for Multimodal Models?

9
Part 10: Looking Ahead Where is the next "holy grail" for multimodal models?

Qwen3-VL has already pushed context to 256K and reasoning to Thinking Mode. Does that mean multimodal models have reached the end of the road?

Clearly not. Quite the opposite: we are only standing at the foot of the mountain.

If we compare today's models to a high-school student who has just learned to "write an essay about a picture", then the models of the future should be super agents who can "understand films, operate computers, and even predict the future". In this section, let's set specific benchmarks aside and talk about the Open Problems that are truly worth tackling.

10.1 The Limits of Visual Efficiency: Are Fewer Tokens Always Better?

10.1 The Limits of Visual Efficiency: Are Fewer Tokens Always Better?

📉 Current state and pain points

Qwen2.5-VL introduced dynamic resolution, but at heart it is still "compressing". A 4K image gets squeezed into a few hundred tokens, and lots of high-frequency detail (texture, tiny defects) is inevitably lost.

The Trade-off: want to see details -> tokens explode -> context overflow / GPU OOM.

🚀 Possible breakthroughs

  • ✂️
    Dynamic Pruning At inference time, decide on the fly which patches are background, drop them, and keep only foreground tokens.
  • 🧱
    Multi-granularity Tokens A big stretch of blue sky gets one "coarse-grained token"; a face gets a hundred "fine-grained tokens".

10.2 The Evolution of Interpretability: From “Black Box” to “Glass Box”

10.2 The Evolution of Interpretability: From "Black Box" to "Glass Box"

Today's Thinking Mode can output a textual chain of thought, but it still can't tell us: "Which part of the image are you actually looking at?"

What might future multimodal explanations look like?

🔦
Visual Grounding in CoT

The chain of thought is no longer just words; it is interspersed with <box> coordinates.
"Because this region [10,10,50,50] is red..."

🎬
Temporal Attribution

When answering questions about a video, highlight the key segments on the timeline.
"Conclusion inferred from the frames between 00:15 and 00:20."

🧠
Mechanism Interpretation

Open up DeepStack's black box and see what visual features each layer has actually learned.

10.3 Towards a World Model: Predicting the Future

10.3 Towards a World Model: Predicting the Future

Today's Qwen-VL is still a passive observer: it analyses whatever you show it. But a true agent needs to be able to predict the future.

Next Token Prediction
→ Next Frame Prediction

If a model can predict not only the next word but also the next frame, it has common sense about the physical world.

🤖 Robotics: if I accidentally knock over this cup, where will the water flow?
🚗 Autonomous driving: the car ahead just lit its brake lights. What happens next?

Research Frontier

"Generative models are not just for creating pretty pictures. They are the engines of imagination, allowing agents to simulate outcomes before acting."

Unified Generation Video Prediction

10.4 An Evaluation Revolution: From Leaderboard Chasing to Real-World Scenarios

10.4 An Evaluation Revolution: From Leaderboard Chasing to Real-World Scenarios

"When a measure becomes a target, it ceases to be a good measure." (Goodhart's law)

Today's benchmarks (MMMU, MathVista) are hard, but mostly they are still static "exam questions". Future evaluation should be closer to the dynamic real world.

🕵️
Long-term Stability

Let the model run continuously for 24 hours, or handle 1000 rounds of dialogue. Will it "go off the rails"? Will it forget the settings it was given earlier?

🎮
Interactive Env

Drop the model into Minecraft or a real OS environment and see whether it can complete a task like "create a new folder and rename it", which is simple but needs a closed loop.

🛡️
Visual Safety

Defence against visual jailbreaks. If malicious instructions are hidden in an image, can the model recognise and refuse them?

Closing words

These very long lecture notes end here. We started from Qwen-VL's first attempt and walked all the way to the showdown at the top with Qwen3-VL.

I hope that after these lecture-style explanations, what stays in your head is not just a pile of dry acronyms (ViT, MRoPE, DeepStack), but a living map of how the technology evolved.
The road ahead is long, but the direction is clear. Take this map with you and go build your own multimodal SOTA!

🎓 🚀 🌟

A Appendix 1: Mathematical Intuition and Visualisation: Don’t Just Memorise Formulas, See the Shape of the Maths

A
Appendix 1: Mathematical Intuition and Visualisation Don't just memorise formulas; see the shape of the maths

Many students get a headache the moment they see the Math Section of a paper, as if it were written for aliens.
But in fact, every loss function in deep learning is essentially defining a kind of "physical force field".

In this section we won't do complicated derivations or proofs; instead we'll use geometric intuition to draw the four most important mathematical concepts in the Qwen-VL series. Let's see how these formulas act like invisible "hands", pushing tens of billions of parameters around.

1

Language Modelling Loss (The Prediction Game)

Language Modelling Loss (The Prediction Game)

Ltext = - ∑ log P( xt | x<t, V )

Breaking down the symbols

  • xt : the "correct answer" we want the model to predict (the ground-truth token).
  • x<t : everything that has been said so far (the context).
  • V : the visual signal (visual tokens), the biggest difference between an LVLM and an LLM.

Physical intuition: a tug of war

Imagine the vocabulary has 100,000 words, and each word is a "hole". The model holds a "ball" (probability mass, total weight 1).
The goal of this formula is to force the model to throw as much of that ball as possible into the "correct answer" hole.
If it misses (say it predicts "dog" instead of "cat"), -log(P) becomes huge (the penalty), and backpropagation kicks the parameters back into line.

x_<t: "This is a" V LLM Dog Cat Target! Car Maximize This!

Illustrated: the visual signal V changes the LLM's predicted probability for "Cat".

2

Contrastive Loss (The Magnet)

Contrastive Loss (The Magnet)

Lcon = - log
exp( sim(vi, ti) / τ )
∑j exp( sim(vi, tj) / τ )

Intuition: finding your friend at a party

Imagine the high-dimensional space as a huge dance floor.
vi is an image (say "a dog"), and ti is its description ("A cute dog"). They are a pair of good friends.
tj are the descriptions of other passers-by (e.g. "A red car").
This loss is a magnet: it pulls the friendly pair i-i hard towards each other (the numerator grows), while pushing all the passers-by i-j hard away (the denominator shrinks).

🤔 The teacher's follow-up question:

Why does the denominator sum over all j? Because pulling friends together isn't enough. If you don't push others away, eventually all points collapse onto the same origin, and the model learns that "everyone is the same", which is another form of cheating!

Img Text+ Pull Text- Text- Push Away

Attraction and repulsion in the embedding space

3

Grounding Loss (The Anchor)

Grounding Loss (The Anchor)

Lloc = λL1 || bpred - bgt ||1 + λGIoU LGIoU ( bpred, bgt )

Why do we need two losses?

In object detection or grounding tasks, we usually constrain the model with two measures:

  • L1 Loss: a simple, blunt "sense of distance". It computes the absolute difference between the corner coordinates of the predicted box and the true box. It's like pulling the predicted box towards the true box with a spring.
  • GIoU Loss: a more refined "sense of shape". Relying on L1 alone, two boxes might have close centres yet not overlap at all. IoU looks at the overlapping area, and GIoU fixes the problem of zero gradient when the boxes don't overlap.
GT Pred L1 Pull L1 Pull Enclosing Box (for GIoU)

The yellow spring represents the L1 loss; the grey dashed box is used to compute GIoU.

4

The Geometry of RoPE / M-RoPE (The Clock)

The Geometry of RoPE / M-RoPE (The Clock)

RoPE (Rotary Positional Embedding) is the cornerstone of every Qwen model.

Its core idea is: position is not addition, it is rotation.
Without positional encoding, tokens are like a pile of words scattered on a table;
with absolute PE, it's like sticking a number tag on each word;
with RoPE, it's like fitting each word with a "clock". For the word at position $m$, its vector is rotated in space by an angle of $m \times \theta$.

f(q, m) = Rm · q
// R_m is a rotation matrix
Pos 0 Pos 1 Pos 2 θ Relative distance = angle gap (Pos2 - Pos1 = θ)

🔍 Extending the intuition to M-RoPE:

Once you understand this 2D rotation, M-RoPE is easy: it just cuts the vector into three segments and rotates each in its own orthogonal plane.
One segment rotates along the time axis $t$, one along the height axis $h$, and one along the width axis $w$.

B Appendix 2: An AI4S Cheat Sheet: When Qwen-VL Puts On a Lab Coat, from Cells to Galaxies

B
Appendix 2: An AI4S Cheat Sheet When Qwen-VL puts on a lab coat: from cells to galaxies

🧬 Why Do Scientists Need Multimodal Large Models?

🧬 Why do scientists need multimodal large models?

Everyone, in AI for Science (AI4S) we often deal with extremely abstract data: gene sequences, protein structures, pathology slides. Traditional methods (such as CNNs and U-Net) are good at outputting "probabilities" or "segmentation masks", but they cannot "explain" what they see.

The value of the Qwen-VL series is that it can translate the visual signal (pixels) under the microscope into the biologist's language (text/code).
This appendix walks you step by step through turning Qwen-VL into your "round-the-clock AI lab assistant".

B.1 Mapping Research Scenarios: Which Model Fits Your Task?

B.1 Mapping Research Scenarios: Which Model Fits Your Task?

Research task (AI4S Task) Typical scenarios Recommended model Main reason
🧫 Cell2Sentence
Single-cell morphology analysis
Drug Screen Phenotyping
Generating cell-state descriptions from images
Qwen2-VL-7B Single-cell images usually have moderate resolution but need strong semantic alignment. 7B is the best value, and fine-tuning is cheap.
🗺️ HE to ST
Predicting spatial transcriptomics from H&E-stained slides
Locating pathological regions (Tumor Region)
Qwen2.5-VL Crucial! Pathology slides (WSI) often run to hundreds of millions of pixels. Qwen2.5-VL's Native Dynamic Resolution can handle huge-resolution slides without losing cell-level detail.
🤖 Lab Agent
Controlling robotic arms in automated labs
Reading values off old instrument screens
Digitising lab records
Qwen2.5-VL Relies on very strong OCR (reading instruments) and grounding (locating test tubes). Qwen2.5-VL is the current SOTA here.
📑 Literature Mining
Extracting molecular formulas from PDF papers
Parsing experimental data charts (ChartQA)
Meta-analysis
Qwen3-VL Needs the ultra-long context brought by DeepStack (to digest a whole paper) and Thinking Mode (to reason through complex experimental logic).

B.2 Illustrated in Depth: When Qwen-VL Meets Pathology Slides (HE to ST)

B.2 Illustrated in Depth: When Qwen-VL Meets Pathology Slides (HE to ST)

In spatial transcriptomics (ST), we want to infer the expensive spatial distribution of gene expression from cheap H&E-stained images. The traditional approach is to train a CNN regression model, but Qwen-VL offers a new, "semantic-level" way of thinking.

🔬 Workflow: From Tissue to Text & Gene

H&E Slide (WSI) Gigapixel Image Qwen2.5-VL Native Dynamic Res Prompt: "Describe..." "High density of infiltrating lymphocytes in the stromal region..." Pathology Report Prompt: "Find EGFR+" Output: BBox / Heatmap Gene Localization Insight: Use visual tokens as "gene embeddings"

👨‍🏫 Teacher's Blackboard:

Don't treat Qwen-VL as merely a "chatbot". In the HE to ST task, you can fine-tune Qwen to learn this:
Input: [H&E Image] <|vision_start|>...<|vision_end|> "Locate regions with high CD8+ expression"
Output: [256, 256, 512, 512]

This turns a complex regression problem into the grounding problem that multimodal models are best at.

B.3 A Decision Tree for Research: Don’t Use a Nuke to Swat a Mosquito

B.3 A Decision Tree for Research: Don't Use a Nuke to Swat a Mosquito

🔬 AI4S Model Selector

Q1: What is your input data?
Text only / sequences (DNA/Protein)

👉 Qwen2.5-Coder / Math

No vision module needed. A maths/code fine-tuned version handles sequence logic better.

Images (Cell / Tissue / Plots)
⬇
Q2: What do the image features look like?
Large images, lots of detail (WSI) 👉 Qwen2.5-VL / Qwen3-VL You must use Dynamic Resolution, or the cells get scaled down until they vanish.
Reading charts/gauges (OCR) 👉 Qwen2.5-VL-72B Strongest OCR; handles complex tables and curves.
Single-cell micrographs (Small) 👉 Qwen2-VL-7B Good value; well suited to deployment on a local lab server.
Q3: How complex is the task?

If you need integrated reasoning across figures from several papers, or need to plan a multi-step chemical synthesis route:

🚀 You need Qwen3-VL (Thinking Mode)

Only the CoT ability of Thinking Mode can handle research problems at this System 2 level.

B.4 The Teacher’s Research Tips (Tips for AI4S)

B.4 The Teacher's Research Tips (Tips for AI4S)

💡 The resolution "myth"

For pathology analysis, don't stuff a 10000x10000 WSI in directly! Even Qwen3-VL can't take that.
The right way: use a sliding window to cut it into 1024x1024 patches, use Qwen's batch processing to generate local descriptions, and then have an LLM summarise them.

💡 Make good use of "Visual Prompting"

If you want the model to focus on nuclei, overlay semi-transparent red circles (a visual prompt) on the image. Qwen-VL is very sensitive to this kind of visual cue, and it works much better than a text-only description like "look at that round thing".

💡 Don't forget to fine-tune (LoRA)

Biomedical terms (such as "Apoptosis" and "Fibrosis") don't appear often in general corpora. Running a LoRA on a few hundred expert-annotated examples can make the model's command of the jargon improve by leaps and bounds.

💡 Structured output is key

Don't let the model write prose! Require JSON output in the prompt (for example, when extracting experimental parameters). Qwen2.5-VL is very good at following instructions, so its output can be parsed directly by a Python script.

C Appendix 3: The Ultimate Multimodal Jargon Dictionary (The LVLM Ultimate Glossary)

C Appendix 3: The Ultimate Multimodal Jargon Dictionary (The LVLM Ultimate Glossary)

This isn't just a glossary; it's an "encyclopaedia of the Qwen-VL universe". It covers all the key components, model versions and technical terms from Qwen-VL to Qwen3-VL, to help you read the technical reports with full understanding.

🌳 Model Family

🌳 Model Family

Qwen-VL

Backbone: Qwen-7B

The first generation. Based on Qwen-7B, using OpenCLIP ViT-bigG at a fixed 448x448 resolution. It laid the foundation of "three-stage training".

Qwen2-VL

Backbone: Qwen2 (2B/7B/72B)

The second generation. Introduced Naive Dynamic Resolution and M-RoPE, supporting any resolution and long-video understanding.

Qwen2.5-VL

Backbone: Qwen2.5 (3B/7B/72B)

The detail fanatic. Uses a Native Dynamic ViT and introduces Absolute Time Encoding, greatly strengthening document and agent tasks.

Qwen3-VL

Backbone: Qwen3 (Dense & MoE)

The final form. Supports a 256K context and introduces DeepStack and Thinking Mode. Comes in a 235B MoE version.

👁️ Vision Encoders (the eyes)

👁️ Vision Encoders (the eyes)

ViT-bigG

Used in: Qwen-VL
Source: OpenCLIP (laion-2b)
Params: ~1.9B
Highlights: a giant ViT, good at fine-grained features, but supports only a fixed resolution.

Qwen2-ViT (600M)

Used in: Qwen2-VL
Source: Trained from scratch (based on SigLIP)
Params: ~600M
Highlights: supports Naive Dynamic Resolution, resizing the input to multiples of 14x14.

Native Dynamic ViT

Used in: Qwen2.5-VL
Source: Trained from scratch
Highlights: drops padding entirely and natively supports variable-length input sequences. Introduces window attention to cut computational cost.

SigLIP-2

Used in: Qwen3-VL
Variant: SigLIP2-SO-400M / SigLIP2-Large
Highlights: Google's improved image-text alignment model with strong multilingual ability; the visual initialisation base of Qwen3-VL.

🏗️ Core Architecture

🏗️ Core Architecture

C-Attn Adapter

(Qwen-VL) A single cross-attention layer that compresses variable-length visual features into a fixed 256 tokens.

MLP Merger (C-Former)

(Qwen2-VL+) Uses 2x2 pooling + MLP to merge the features of 4 neighbouring patches into 1 token. Simple and efficient, and it keeps spatial structure.

DeepStack

(Qwen3-VL) Multi-layer visual injection. Visual features are injected not only at the input layer but also into the LLM's middle layers, fixing the problem of deep networks "forgetting" the visual signal.

SwiGLU

An activation function. Smoother than ReLU and able to learn more complex non-linear relationships. Standard across the whole Qwen series.

RMSNorm

Root Mean Square Normalization. A normalisation layer that drops the mean computation from LayerNorm; faster, and more stable in training.

GQA

Grouped Query Attention. At inference time it greatly reduces the memory taken by the KV cache and speeds up generation.

MoE

Mixture of Experts. Qwen3-VL has a 30B-A3B version (30B total parameters, 3B active), which is very fast at inference.

FlashAttention-2

A low-level acceleration library. Qwen2-VL relies on its VarLen feature for efficient dynamic-resolution computation.

🧭 Positional Encodings

🧭 Positional Encodings

RoPE

Rotary Positional Embedding

Encodes position as a rotation angle of the vector. It has good relative-position awareness and is standard in modern LLMs.

M-RoPE

Multimodal RoPE

(Qwen2-VL) Extends RoPE to 3D. The embedding vector is split to encode time (t), height (h) and width (w) separately.

Interleaved M-RoPE

Qwen3-VL Upgrade

(Qwen3-VL) To fix the spectral imbalance of the original M-RoPE (the time dimension occupies only high frequencies), it interleaves t, h and w across the whole embedding dimension.

Absolute Time Encoding

Text-based Timestamp

(Qwen2.5/3-VL) No longer relies entirely on position IDs; instead it inserts text tokens such as <00:05> to mark time explicitly.

📚 Data & Tasks

📚 Data & Tasks

Image Captioning

Describing an image in words. Qwen uses large-scale synthetic data (recaptioning) to make captions more detailed.

VQA

Visual Question Answering. Answering questions about an image. DocVQA (documents), ChartQA (charts) and InfoVQA (infographics) are the current focus.

Grounding / Referring

Visual grounding. Text in, bounding box out. Qwen2.5-VL further supports points and counting.

OCR

Optical Character Recognition. Reading text. Qwen-VL emphasises multilingual OCR.

Interleaved Data

Interleaved image-text data. Like PDFs or web pages, with text and images mixed together. Trains the model to handle multi-image context and references.

Long-CoT Data

Long chain-of-thought data. Maths or logic problems with detailed reasoning steps. Used to train Thinking Mode.

Hallucination

The model confidently talks nonsense (for example, describing objects that aren't in the image).

Zero-shot

The model completes a task directly, without having been fine-tuned for that specific task.

D Appendix 4: The Tough Questions Q&A (Teacher’s Office Hours)

D Appendix 4: The Tough Questions Q&A (Teacher's Office Hours)

Here are some of the "hard-hitting" questions people ask most often when reproducing, training or deploying Qwen-VL. No bureaucratic answers, just the useful stuff.

💸

Q1: I really don't have enough GPU memory. Will quantization make the model "go blind"?

👨‍🏫 Teacher: That's a very good question.
Generally, Int4 / Int8 quantization has an acceptable effect on language understanding (it just gets a tiny bit dumber). But! For the vision encoder (ViT), please keep it at half precision (BF16/FP16) and do not quantize it!

⚠️ Pitfall: the ViT usually accounts for only a small share of the total parameters (e.g. in Qwen-VL-7B only 1.9B is ViT). Quantizing the ViT to save that 1-2GB of memory badly damages the visual features, and the model may go completely "blind". Not worth it.
Best practice: quantize the LLM to Int4 and keep the ViT in BF16.
🧪

Q2: If I fine-tune, how should I set the data mixture to avoid "catastrophic forgetting"?

👨‍🏫 Teacher: This question sits at the "dark arts" core of multimodal fine-tuning.
If you fine-tune only on text, visual ability drops; if you fine-tune only on images, language ability drops. Here's the rule of thumb:

  • Domain fine-tuning: your own business data (such as medical QA).
  • General image-text replay: you must mix in about 10% - 20% general image-text data (such as COCO Caption, VQAv2). This acts as "regularisation", stopping the model from forgetting its basic visual abilities.
  • Text-only replay: if you care about the model's plain chat ability, it's best to mix in a little text-only dialogue data too.
🤯

Q3: Does Thinking Mode (CoT) really improve performance, or is it just padding?

👨‍🏫 Teacher: For simple tasks (like "there's a cat in the picture"), CoT may indeed be padding, and the overly long output can even cause hallucinations.
But! For complex reasoning tasks (like "work out the area of the triangle in the picture" or "analyse the trend in this financial report"), CoT is a qualitative change.

An LLM is fundamentally making probabilistic predictions. If you don't let it generate intermediate steps (thinking) first, it has to predict the final answer in a single step, which is far too hard. CoT gives the model room to "work on scratch paper", breaking a complex problem into simpler ones and so lowering the difficulty of each prediction.
In Qwen3-VL, Thinking Mode raised scores on maths benchmarks like MathVista by a huge margin. That's the proof.

🎬

Q4: When processing video, what FPS should I actually use?

👨‍🏫 Teacher: Don't get boxed in by FPS; think in terms of your token budget.
The core tension in video processing is: information vs. GPU memory.

  • Short videos (TikTok): you can use a high FPS (say 1~2 fps) to keep motion detail.
  • Long films (2 hours): you must use a very low FPS (say 0.1 fps, or even keyframe extraction), or the context simply explodes.
  • Qwen2.5-VL's advantage: it has dynamic resolution + absolute time encoding. You can mix inputs: many high-resolution frames for key moments, and a few low-resolution frames for quiet stretches. As long as the timestamps line up, the model can follow.
📉

Q5: The CIDEr and Rouge scores in the papers are very high, so why doesn't it feel that magical when I actually use it?

👨‍🏫 Teacher: Welcome to the real world!
Traditional NLP metrics (such as Rouge, BLEU and CIDEr) mainly measure N-gram overlap. But in multimodal tasks they often break down.
For example:
GT: "A white dog."
Pred: "A cute puppy with snowy fur."
These two sentences mean exactly the same thing, but their N-gram overlap is low, so the Rouge score is low.
The current trend: people put more weight on LLM-based evaluation (such as LLM-as-a-Judge) or on benchmarks for specific abilities (such as MathVista for maths and DocVQA for documents). Don't put blind faith in a single metric; look at leaderboards across several dimensions.

Closing: Build Your Own Eyes

Closing: Build Your Own Eyes

This long journey is finally coming to an end.
From Qwen-VL's first attempt to the showdown at the top with Qwen3-VL, what we've seen is not only the evolutionary history of a model family, but also that of the perception module of AGI.

"The eye altering alters all." (William Blake)

When a model has sharper eyesight (Dynamic Resolution), it can see the details of a document; when a model has a longer memory of time (M-RoPE + Long Context), it can understand cause and effect in video; when a model can think deeply (Thinking Mode), it can work out the logic behind the picture.

But this still isn't the end. True physical world models, embodied AI, real-time interaction... countless open problems are waiting for you to solve.

Now close these notes, open your IDE, download the weights from Hugging Face, and get your first demo running.
Getting your hands dirty is the only shortcut to learning deep learning.

Start Your Journey on GitHub