Back to AI Engineering Mind Map
中文·English
🤖 AI EngineeringID: scalar-quantization-sq8

Scalar Quantization (SQ8/SQ4)

SQ8/SQ4 标量量化
🎯Core Definition
Scalar Quantization (SQ) is a vector compression technique that independently maps each component of a high-dimensional vector to discrete fixed-point integers; SQ8 linearly projects 32-bit floating point (FP32) values across dimension ranges [mind,maxd][min_d, max_d] into 8-bit unsigned integers (uint8) via q=round(255xminmaxmin)q = \text{round}\left(255 \cdot \frac{x - \min}{\max - \min}\right), while SQ4 compresses down to 4-bit nibbles, achieving 4x to 8x memory reduction.
💡Use Cases
Building massive vector indices (tens of millions to billions of vectors) under memory constraints in vector databases, serving as raw vector caching or coarse pruning for HNSW.
Key Problems Solved
100M 1536-dimensional FP32 vectors require 614GB RAM for raw storage, exceeding single-node capacity; SQ8 compresses this to ~153GB and leverages AVX-512 / VNNI integer SIMD instructions for blazing fast distance calculation while maintaining 98%+ Recall@10.
🎯5 High-Frequency Exam Points
1
Derive the SQ8 linear quantization and de-quantization formulas and source of precision loss?
2
What is the Recall difference between Global SQ and Per-Dimension SQ under heavy-tailed distribution?
3
How do modern CPU AVX-512 VNNI instructions accelerate int8 dot product operations?
4
Compare SQ8 vs PQ in terms of memory compression ratio, index construction time, and reconstruction error?
5
Why does SQ8 recall rate improve after applying outlier clipping / percentile thresholding?
Updated 2026-08-14
🎯
Test Your Knowledge: Practice Questions for "Scalar Quantization (SQ8/SQ4)"
Single choice pitfall questions with instant feedback and mistake tracking.
🚀 Start Card Practice
Previous CardVector Distance Metrics & L2 NormalizationNext CardProduct Quantization (PQ)

🔗 More AI Engineering Knowledge Cards

ADC Asymmetric Distance ComputationIVF Inverted File IndexingHNSW Multi-Layer Skip GraphHNSW Heuristic Search & Routing