Token LabSearch

← All experiments
Quantization & outliers / 5 OF 5

All-zero tensor

The zero-range safeguard reconstructs all zeros exactly.

Local calculation / simulation

Local educational experiment. No external API calls. Synthetic fixtures are not production measurements.

Study guide & lesson outlineLEARNING CONTRACT

Understand → implement → investigate

Goal: explain the mechanism in this lesson, reproduce one example and test a failure case. Reading alone does not mark mastery.

02 · Predict & configure

Technical scenario notes, parameter names and reference answers are currently in English.

03 · Inspect the evidence

Run this experiment to see results.

Methods & references

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 ↗

Practice questions

quantization-5 / 01What does “All-zero tensor” test?

The zero-range safeguard reconstructs all zeros exactly.

Original teaching answer / local derivation. Method reference: LLM.int8() · outliers and mixed precision ↗

Open lab →
quantization-5 / 02Which computation produces the result in “All-zero tensor”?

; ; ×scale

Original teaching answer / local derivation. Method reference: LLM.int8() · outliers and mixed precision ↗

Open lab →
quantization-5 / 03What is the baseline configuration for “All-zero tensor”?

{"values":"0,0,0,0","bits":4}

Original teaching answer / local derivation. Method reference: LLM.int8() · outliers and mixed precision ↗

Open lab →
quantization-5 / 04What numerical result should you check for “All-zero tensor”?

{"MSE":0,"Max absolute error":0,"Ideal compression vs FP32":8,"Scale":1}

Original teaching answer / local derivation. Method reference: LLM.int8() · outliers and mixed precision ↗

Open lab →
quantization-5 / 05How would you run a controlled comparison for “All-zero tensor”?

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 ↗

Open lab →
quantization-5 / 06What failure could invalidate a conclusion from “All-zero tensor”?

Low scalar MSE does not guarantee stable downstream model quality.

Original teaching answer / local derivation. Method reference: LLM.int8() · outliers and mixed precision ↗

Open lab →
quantization-5 / 07Is “All-zero tensor” 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 ↗

Open lab →
quantization-5 / 08Which evidence should you report for “All-zero tensor”?

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 ↗

Open lab →
quantization-5 / 09How can another researcher reproduce “All-zero tensor”?

Open quantization-5, 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 ↗

Open lab →
quantization-5 / 10What is the next validation step after “All-zero tensor”?

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 ↗

Open lab →
MATHEMATICAL REVIEW · 2026-10-26

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.

Finite tensor values → Scale = max magnitude / qmax → Round and clamp integers → Dequantize → reconstruction error
Mechanism map: follow the transformations from top to bottom.

Before running: predict a boundary case

The zero-range safeguard reconstructs all zeros exactly.

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-5.mjs. No third-party runtime dependencies.

import {calculate,network} from './academy-core.mjs';
const params={
  "values": "0,0,0,0",
  "bits": 4
};
const result=calculate('quantization',params);
console.log(result.metrics);

Test and transfer

The zero-range safeguard reconstructs all zeros exactly.

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 checks

Predict, 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