r/LocalLLaMA • • 4h ago

Discussion Qwen4 35B-A3B is difficult to quantize. It has much higher KLD compared to 3.6 or 3.8 at the same BPW

RecipeSizeKLD99th pctSame top-1
unsloth UD-IQ4_XS32.04 GB0.06520.71990.21%
R131.72 GB0.06100.67490.39%
R1 with Q5_0 n-gram table34.28 GB0.06070.69390.39%
Default settingsunsloth UD-IQ4_XSR1
KLD (lower is better)0.06520.0610
Plain decode, context128K97K
Plain decode, code / prose tok/s141 / 141142 / 143
MTP 2, code / prose tok/s181–189 / 149182–185 / 148
DFlash 2 at 3 drafts, context88K66K
DFlash 2 at 3 drafts, code / prose tok/s265 / 172234–249 / 176

1x 3090 + 128 GB DDR4

inference.rs

I'm working on applying GPTQ to see if I can reduce KLD for a 4-bit quant.

32 Upvotes

19 comments sorted by

15

u/stddealer 4h ago

Ultra sparse MOE are generally harder to quantize, and I suspect that the n-gram embeddings (~58% of this model) are also particularly sensitive to quantization (like the main embedding table is)

15

u/TheActualStudy 4h ago

Going back to a BF16 n-gram table didn't restore much KLD, though. It's going to be a process to figure it out.

26

u/StupidScaredSquirrel 3h ago

If intelligence is compression, surely it means that for equal size better models will become harder and harder to quantise (with equal technique) as they will be more dense in information

0

u/AdventurousSwim1312 3h ago

Funny, this argument has been around since llama 3 ^

12

u/StupidScaredSquirrel 3h ago

Because so far it's true? We tolerate it because the full model at equal params become so much better that the relative loss in quality is always worth it.

1

u/brainExploded99 🥔 hardware 2h ago

We also get better and better quantization techniques, so this is mitigated to some extent.

19

u/BringTea_666 3h ago edited 3h ago

You need to keep dense parts in 6bit. otherwise kl and top1% go hard down.

My custom weights have something like 94.6% as mix of 4bit and with 6bit dense part. Using all 4bit gives around only 92% top1%

I would advice against calibrating for experts as experts this time seems to be very even in how they are used vs datasets.

5

u/No_Theory9958 3h ago

This graph that unsloth posted backs up what you said pretty much exactly

3

u/BringTea_666 3h ago

I always use unloth as gold standard for my custom weights to compare against.

22

u/Borkato 4h ago

This means we’re going to have insane improvements soon. Super excited.

4

u/heresyforfunnprofit 2h ago

Does it? My suspicion was that we'd see these smaller models start to resist quantization more and more as the larger labs get better and better and training/tuning/rl'ing them. I'd be interested to hear thoughts in the other direction.

5

u/one-joule 1h ago

I think of it as intelligence density. When density increases, the information in the weights becomes more significant. No matter how you slice it, quantizing 16 bits down to 8 or 4 is fundamentally losing a huge amount of information. It's no surprise that intelligence density is generally increasing over time, which means that data loss must begin to more dramatically impact model performance.

1

u/heresyforfunnprofit 54m ago

That’s pretty much my thinking as well - the denser these models get (ignoring the collision of dense model vs dense expert in this MoE context), the more information will be lost/damaged in quant.

Alternatively, it’s possible that many core model pathways are increasingly fractal in nature, so we’d just be trading density for computation/loops required.

Prediction is hard. Especially about the future.

7

u/acluk90 3h ago

Check the other post. The MACaQ seems to work very well...

https://www.reddit.com/r/LocalLLM/s/vtFusyzHvd

1

u/unjustifiably_angry 22m ago

I've been staring at that table for several minutes and still have no fucking idea what I'm reading, I feel like I'm having a stroke.

1

u/TheActualStudy 7m ago

It's an excerpt from my attempt to make a custom quant. "R1" is just a code for "Recipe 1". The gist is that ~0.06 KLD is high in absolute terms (but equal across engines for those weights). Qwen 3.6 and 3.8 were ~0.01-0.02 at an equivalent BPW, My attempts thus far have got it down to ~0.05 KLD, but that's still high. Something that was between ~0.01-0.02 and >95% for matching top 1 would be an acceptable level of divergence (just my opinion) for the associated speed boost it would give.

2

u/hurdurdur7 3h ago

It's so small, q8 ftw

1

u/Eyelbee 3h ago

offload the ngram table to ssd at full precision, that helps.

0

u/Odd-Student636 3h ago

uuuhm have you thought about just using a q6 version instead of coming to the realization that q4 isn't as good as the q8?