Bring the mental model from Efficiency: Quantization, Distillation, LoRA & Sparse MoE; this page will reuse it instead of restarting from zero.
Quantization: Compressing Models to Integers
Reduce memory and bandwidth by storing weights/activations in low-bit integers (INT8/INT4) with careful scaling to limit accuracy loss.
01
Intuition
Build the mental picture first so the rest of the page has something to attach to.
Large models are often bottlenecked by memory bandwidth, not raw FLOPs. If memory bandwidth is the bottleneck, moving less data can improve throughput, though the actual speedup depends on kernels, hardware, batch size, and which tensors are quantized.
Quantization is the core trick: store weights (and sometimes activations) in low-bit integers like INT8 or INT4, with a scale factor that maps those integers back to approximate floating-point values.
A major enemy, especially in large LLM quantization, is outliers: a small number of large weights/activations can force a scale that wastes resolution for everything else.
Copy-only prompts — each action copies a page-grounded prompt to your clipboard. Nothing is sent by this site.
02
Math
Translate the story into symbols, assumptions, and a derivation you can inspect.
Uniform quantization (per-tensor)
Given a tensor of weights with min/max values, choose one step size for the whole tensor and round onto integer levels:
Here b is the number of bits (8 for INT8, 4 for INT4).
Finer-grained scaling: per-channel / row-wise
Instead of one scale for the whole matrix, use one scale per output channel/row. For signed symmetric quantization:
This usually improves quality because different channels have different dynamic ranges.
Copy-only prompts — each action copies a page-grounded prompt to your clipboard. Nothing is sent by this site.
03
Code
Keep the implementation aligned with the notation so the algorithm is legible.
import numpy as np
rng = np.random.default_rng(0)
w = rng.normal(size=10000).astype(np.float32)
def quantize_uniform(w, bits=8):
qmin, qmax = 0, 2**bits - 1
wmin, wmax = float(w.min()), float(w.max())
delta = (wmax - wmin) / (qmax - qmin)
wq = np.clip(np.round((w - wmin) / delta), qmin, qmax).astype(np.int32)
what = (wq * delta + wmin).astype(np.float32)
return what, float(delta)
what8, d8 = quantize_uniform(w, bits=8)
what4, d4 = quantize_uniform(w, bits=4)
print("RMSE INT8:", round(float(np.sqrt(((w - what8) ** 2).mean())), 6), "delta:", round(d8, 6))
print("RMSE INT4:", round(float(np.sqrt(((w - what4) ** 2).mean())), 6), "delta:", round(d4, 6))
print("memory reduction: fp16->int8 ~2x, fp16->int4 ~4x (weight storage)")
Copy-only prompts — each action copies a page-grounded prompt to your clipboard. Nothing is sent by this site.
04
Interactive Demo
Use direct manipulation to connect the explanation to a moving system.
Live Concept Demo
Explore Quantization: Compressing Models to Integers
The stage is code-native and interactive. Use it to test the explanation against the mechanism.
Manipulate one control and predict the visible change.
Choose what to inspect in Quantization: Compressing Models to Integers. This shared fallback is an observation guide, not evidence of learning.
The demo below asks you to predict which scaling strategy survives an outlier before revealing the quantization error. The key invariant is that a single shared scale can waste most integer levels on one large value, while per-channel scales recover resolution for ordinary rows.
Copy-only prompts — each action copies a page-grounded prompt to your clipboard. Nothing is sent by this site.
Concept: Quantization: Compressing Models to Integers
What is the smallest example that makes Quantization: Compressing Models to Integers click without losing the math?
Object contextEfficiency
concept:efficiency/quantizationQuantization: Compressing Models to Integers
What is the smallest example that makes Quantization: Compressing Models to Integers click without losing the math?
Start with the prediction checkpoint, then compare the reveal to the mental model.
Take this moveStudy modes
Keep the object fixed; change the lens.Route back through the notebook
Carry the same object through intuition, math, code, and demo.
Reduce memory and bandwidth by storing weights/activations in low-bit integers (INT8/INT4) with careful scaling to limit accuracy loss.
The next edge should feel earned: use the demo prediction here before following Long Context Engineering: RoPE Scaling, KV Compression & Memory Optimization.
After The First Pass
Turn the concept into an inspected object.
The lower panels are one second act: keep the object fixed, inspect it visually, check source boundaries, practice transfer, then attach the research question.Mechanism Storyboard
See the idea move before the page explains it
Reduce memory and bandwidth by storing weights/activations in low-bit integers (INT8/INT4) with careful scaling to limit accuracy loss.

Start with the picture, metaphor, or geometric mechanism.
Before reading further, choose the kind of change Quantization: Compressing Models to Integers should make visible.
Visual Inquiry
Make the image answer a mathematical question
Reduce memory and bandwidth by storing weights/activations in low-bit integers (INT8/INT4) with careful scaling to limit accuracy loss.
Which visible object should carry the first intuition?
Pick the cue that should make Quantization: Compressing Models to Integers easier to reason about before the page gives the answer.
Source Grounding
Canonical references for the mechanism on this page.
What is the smallest example that makes Quantization: Compressing Models to Integers click without losing the math?
concept:efficiency/quantizationsources: dettmers-2022-llm-int8, frantar-2022-gptq
Open the closest source note before trusting the local explanation.
2 selected-object sources shown first; 2 references total.
Audit the claim boundary, then ask from the same selected object.
Grounds transformer-scale INT8 inference, vector-wise normalization, and mixed-precision handling of emergent outlier feature dimensions.
Dettmers et al. show transformer-scale 8-bit inference needs separate normalization constants and mixed-precision handling for emergent outlier features. Frantar et al. ground GPT-style p...
Checks the page's finite uniform-quantization and scale/outlier lesson only; it does not claim a full GPTQ solver, exact LLM.int8 routing, calibrated model accuracy, hardware speedups, ac...
Grounds GPT-style post-training weight quantization using approximate second-order information and error-compensating updates.
Dettmers et al. show transformer-scale 8-bit inference needs separate normalization constants and mixed-precision handling for emergent outlier features. Frantar et al. ground GPT-style p...
Checks the page's finite uniform-quantization and scale/outlier lesson only; it does not claim a full GPTQ solver, exact LLM.int8 routing, calibrated model accuracy, hardware speedups, ac...
Claim Review
Reduce memory and bandwidth by storing weights/activations in low-bit integers (INT8/INT4) with careful scaling to limit accuracy loss.
What is the smallest example that makes Quantization: Compressing Models to Integers click without losing the math?
concept:efficiency/quantizationsources: dettmers-2022-llm-int8, frantar-2022-gptq
Treat every claim as provisional until source support and a local witness agree.
1 structured claim check on this concept.
Run the prediction or practice transfer before asking for a grounded review.
Publisher-side editorial review is not independent replication. Claims without it still need exact source-support review. 2 references and 3 local witnesses are available for inspection.
Dettmers et al. show transformer-scale 8-bit inference needs separate normalization constants and mixed-precision handling for emergent outlier features. Frantar et al. ground GPT-style post-training weight...
Checks the page's finite uniform-quantization and scale/outlier lesson only; it does not claim a full GPTQ solver, exact LLM.int8 routing, calibrated model accuracy, hardware speedups, activation quantizatio...
Oracle PASS: Dettmers supports Int8 scaling/dequantization, single-scale outlier precision loss, vector-wise constants, and mixed-precision outlier handling; Frantar supports low-bit GPT weight quantization as compression with reconstruction-error control and reduced memory movement. Scope excludes full GPTQ, exact LLM.int8 routing, calibrated accuracy, speedup, activation coverage, and all low-bit methods.
Reviewer: codex+oracle; reviewed 2026-05-07Practice notebook
Use the idea, then test it somewhere new
Reduce memory and bandwidth by storing weights/activations in low-bit integers (INT8/INT4) with careful scaling to limit accuracy loss.
What is the smallest example that makes Quantization: Compressing Models to Integers click without losing the math?
concept:efficiency/quantizationsources: dettmers-2022-llm-int8, frantar-2022-gptq
Use one state from Quantization: Compressing Models to Integers to explain what changes, why it changes, and which assumption the explanation needs.
No learner move yet; no learning state is inferred.
Write first, use only the help you need, then try a new case without it.
Use one state from Quantization: Compressing Models to Integers to explain what changes, why it changes, and which assumption the explanation needs.
Reveal when your model needs a nudge.
Reveal when your model needs a nudge.
Reveal when your model needs a nudge.
Write an attempt before asking the companion.
0 of 3 progressive hints opened.
This draft and any AI response do not establish mastery; a later unassisted case can.
- ObjectConceptQuantization: Compressing Models to Integers
- PredictBefore revealQuantization: Compressing Models to Integers prediction
- WitnessCompare codeQuantization: Compressing Models to Integers code witness 1
- RoomAsk groundedChecking local snapshot
Research Room
Attach the question to an exact object
Pick the concept, equation, source, code witness, claim, misconception, or demo state before asking for help. The handoff stays grounded to that object.Open the draft below to save one note and next action in this browser.
Quantization: Compressing Models to Integers
What is the smallest example that makes Quantization: Compressing Models to Integers click without losing the math?
These are fixed, deterministic perspectives derived from the selected object. They do not represent people, community contributions, or independent review.
Source ids dettmers-2022-llm-int8, frantar-2022-gptq must support the exact object, not just the surrounding topic.
Treat this as a mechanism object: connect the definition to one equation, code witness, or demo before broadening the discussion.
Ask the learner to perturb one representation, then check whether the same invariant survives in math, code, and demo.
The learner can state the mechanism in their own words
Local action draftNo local draft saved yetExpand only when ready to capture one local next action
This draft stays locally in this browser for concept:efficiency/quantization.
- Source ids to inspect: dettmers-2022-llm-int8, frantar-2022-gptq
- Definition, prerequisite, and contrast concept links
- The equation or code witness that makes the concept operational
- One demo state that shows the invariant instead of a slogan
- The learner can state the mechanism in their own words
- The learner can name the prerequisite that would repair confusion
- The learner can predict how the mechanism changes under one perturbation
I am working in Continuous Function's research reading room. Object: concept - Quantization: Compressing Models to Integers Object key: concept:efficiency/quantization Context: Efficiency Anchor id: concept/concept-notebook/efficiency/quantization Open question: What is the smallest example that makes Quantization: Compressing Models to Integers click without losing the math? Evidence to inspect: - Source ids to inspect: dettmers-2022-llm-int8, frantar-2022-gptq - Definition, prerequisite, and contrast concept links - The equation or code witness that makes the concept operational - One demo state that shows the invariant instead of a slogan Deterministic role lenses for this object: - Boundary: fixed perspectives, not people, community contributions, or independent review - Source-checking summary: Treat this as a mechanism object: connect the definition to one equation, code witness, or demo before broadening the discussion. - Proposed experiment: Ask the learner to perturb one representation, then check whether the same invariant survives in math, code, and demo. - Teach/transfer move: Turn the mechanism into one sentence that predicts a neighboring concept. - Assumptions: - Source ids dettmers-2022-llm-int8, frantar-2022-gptq must support the exact object, not just the surrounding topic. - The stable content-object key lets local drafts, prompts, and route memory attach without changing the source page. - The concept explanation is local atlas prose until checked against its math, code, and source support. - Prerequisite gaps should become a repair route, not a reason to leave the object vague. - Role-lens requests: - Learner: ask for "Ask what would make "Quantization: Compressing Models to Integers" feel predictable rather than familiar." | assumption: Source ids dettmers-2022-llm-int8, frantar-2022-gptq must support the exact object, not just the surrounding topic. | next action: The learner can state the mechanism in their own words - Researcher: ask for "Source ids to inspect: dettmers-2022-llm-int8, frantar-2022-gptq" | assumption: The stable content-object key lets local drafts, prompts, and route memory attach without changing the source page. | next action: The learner can name the prerequisite that would repair confusion - Experimenter: ask for "Choose one variable or condition to perturb before asking for an explanation." | assumption: The concept explanation is local atlas prose until checked against its math, code, and source support. | next action: The learner can predict how the mechanism changes under one perturbation - Professor: ask for "Find the smallest transferable rule a learner could reuse without the AI." | assumption: Prerequisite gaps should become a repair route, not a reason to leave the object vague. | next action: Teach or transfer: Turn the mechanism into one sentence that predicts a neighboring concept. What would resolve this: - The learner can state the mechanism in their own words - The learner can name the prerequisite that would repair confusion - The learner can predict how the mechanism changes under one perturbation Answer as a careful research tutor: stay source-grounded, separate verified evidence from assumptions, name the relevant math objects, and end with one next action. Current deterministic role lens for this object: - Role lens: Learner - Evidence request: Ask what would make "Quantization: Compressing Models to Integers" feel predictable rather than familiar. - Assumption to keep visible: Source ids dettmers-2022-llm-int8, frantar-2022-gptq must support the exact object, not just the surrounding topic. - Proposed experiment: Ask the learner to perturb one representation, then check whether the same invariant survives in math, code, and demo. - Next action: The learner can state the mechanism in their own words
concept/concept-notebook/efficiency/quantization
concept:efficiency/quantization