← Back to list

Weights in LLMs are not equally important and nobody cares.

An article about outliers, quantization and basically the flaw of QLoRA.

Emma · 2026-06-02 02:31 · 0 claps · 7.4 min read
#compression #qlora #llm #quantization
Open on Medium ↗
Wiki topics: LLM · Large Language Models FT · Fine-tuning & Adaptation OPS · LLMOps & Inference 📰 · Journalism & News ⚖️ · Law & Justice

Weights in LLMs are not equally important and nobody cares.

An article about outliers, quantization and basically the flaw of QLoRA.

The beginning of the story

After finishing my engineering degree, I joined the CNRS to work on something called Transformers. I genuinely did not understand a single word of the job description before accepting. It was talking about extreme compression, distillation, quantization (a lot of words ending in “-on” apparently, none of which sounded particularly inviting) and mysterious models called GPT, PaLM and other T5….

Complete nonsense to me at the time. But that was exactly why I took it: I liked a challenge. I was terrified, but I had a feeling I was about to learn something genuinely interesting: AI and language. It was 2021.

Yeah. I got lucky.

Taking that job would later put me among the first people working on what we now call AI (AI as the LLMs era, people were working on AI way before that). But I’m getting ahead of myself. Let me tell you about what I actually spent that year doing: extreme compression of neural networks and why I’m writing about it now.

A Neural Network Is Just a Big Excel Sheet

I always explain it this way: a neural network is a massive Excel spreadsheet filled with numbers.

It’s a big sheet though. It was big in 2021 and it is even bigger now.

And those numbers are longg, like:

2.59937972538932682637382

And the thing is that the precision actually matters… And as you can imagine this number that more space in a computer than a

2.6

or even just

2

So the question I was working on was: how do you take every number in this giant spreadsheet and store it in a way that takes less space? Ideally, without making the model dumb, slow and biased.

For the record, I was not at Google Brain or Meta. I was not the smartest person in the lab either (I’m a realist yes). But I was motivated and genuinely curious. So I spent a lot of time digging and experimenting. And at the time no Claude, no Cursor, no AI assistant of any kind things were a bit (EXTREMLY) slower.

The Weird Thing About Outliers in Neural Networks

One of the things I experimented with early on was the importance of weights in neural networks.

Here’s something funny: in classical statistics, outliers are noise. You throw them away. They’re the weird data points that mess up your regression. You learn to ignore them.

In neural networks at least in transformers and ResNets it’s the opposite.

To test this, I ran an experiment. I took all the weights across every layer of a ResNet-20, sorted them by magnitude into 15 buckets (bin 0 = the tiny weights near zero, bin 14 = the big outlier weights), and then perturbed each bucket slightly by a fixed 0.005, always pushing weights away from zero. Then I measured how much accuracy dropped.

Here’s what makes this surprising: the perturbation I applied was the same absolute value for everyone. But that means for a tiny weight like w = 0.001, I was applying a +500% relative change. For an outlier at w = 0.2, it was only a +2.5% relative change.

So the small weights were getting hit much harder in relative terms.

And yet. The accuracy drop from perturbing the outlier bucket was an order of magnitude larger than from perturbing the near-zero bucket.```

bin 0 (near-zero bulk) → accuracy drop: ~0.01%

bin 14 (outliers) → accuracy drop: ~0.8%

The outliers, despite being perturbed much more gently, broke the model far more. The bulk, despite receiving a relatively massive perturbation, barely mattered at all.

So: outliers are precious. They carry the signal. Any compression scheme that doesn’t protect them is throwing away the important stuff.

A call with a friend and BAM, It Unstucked Me

At some point I was stuck. I had this insight about outlier importance but I didn’t know what to do with it.

Then I talked to a friend from school who had started a job at Thales. He told me what he was working on: finding a way to compress and decompress radar images so they take less memory.

Ten seconds of conversation. That was all it took.

I had this picture in my head: what if, for each small block of weights in the neural network, you build a tiny codebook a table of, say, 16 representative values and instead of storing the full precise number 2.59937etc.., you just store which of the 16 values it’s closest to? To reconstruct, you just look up the codebook. Compression done. Decompression done.

It’s ok if you didn’t get it with that, do not worry, I’ll explain everything but at the time I had the vision and was ready for the next step when…

QLoRA: Someone Got There First (and it was better than I could have ever done)

This is a thing in research and in AI in the 2020s: it goes fast. If you have an idea, someone already had it, and they released the perfect paper with all the experiments and benchmarks you could never have run in a thesis.

Right around this time, the QLoRA paper came out. It proposed exactly this approach, with a codebook called NF4, Normal Float 4-bit. The construction is clever: place 16 values at the quantiles of a standard normal distribution, rescale each block of 64 weights by its maximum absolute value so everything sits in [-1, 1], then look up the nearest entry. Even the rescale factors get quantized (this is the “double quantization” in the paper).

This is what the ‘NF4 codebook’ looks like:

[-1.000 -0.696 -0.525 -0.395 -0.284 -0.185 -0.091 0.000
0.080 0.161 0.246 0.338 0.441 0.563 0.723 1.000]

I started studying the paper with my manager, and we noticed something.

NF4 concentrates most of its 16 values near zero.

Look at the spacing: between the two central values it’s about 0.08. Between the last two values (0.723 and 1.000) it’s 0.277: more than three times wider. That means any weight that lands in the far tail of the distribution gets rounded to the nearest of just two or three values at each extreme, picking up a large rounding error.

Visually, if you draw the weight distribution and overlay the 16 NF4 bin positions, you’ll have something like that:

So you see that we are not very precise around the outliers and we are around zero, which is the exact opposite of what the importance experiment said to do. The important weights are here:

NF4 is mathematically optimal if you assume every weight’s error matters equally and the distribution is Gaussian. That’s a reasonable prior. It’s just not what we observed. Accuracy doesn’t care equally about every weight. It cares a lot about the outliers and barely about the bulk.

Okay So What Should the 16 Values Be?

Now the real problem.

I wanted a codebook that’s denser at the tails and sparser near zero. So something like that:

But how do you find those 16 values for a given block of weights? The insight: instead of using a fixed, global codebook (like NF4), fit a per-block codebook that adapts to each block’s actual distribution. Every 192-weight block gets its own 16 values.

To do this, you look at the block’s empirical repartition function: basically, you sort the weights and look at how the values are spread out. It’s a curve that goes from the smallest weight in the block to the largest.

Now you need a function to approximate that curve. I’ll be honest: I am not great at finding parametric functions. My supervisor found this one. It’s a 3-parameter logit:

Find the new NF4

Once you have the logit fit (a, b, c) for a block, you still have to decide: which 16 points do you actually put in the codebook?

We compared three ways to do this:

Rule A — uniform p (the original implementation)

Pick p values evenly spaced between 0.001 and 0.999, push them through the logit. Sounds reasonable. Problem: the logit function is very flat near p = 0.5, which means the output values cluster near zero. You end up with about 11 of your 16 bins in the range [-0.1, 0.1]. Same failure mode as NF4, just with extra steps.

Rule B— tail-weighted p

A middle ground: concentrate the p-grid near 0 and 1 manually before pushing through the logit. More bins at the tails than rule A.

Rule c — Equal spacing in value space

Instead of spacing p uniformly, compute f(0.001) and f(0.999), the minimum and maximum values the logit predicts for this block and space the 16 codebook values uniformly between those two extremes. That’s just

linspace(f_min, f_max, 16).

This gives every bin the same width in value space.

And the results confirmed the visualization:

  • Starting from a ~92% baseline (fp32), QLoRA/NF4 drops accuracy noticeably.
  • Rule A: drops by almost the same amount as NF4, because it makes the same placement mistake.
  • Rule B recovers some of that.
  • And rule C recovers the most.

For GPT2 and ResNet combined

For GPT2 and ResNet combined

Why I Never Published This (And Why I’m Writing It Now)

I’m sure someone has had this idea before. Ideas rarely appear once. But I felt like this was a lost thought, and I didn’t want to bury it. It was interesting.

We couldn’t publish at the time (my manager was busy I guess) and I accepted a PhD position that finally, one late night on a bus, I will realized I hated the direction my life was taking out there so I said no to the thesis.

Best decision I ever made.

I got to spend time working on concrete use cases for companies instead (Naval Group, Total Energies, Louis Vuitton, Volvo or EDF..). One thing led to another , and now I’m an engineer living in New York City which was my absolute dream.

So: here’s the work. Four years late, no peer review, no benchmark suite. Just a series of notebooks from a 2021 CNRS lab, cleaned up and written out properly, about why codebook placement matters more than the fit.

The notebooks are available [here]. Experiments run on ResNet-20 / CIFAR-10 and GPT-2. All code in Python + PyTorch.


메타데이터
post_id
e447290b10b2
slug
weights-in-llms-are-not-equally-important-and-nobody-talks-about-it-e447290b10b2
url
https://medium.com/@genthonemma/weights-in-llms-are-not-equally-important-and-nobody-talks-about-it-e447290b10b2
canonical_url
https://medium.com/@genthonemma/weights-in-llms-are-not-equally-important-and-nobody-talks-about-it-e447290b10b2
author_url
https://medium.com/@genthonemma
status
ok
fetched_at
2026-06-09 15:37:30