The Text Encoder Was the Biggest Thing on the Card. A 26MB Matrix Replaced It.
MiniMax H3 spends 15.7GB of VRAM on a 32B text encoder it uses once per prompt. A projection matrix fitted with ridge regression lets a 4B model do the same job in 4.6GB, and the measurement mistakes made along the way teach more than the memory saving.
AI-assisted draft. Reviewed and edited by the Phosphene team before publication.
On this page

MiniMax H3 spends 15.7GB of VRAM on the part of the pipeline that never draws a pixel.
The model loads a Qwen3-VL-32B, truncated to 50 layers and quantised to NVFP4, for one job: read your prompt and hand the diffusion transformer a [seq, 5120] conditioning tensor. With the encoder pinned in memory, it occupies 15.7GB of the card while the DiT, the VAEs and the sampler do the actual work. Whether it stays pinned is a loader decision: ComfyUI's stock Load CLIP route offloads it before sampling, while the all-in-one ClipProj loader keeps it resident, and once the remaining VRAM no longer covers the DiT, the VAEs and the sampler, that is the configuration where a 24GB card can start paging to shared memory.
In late November a community project called ClipProj replaced it. Not with a smaller quantisation of the same 32B, but with a Qwen3-VL-4B and a learned projection into the 32B's output space. Total footprint, 4.6GB including the encoder. The projection itself is 26MB. The diffusion model, the VAEs and the sampler are untouched, and the custom node returns something that behaves enough like the official CLIP to drop into the existing clip input.
The Japanese newsletter that surfaced this led with the VRAM number, which is the easy part. The interesting part is how the thing was proven, and the three conclusions the author had to overturn on the way. If you ever evaluate a "swap this for a smaller this" claim, those measurements are the useful artifact.
Why it works at all
Qwen3-VL models at different sizes share one tokenizer, 151,936 tokens. Feed the same prompt to the 32B and the 4B and you get the same tokens at the same positions. Their hidden states therefore line up position by position, which makes a mapping between them learnable rather than wishful.
The map is affine: subtract the input mean, divide by the input standard deviation, multiply by a matrix, then scale and shift into the output statistics. It is fitted by plain ridge regression. No gradients, no epochs, no learning rate, no GPU hours spent on training. The -mlp files add a d_in → 16384 → 5120 GELU network to that map. In the earlier releases the residual is added on top of the ridge matrix, with its last layer initialised to zero so training starts exactly at the matrix and can only improve on it. The v3 and v3.1 -mlp files drop the matrix and ship the residual alone, which is why the node prints residual only when one loads: a truncated download is not the explanation.
That residual is worth 0.05 to 0.08 of cosine similarity, roughly four times what multiplying the calibration corpus by eleven buys the linear part. Width beat depth, too: two hidden layers of 8192 reached 0.7691 against 0.7944 for a single layer of 16384.
What the numbers actually say
Test cosine similarity against the 32B's own conditioning, on held-out prompts, comparing like for like:
- 4B, matrix only: 0.7169
- 4B, matrix plus residual: 0.7944
- 8B, matrix only: 0.7528
- 8B, matrix plus residual: 0.7970
- 8B, matrix plus residual with the 500-name corpus: 0.8037
That last row is the best file in the set and the one the card recommends if the VRAM allows, but it is not the 4B's comparison. Scored against its own no-names twin, the 8B buys 0.0026 of cosine over the 4B, which is another way of saying the size jump between them is nearly free of consequence until the name corpus enters.
A cosine of 0.79 reads like a broken model. It is not, and that gap between the metric and the render is the first lesson. What holds up in actual generation: simple prompts, structured multi-shot prompts with several distinct cuts and no bleed between them, first-and-last-frame conditioning, and reference-to-video with either a still or a clip as the reference. Fidelity also does not collapse on short prompts. Measured per-token cosine goes from 0.937 at 80 words to 0.908 at 2 words.
The author's blunt summary of the project so far is that cosine does not predict which of two files renders better. He says to try both on your own prompts. That is a strange thing to read on a model card, and it is why the card is worth reading.
The improvement that was a measuring artefact
This is the part I keep coming back to.
The DiT does not consume conditioning as it arrives. It pushes it through condition_proj, a Linear(5120 → 5376) feeding the token refiner. That layer's spectrum is lopsided: a factor of 45 between its top and bottom deciles of singular values, with 52% of the energy in 10% of the directions. Ridge regression fitted in the raw 5120-dim space spends equal effort on a direction the DiT will multiply by 0.10 and one it will multiply by 37.
So the author refitted against the output of that layer, then mapped back through the pseudo-inverse, on the theory that this minimises the error the DiT actually sees. Cosine jumped from 0.697 to 0.845 on the 4B and from 0.731 to 0.860 on the 8B. A real result, apparently.
Then he compared the two matrices directly, same corpus:
4B CONDPROJ vs unweighted cosine 0.999998
8B CONDPROJ vs unweighted cosine 0.999999
They are the same function. Unregularised least squares is invariant to an invertible linear transform of its targets, so fitting in one space and mapping back recovers the identical map. Only the ridge penalty breaks that invariance, and with 37,851 training tokens against a penalty of 1000 it barely binds. The entire gain was an artefact of scoring in a different space, and the published cosine was measured before anyone checked whether the matrix had changed.
Two things follow, and both generalise well beyond this project. First, when you refit something for a downstream consumer, measure in that consumer's space, because a metric computed in the wrong basis will happily reward you for doing nothing. Second, before you report an improvement, compare the two artifacts' outputs on the same inputs. He did exactly that, one comparison, and found the cosine at 0.999998. A byte check on the weight files would not have told him the maps were the same function, because they were not stored identically.
Where the small encoder breaks
Named people were the first real casualty, and it was a corpus problem rather than an architectural one. The calibration set named a person on about 70 lines out of 8,632, roughly 0.02% of the training tokens. Nothing constrained the directions in the hidden space that carry an identity, so the fit put whatever minimised overall error on landscape description there. Famous names came out as a different famous person.
The fix was 500 popular names with five short prompts and two long ones each. Name tokens went from 0.8265 to 0.8844 cosine, the rest of the sentence from 0.9358 to 0.9516, and the general test set lost about a thousandth. Two contexts per person turned out to be enough, at 0.9875, against 0.9945 for five and 0.9986 for twenty. A held-out band of names at popularity ranks 501 to 540, absent from calibration entirely, reconstructs at 0.8795. So covering 500 people does not teach 500 names. It teaches the map how to handle that region of the space.
What the corpus cannot fix is identity that lives outside a face. A character recognised by a mask or a costume comes out as a stranger wearing the right clothes, because the identity is not in the name's representation to begin with. Fame from before everything was photographed fares badly too. And some names fail on the plain 32B, which is the check worth running first.
Three more failure classes, none of them fixed by a better matrix:
- Quantisation costs facts. Comparing
int8_convrotagainstbf16on factual recall shows errors appearing under quantisation. Fine for a look, worth knowing if your prompts are dense with proper nouns. - Counting is unreliable, and it is unreliable on the 32B as well. Ask for three of something and you may get four. Enumerating the items works better than announcing a number.
- Speech is the fragile part. The first release mangled non-English speech: a French line came out half Spanish, and the 8B put everything in English. The cause was a corpus that was overwhelmingly English, and the fix was giving every writing system a comparable share plus raw Arabic. Phoneme errors dropped 29% overall, and 60 to 74% in Spanish, French, German and Italian.
The baseline nobody uses
The cleanest number in the whole report is not about the projection at all. The 32B does not reproduce itself: change only the seed and it re-pronounces 5.8 phonemes out of 75 differently. The current small-encoder files sit at 6.4 to 7.0 on the same measure. So swapping a 32B encoder for a 4B costs about what re-rolling the seed costs, and every figure in the report is normalised against that variance instead of against zero.
That is the standard I would steal. Most pipeline comparisons quietly assume the reference run is deterministic. When it is not, a small regression gets reported as a catastrophe, or a real one hides inside normal noise.
Run the controls first
Two control matrices ship with the files, and they exist to prove the learned one is doing the work rather than the diffusion model. Same prompt, same seed, only the matrix changes:
- Zero matrix, prompt "a red ball on a wood table": a countryside landscape. The prompt is ignored completely.
- Identity matrix: a golden object in flames. Unusable.
- A learned matrix: the red ball on a wood table.
The identity matrix has a norm of 50.6 against the learned one's 52.4, so the difference is structural rather than a matter of scale. The instruction that comes with them is the best line on the model card: if the identity control ever looks fine, the learned matrix adds nothing, and you want to know that before you trust it.
Should you actually swap it
If your prompts lean on proper nouns, brand names, masks, on-screen text or multilingual dialogue, the 4B will show it. Those are exactly the regions where the projection is weakest, and the report measures them rather than hiding them. Stay on the official encoder and buy the VRAM, or accept that a reshoot is part of the workflow.
If you are doing look development at volume on a small card, the honest version is less dramatic than the VRAM headline. ComfyUI's stock Load CLIP route, paired with ClipProj Apply, offloads the encoder to system RAM once the prompt is encoded, and the same route unloads the 32B before sampling too. So on a single card the swap is not what decides whether the job fits. What it changes is the encode itself and the RAM pressure around it: 15.7GB down to 4.6GB, a much shorter prompt pass, and far less shuffling between runs.
The configuration where the encoder footprint does dominate is the all-in-one node that pins the encoder, and the README is blunt about it: that loader exists for multi-GPU machines, because a pinned encoder takes 4 to 9GB away from the diffusion model at every sampling step, and when that pushes the model's own weights past what is left on the card, they page instead. One report from an 8GB card has the stock 32B looking faster than a projected 4B for exactly that reason, since ComfyUI unloads the 32B before sampling while the pinned 4B stayed put. Read the memory saving as a fact about the encoder, not a promise about your pipeline. The report's own framing still fits: an imaging professional who programmes as a hobby wanted to know whether a diffusion model's text encoder could be replaced at all, expected it to fail, and published the numbers when it did not.
Two caveats before anyone builds a product on it. The matrices are MIT, but they are derived from the activations of both models and their legal status is unclear, so the author released them for research. Qwen3-VL is Apache 2.0, MiniMax H3 ships under a custom licence that is worth reading before commercial use, and the continuous batching of a 4B encoder into a hosted service is a different question from a personal ComfyUI graph.
The wider lesson is about where to look when memory is the constraint. The text encoder is usually the least audited part of an image or video stack, because it produces no visible output and its size is inherited from whatever the model shipped with. Here it was 15.7GB of a job that needed the conditioning once. Somebody measured what that encoder was actually for, replaced it with a 26MB map, and then spent most of the report proving he had not fooled himself.
For teams running generation on their own hardware, that diagnostic order is worth copying: measure the reference's own variance, run a control that should fail, and score in the space the next stage reads. The encoder is not the only place a pipeline hides its cost, and loading order can cost you as much as model choice. Phosphene runs generation server-side, so nobody using it manages encoder weights, and a projection like this is infrastructure rather than a feature. The habit of proving a swap instead of assuming it is the part that transfers.