← Back to AI Engineering Mind Map
🤖 AI EngineeringID: product-quantization-pq

Product Quantization (PQ)

PQ 乘积量化与码本聚类
🎯Core Definition
Product Quantization (PQ) is a lossy vector compression algorithm based on orthogonal subspace decomposition; it divides a DD-dimensional space into MM orthogonal lower-dimensional subspaces (d∗=D/Md^* = D/M), runs K-Means clustering independently in each subspace to produce K=256K=256 centroids as a Codebook, and encodes each sub-vector into an 8-bit centroid index (1 Byte), compressing the entire vector into just MM bytes.
💡Use Cases
Core indexing and storage compression for 100M to billion-scale vector retrieval systems, notably in Faiss IVF-PQ, Milvus, and DiskANN.
⚡Key Problems Solved
Conventional scalar quantization tops out at 4x~8x compression; PQ leverages joint subspace clustering to compress a 1536-dim FP32 vector (6144 bytes) down to M=64M=64 bytes (96x reduction), making billion-scale vector ANN search feasible on a single machine.
🎯Core Interview Exam Points
Fundamentals · Production Scenarios · Deep Dive
Core Def
Explain the core definition, underlying mechanism/math, and key principles of Product Quantization (PQ).
Use Cases
In production engineering, what are the primary use cases for Product Quantization (PQ) and what core pain points does it solve?
🔥 High-Frequency Deep-Dive Questions
1
Derive how PQ parameters (MM subspaces, KK centroid counts) dictate compression ratio and reconstruction error?
2
Why does applying OPQ (Optimized Product Quantization) orthogonal rotation before PQ significantly reduce quantization error?
3
For a 1024-dim FP32 vector with M=32,K=256M=32, K=256, what is the compressed size in bytes and theoretical compression ratio?
4
Compare Symmetric Distance Computation (SDC) vs Asymmetric Distance Computation (ADC) in PQ precision and compute cost?
5
How does Residual Vector Quantization (RVQ) perform multi-stage cascaded quantization to improve recall over standard PQ?
Updated 2026-08-14
🎯
Verify Mastery: Practice Exam Questions for "Product Quantization (PQ)"
Take pitfall multiple-choice questions with derivation options; mistakes are automatically logged.
🚀 Start Card Practice ➔
← Previous CardScalar Quantization (SQ8/SQ4)Next Card →ADC Asymmetric Distance Computation

🔗 More AI Engineering Knowledge Cards

引用出处: TalentMe 450+ 工业级 AI 架构考点知识库 (Tech Vault) · 遵循 CC-BY-4.0 知识共享协议
URL: https://talentme.airsota.com/resources/tech/roadmap/mindmap/AI_Engineering/card/product-quantization-pq
中文速览与面试要点

PQ 乘积量化与码本聚类 (Product Quantization (PQ))

定义: 乘积量化 (Product Quantization, PQ) 是一种基于正交子空间划分的有损向量压缩算法;它将 D 维向量空间切分为 M 个相互正交的低维子空间(每段维度 d^* = D/M),在每个子空间内独立运行 K-Means 聚类生成 K=256 个质心并构建局部码本 (Codebook);原始向量各段被替换为其最邻近质心的 8 位索引 (1 Byte),从而将 D 维向量紧凑压缩为仅 M 字节的代码。 使用场景: 亿级至十亿级超大规模向量检索系统的核心存储与预过滤,如 Faiss IVF-PQ、Milvus/DiskANN 的内存与磁盘索引压缩。 解决的问题: 传统标量量化压缩比极限通常为 4x~8x;PQ 通过子空间联合分布聚类,可将 1536 维 FP32 向量(6144 字节)压缩至 M=64 字节,实现高达 96x 的显存/内存压缩,使十亿规模向量检索在单机内存中运行成为可能。

核心要点

  • 详细推导 PQ 乘积量化的参数选择(M 子空间数、K 码本聚类中心数)对压缩比与重建误差的影响?
  • 为什么在 PQ 训练前对向量进行 OPQ (Optimized Product Quantization) 正交旋转可以大幅减少量化误差?
  • 1024 维 FP32 向量在 M=32, K=256 设置下,单条向量被压缩为多少字节?理论内存压缩比是多少?
  • 比较对称距离计算 (SDC) 与非对称距离计算 (ADC) 在 PQ 检索中的距离精度与计算开销差异?
  • 残差量化 (Residual Vector Quantization, RVQ) 是如何在 PQ 基础上进行多级级联量化以提升召回率的?