Quantization is a fundamental tool used to compress datasets, neural network weights, and memory usage in a range of computational tasks. Many downstream applications of vector quantization perform inner products with arbitrary inputs. This motivates the study of inner product aware quantization schemes that approximately preserve inner products with unseen vectors -- in contrast to simply minimizing the mean-squared error. In this work, we formulate objectives that capture natural desiderata and develop adaptive and unbiased quantization methods that approximately preserve inner products with worst-case and average-case inputs. An analysis of these objectives shows a tight connection with the well-studied notion of Adaptive Stochastic Quantization (ASQ). We develop provably fast exact and approximate algorithms for our objectives. Our theoretical results inspire efficient practical algorithms that perform well across a variety of workload distributions. They also lead to practical algorithms for standard ASQ which are 2-10$\times$ faster than prior state-of-the-art methods while maintaining quality. These theoretical and empirical results contribute towards making adaptive quantization techniques more efficient and tractable in practical settings.
翻译:量化是一种基本工具,用于在各类计算任务中压缩数据集、神经网络权重和内存占用。许多向量量化的下游应用需对任意输入执行内积运算。这促使我们研究内积感知量化方案——与单纯最小化均方误差不同,该类方案能近似保留与未见向量的内积。本文提出了捕捉自然需求的目标函数,并开发了自适应且无偏的量化方法,能在最坏情况和平均情况下近似保留输入内积。对这些目标函数的分析揭示了其与广为人知的自适应随机量化(ASQ)概念间的紧密联系。我们针对这些目标开发了可证明快速的确切算法和近似算法。理论成果催生了高效实用算法,能在多种负载分布下表现优异,同时为标准ASQ设计了实用算法——其运行速度比现有最优方法快2-10倍,且保持同等质量。这些理论与实验成果有助于提升自适应量化技术在实际场景中的效率与可操作性。