Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions _vector-search/optimizing-storage/binary-quantization.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,56 @@ PUT my-vector-index
```
{% include copy-curl.html %}

## Enhancing search quality with ADC and RR
**Introduced 3.2**
{: .label .label-purple }

If your search results have low recall, you can enhance search quality by specifying asymmetric distance computation (ADC) or random rotation (RR) in the index mapping.

ADC maintains a full-precision query vector while rescaling it to have meaningful distance computations against binary-quantized document vectors. This asymmetric approach preserves more information about the query vector, boosting search quality without significant memory penalty. ADC is supported for 1-bit quantization only.

RR addresses the issue of binary quantization giving equal weight to each vector dimension during the quantization process. By rotating the distribution, RR can redistribute variance (information) from high-variance dimensions to low-variance dimensions, preserving more information during the 32x compression process. RR is supported for 1-bit, 2-bit, and 4-bit quantization.

For optimal performance and recall enhancement, use both ADC and RR together:

```json
PUT vector-index
{
"settings" : {
"index": {
"knn": true
}
},
"mappings": {
"properties": {
"vector_field": {
"type": "knn_vector",
"dimension": 8,
"method": {
"name": "hnsw",
"engine": "faiss",
"space_type": "l2",
"parameters": {
"encoder": {
"name": "binary",
"parameters": {
"bits": 1,
"random_rotation": true,
"enable_adc": true
}
}
}
}
}
}
}
}
```
{% include copy-curl.html %}

ADC and RR impact search and indexing performance, so they are disabled by default. ADC may introduce a moderate latency increase because of full-precision distance computations, while RR primarily affects indexing latency because vectors must be rotated during the process.
{: .note}

## Search using binary quantized vectors

You can perform a vector search on your index by providing a vector and specifying the number of nearest neighbors (k) to return:
Expand Down
Loading