zvec icon indicating copy to clipboard operation
zvec copied to clipboard

rotate: add an optional random rotation feature in INT8 quantization method

Open zzlin237 opened this issue 5 months ago • 2 comments

New Feature: Added an optional rotation parameter to INT8 quantization, now supporting HNSW, Flat, IVF, and Vamana indexes. Background: The quantization error in INT8 is directly proportional to the data range (max - min). By applying a random rotation, we can distribute the variance evenly across all vector dimensions. This helps reduce the overall range in certain cases, thereby improving INT8 quantization accuracy. Benefits: Recall is improved while maintaining the same QPS. Using the cohere-1m dataset as an example:

  1. HNSW: QPS [14,431], Recall [0.9285] -> QPS [14,452], Recall [0.9397] (m=15, ef_construction=180, ef=180)
  2. Flat: Recall [0.9695] -> Recall [0.9881]
  3. Vamana: Recall [0.9576] -> Recall [0.9734]

Known Issues: We encountered issues during IVF testing and discovered pre-existing bugs in the IVF index:

  1. The nprobe parameter at the Python layer is currently ineffective; the index defaults to a fixed scan_ratio=0.1.
  2. When combining IVF with INT8, most points are assigned to a very small number of clusters (e.g., 70% of the data falls into a single cluster), which significantly degrades overall performance.

zzlin237 avatar Jun 09 '26 13:06 zzlin237

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jun 09 '26 13:06 CLAassistant

  1. pr title需要能够说明这个pr的作用和目的;2. description里面需要注明一些背景、问题、收益等信息

feihongxu0824 avatar Jun 10 '26 02:06 feihongxu0824