Prueba de 2 bits
Only three signed levels preserve little detail.
Cálculo / simulación localExperimento educativo local, sin API externa. Los datos sintéticos no son mediciones de producción.
Study guide & lesson outline
LEARNING CONTRACTUnderstand → implement → investigate
Goal: explain the mechanism in this lesson, reproduce one example and test a failure case. Reading alone does not mark mastery.
- Understand: state assumptions, shapes/units and a counterexample.
- Implement: reproduce a numerical example and inspect boundaries.
- Investigate: compare one alternative under a matched budget.
02 · Predice y configura
Las notas técnicas, los parámetros y las respuestas están actualmente en inglés.
03 · Analiza la evidencia
Métodos y referencias
Symmetric per-tensor scalar quantizer with range ±(2^(bits−1)−1). This is not LLM.int8(), GPTQ or AWQ. Ideal compression ignores scale metadata and runtime packing. Scalar error does not measure language-model accuracy.
Text / 原始公式
scale=max|x|/(2^(bits−1)−1); q=round(x/scale); x̂=q×scale
Low scalar MSE does not guarantee stable downstream model quality.
LLM.int8() · outliers and mixed precision ↗Preguntas de práctica
quantization-3 / 01What does “Two-bit stress test” test?
Only three signed levels preserve little detail.
Original teaching answer / local derivation. Method reference: LLM.int8() · outliers and mixed precision ↗
Abrir laboratorio →quantization-3 / 02Which computation produces the result in “Two-bit stress test”?
Original teaching answer / local derivation. Method reference: LLM.int8() · outliers and mixed precision ↗
Abrir laboratorio →quantization-3 / 03What is the baseline configuration for “Two-bit stress test”?
{"values":"-1,-0.7,-0.2,0,0.15,0.4,0.8,1","bits":2}
Original teaching answer / local derivation. Method reference: LLM.int8() · outliers and mixed precision ↗
Abrir laboratorio →quantization-3 / 04What numerical result should you check for “Two-bit stress test”?
{"MSE":0.044062500000000004,"Max absolute error":0.4,"Ideal compression vs FP32":16,"Scale":1}
Original teaching answer / local derivation. Method reference: LLM.int8() · outliers and mixed precision ↗
Abrir laboratorio →quantization-3 / 05How would you run a controlled comparison for “Two-bit stress test”?
Keep the supplied fixture and other settings fixed; change bits. Compare reconstruction error, MSE, scale and ideal compression.
Original teaching answer / local derivation. Method reference: LLM.int8() · outliers and mixed precision ↗
Abrir laboratorio →quantization-3 / 06What failure could invalidate a conclusion from “Two-bit stress test”?
Low scalar MSE does not guarantee stable downstream model quality.
Original teaching answer / local derivation. Method reference: LLM.int8() · outliers and mixed precision ↗
Abrir laboratorio →quantization-3 / 07Is “Two-bit stress test” a benchmark of a deployed language model?
No. Symmetric per-tensor scalar quantizer with range ±(2^(bits−1)−1). This is not LLM.int8(), GPTQ or AWQ. Ideal compression ignores scale metadata and runtime packing. Scalar error does not measure language-model accuracy.
Original teaching answer / local derivation. Method reference: LLM.int8() · outliers and mixed precision ↗
Abrir laboratorio →quantization-3 / 08Which evidence should you report for “Two-bit stress test”?
Compare reconstruction error, MSE, scale and ideal compression. Export inputs, engine, result and method; distinguish synthetic fixtures from observed production data.
Original teaching answer / local derivation. Method reference: LLM.int8() · outliers and mixed precision ↗
Abrir laboratorio →quantization-3 / 09How can another researcher reproduce “Two-bit stress test”?
Open quantization-3, reset the preset, retain the exact inputs and run. The calculation is deterministic for identical inputs.
Original teaching answer / local derivation. Method reference: LLM.int8() · outliers and mixed precision ↗
Abrir laboratorio →quantization-3 / 10What is the next validation step after “Two-bit stress test”?
Low scalar MSE does not guarantee stable downstream model quality. Test the hypothesis on a representative held-out workload and document a baseline, success metric and stopping rule before claiming deployment readiness.
Original teaching answer / local derivation. Method reference: LLM.int8() · outliers and mixed precision ↗
Abrir laboratorio →Assumptions, implementation & acceptance
This is symmetric per-tensor rounding; metadata is excluded from ideal compression. All-zero tensors use a safe scale of 1. Do not interpret scalar reconstruction MSE as LLM quality.
Engine formulas, scenario presets and numerical safeguards reviewed. Seeded synthetic inputs are not a production benchmark.
Before running: predict a boundary case
Only three signed levels preserve little detail.
Hint: isolate the assumption
Keep the baseline input fixed, change one parameter or boundary, and compare both the numerical result and the claimed units. A passing example verifies this fixture only.
Minimal executable example
Save the example and linked modules in one folder. Use Node.js 22 or newer, then run node quantization-3.mjs. No third-party runtime dependencies.
import {calculate,network} from './academy-core.mjs';
const params={
"values": "-1,-0.7,-0.2,0,0.15,0.4,0.8,1",
"bits": 2
};
const result=calculate('quantization',params);
console.log(result.metrics);Test and transfer
Only three signed levels preserve little detail.
Record input, code version, expected result and observed result in the notebook below. Then construct a counterexample that violates the assumption above and explain why the original conclusion no longer follows.
Download complete kit (.tar.gz) · Complete reference kit and regression checksPredict, test and keep evidence
Before revealing an answer, predict one result. After the exercise, record the discrepancy and a transfer test. Saved locally across language editions.
Open notebook / export / clear →The mathematical review scope is recorded per lesson. It does not establish empirical paper reproduction; report suspected errors in your notes. Review scope