lab

A style SAE inside Qwen-Image's text encoder: what Qwen3-VL knows about style

A side project of chameleon, our attempt at an open Midjourney --sref. Steering image models with SAE features is unreliable, so this one is about reading, not steering: which style concepts does the encoder that conditions Qwen-Image represent, and are they separate from content?

Interactive explorer: Qwen3-VL Style Atlas. It has every style and content feature discussed here, with its top images, caption labels and style η², for layers 36 and 18.


TL;DR


1. Why an SAE, and why on Qwen3-VL

Chameleon tried to build a reusable style "cartridge" for Qwen-Image. One recurring question was what the model's own conditioning knows about style. Qwen-Image 2.1 conditions its DiT on hidden states of Qwen3-VL (36 layers, width 4096), and accepts reference images through the same encoder. If style lives in identifiable directions there, it could be read out, compared across references, or even filtered.

We chose Qwen3-VL over the DiT's own activations for three reasons:

  1. It is the conditioning encoder. It is what turns a reference image into something the DiT can use.
  2. It is cheap. Caching it needs only the encoder, with no denoising loop and no noise level to pick.
  3. The data comes labelled. MegaStyle (tencent/MegaStyle-1.4M; we use the MegaStyle++ shards) was generated by Qwen-Image from about 170k structured style prompts × 400k content prompts, 8 images per style. That gives free style groups and free captions to label features with.

The circularity is worth stating up front: MegaStyle is Qwen-Image's own output distribution. That suits a study of Qwen-Image's encoder, and it limits how far the findings generalise to human-made art.

2. Setup

Activations. Each image is center-cropped to 512 px, which becomes 256 image tokens after Qwen3-VL's 2×2 merge. It is passed alone through Qwen-Image's chat template with an empty prompt, exactly as Qwen-Image loads the encoder. Forward hooks cache two layers:

Per image we keep the mean over image tokens plus 8 random image tokens, stored as f16.

Data.

Pilot Scale-up
Images 8,000 48,000
Styles 1,000 (one contiguous slice of one shard; MegaStyle is sorted by style, so it was noir-heavy) 6,000 (2,000 random styles from each of shards 00013, 00040, 00080)
Images per style 8 8
SAE m = 4,096, k = 32, 60 epochs m = 16,384, k = 32, 20 epochs

SAE. Top-k SAE (Gao et al. 2024).

Style η². For each feature, take its activation on every image's mean vector and compute the share of variance explained by the style group (one-way ANOVA η²).

Labels. Each feature's top-50 images are scored phrase by phrase against MegaStyle's structured style prompts:

Plain log-odds, used in the pilot, kept picking rare lighting phrases; weighting by precision fixed that.

3. Results

Pilot L36 Pilot L18 Scale-up L36 Scale-up L18
held-out FVU .36 .25 .28 .010*
live features 3,792 / 4,096 2,261 7,307 / 16,384 1,543
frequent (≥ 0.1 % of images) 1,708 — 2,835 889
style η² > .3 52 13 386 136
style η² > .5 — — 165 53
median style η² .128 .128 .125 .127

* Layer 18's variance is dominated by a few very large "massive activation" channels. The SAE reconstructs those and looks near-perfect while capturing comparatively little of the rest, so its FVU is not comparable to layer 36's.

Histogram of style eta squared for layer 36 and layer 18 SAE features, log count: a large spike at the chance level .125 and a long tail to .9
Histogram of style eta squared for layer 36 and layer 18 SAE features, log count: a large spike at the chance level .125 and a long tail to .9

The distribution has two parts: a spike at chance (most features) and a long tail of style-consistent features that reaches .89. Scaling from 1,000 noir-heavy styles to 6,000 random ones grew that tail sevenfold at layer 36, and the labels became coherent across several caption fields.

3.1 Style features

Eight SAE feature cards with six top images each: vintage polaroids, ink mandalas, halftone screen print, splatter paint, pixel art, flat chibi stickers, 3D cartoon renders, purple plastic 3D renders
Eight of the 165 layer-36 features with style η² > .5. Titles and subtitles are the automatic labels from MegaStyle's style prompts. Each feature fires across unrelated subjects (people, shoes, bridges, fruit) in one look.

What the tail contains:

Atlas of the 24 most style-consistent layer-36 features, nine top images each
The 24 most style-consistent layer-36 features, nine top images each, with their automatic labels.

3.2 Content features

Eight content feature cards: Eiffel tower, fireplace, tiger, fountain, pagoda, runway, piano, barbell, each across photo, ink, flat vector and neon styles
Content features: style η² at chance, strongest content-word labels. Each fires on its subject in photographs, ink drawings, flat vector art and neon renders alike.

The content side mirrors the style side. Features for the Eiffel tower, fireplaces, tigers, fountains, pagodas, runway shows, pianos and barbells fire on their subject in whatever style it was rendered in. Their top images span the whole style range of the dataset, which is exactly what style η² ≈ chance means.

Atlas of 24 content features at layer 36 with near-chance style eta squared
24 content features (style η² < .2, strongest content labels). Some concepts split into several near-identical features (Eiffel tower ×4, fireplace ×4).

3.3 Layers

4. What the encoder represents, and what reaches the image model

There is an architectural fact we only noticed while porting Qwen-Image. When a reference image is given:

So the layer-36 image-token features above are what Qwen3-VL represents about an image. They are not a channel the DiT reads directly. The channel the DiT does read is the prompt-token states, and those carry only part of it.

The chameleon ablation measured how much. With the reference given to the encoder only and the latents removed:

Almost all of a native reference's style, and all of its subject copying, rides on the VAE latents.

Grid: reference, then the same prompt rendered with native reference, latents only, VL only, and VL with SAE style filter; latents copy the bride and the impressionist sitter, VL-only arms keep the prompt with little style
Same prompt, four ways to give the reference. Latents only behaves like the full native reference, including pasting the subject. VL only and the SAE-filtered VL keep the prompt and carry little style.

5. Caveats

6. A negative result: filtering the reference through the SAE

If style and content features separate, can we keep only the style features of a reference and get style without copying? Section 4 rules out acting on the final layer: the DiT never sees those states. So the filter acts on the reference's image tokens at layer 18, and layers 19–36 carry the change into the prompt tokens:

Results (VL-only reference, 11 references × 3 prompts, judged by CSD to the reference):

Arm t2i CSD edit CSD copy (DINO), t2i
no reference .084 .084 .031
VL only .122 .139 .079
vl_recon .124 .152 .080
vl_style .096 .119 .072
vl_styleonly .092 .128 .073

Two likely reasons:

A cleaner test would filter at several early layers. It would not change the main conclusion: with the latents removed, there is little style left to filter.

7. What it's good for

Appendix: numbers and settings