dopetalk does not endorse any advertised product nor does it accept any liability for it's use or misuse


Our Discord Notification Server invitation link is https://discord.gg/jB2qmRrxyD

Author Topic: Quantisation Explained -- Enables You To Run Large Models on Small Machines  (Read 8 times)

Online smfadmin (OP)

  • SMF (internal) Site
  • Owner
  • Sr. Member
  • *****
  • Administrator
  • *****
  • Admin
  • ****
  • Join Date: Dec 2014
  • Location: Management
  • Posts: 841
  • Reputation Power: 0
  • smfadmin has hidden their reputation power
  • Last Login:Today at 06:17:35 AM
  • Supplied Install Member
📎 Click on me to view all my attachments
ListAttBBC  |  v7.3.0  |  2026-10-26  |  Andrew.human & Claude.ai  |  live 06:59:04
#FileSizeDownloadsInfoDL
00instagram-1795547248946.mp44.1 MB7ℹ️⬇️
01Quantisation_Explained.md14.8 KB0ℹ️⬇️

📝 Inline Markdownv4.7.4 · 2026-11-20

Transcript

What is quantization in AI models and why do we do it ? Let's say you want to run an AI model like Llama three point one on your laptop.

This model is made of eight billion numbers and these numbers are called weights. Now a weight is not a simple number like zero point four three. A real weight looks like zero point four three two six one eight seven seven with many digits after the decimal point.

To store a number this precise, the computer uses thirty two bits which is four bytes. Four bytes doesn't sound like much, but the model has eight billion weights. Eight billion times four bytes is thirty two gigabytes and your laptop has only sixteen gigabytes of RAM.

So how do people run this model on a laptop? Now what if we store the same weight in fewer bits? Let's say we use sixteen bits instead of thirty two bits which is two bytes. So we save this one weight in these two bytes. But sixteen bits cannot hold all of those digits that we have in our weight. So we drop a few digits and the weight that we now store is zero point four three two six.

If we do the same for all eight billion weights, then the model goes from thirty two gigabytes to sixteen gigabytes. Let's go further and use eight bits which is just one byte. Now we save three bytes out of four and the whole model is only eight gigabytes. With four bits the model is around four gigabytes. Storing every weight with fewer bits like this is called quantization.

If we store every weight in sixteen bits, we call it sixteen bit quantization. With eight bits we call it eight bit quantization and so on. But how do eight bits hold our weight? Eight bits cannot store a decimal number like our weight. Eight bits can store only a whole number from minus one hundred twenty eight to one hundred twenty seven which is only two hundred fifty six different values.

So we have to turn our weight into a whole number. First we look at all the weights in one layer of the model and let's say all of them are between minus one and plus one. Now we match this range to the whole numbers. So minus one becomes minus one hundred twenty seven, zero stays zero and plus one becomes one hundred twenty seven. To do this we multiply every weight by one hundred twenty seven. Our weight zero point four three two six one eight seven seven multiplied by one hundred twenty seven gives fifty four point nine four. But eight bits cannot store fifty four point nine four so we round it to fifty five and we store only fifty five.

Later when the model runs, the model divides fifty five by one hundred twenty seven and gets back zero point four three three one. Our weight started at zero point four three two six and now it is zero point four three three one and this small difference is called the quantization error. Now you may ask if we are changing billions of weights why does the model still work? The model can tolerate small changes in its weights as long as every weight stays close to the original. Good quantization methods also keep the more sensitive weights at more bits. So the model often gives very similar answers. So what is the impact of quantization ?

First the model takes less memory so the model can fit on your laptop. Second the model often answers faster because the computer has less data to read for every word it generates. Third the quality drops a little. At sixteen bits and eight bits the answers are almost the same as the original. At four bits the model still works well for everyday tasks but it can make more mistakes on harder tasks. Below four bits the answers usually get clearly worse. If this video helped hit subscribe and follow.

« Last Edit: Today at 03:24:58 AM by smfadmin »
friendly
0
funny
0
informative
0
agree
0
disagree
0
like
0
dislike
0
No reactions
No reactions
No reactions
No reactions
No reactions
No reactions
No reactions
measure twice, cut once

Tags:
 


dopetalk does not endorse any advertised product nor does it accept any liability for it's use or misuse





TERMS AND CONDITIONS

In no event will d&u or any person involved in creating, producing, or distributing site information be liable for any direct, indirect, incidental, punitive, special or consequential damages arising out of the use of or inability to use d&u. You agree to indemnify and hold harmless d&u, its domain founders, sponsors, maintainers, server administrators, volunteers and contributors from and against all liability, claims, damages, costs and expenses, including legal fees, that arise directly or indirectly from the use of any part of the d&u site.


TO USE THIS WEBSITE YOU MUST AGREE TO THE TERMS AND CONDITIONS ABOVE


Founded December 2014
SimplePortal 2.3.6 © 2008-2014, SimplePortal