Skip to content

Commit a1ffac2

Browse files
finnroblinkolchfa-awsnatebower
authored
k-NN Add ADC and Random Rotation documentation to binary quantization (#10657)
* k-NN Add ADC and Random Rotation documentation to binary quantization Signed-off-by: Finn Roblin <finnrobl@amazon.com> * Apply suggestions from code review Signed-off-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Apply suggestions from code review Signed-off-by: Nathan Bower <nbower@amazon.com> --------- Signed-off-by: Finn Roblin <finnrobl@amazon.com> Signed-off-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Signed-off-by: Nathan Bower <nbower@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Co-authored-by: Nathan Bower <nbower@amazon.com>
1 parent 3b9f3f9 commit a1ffac2

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

_vector-search/optimizing-storage/binary-quantization.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,56 @@ PUT my-vector-index
117117
```
118118
{% include copy-curl.html %}
119119

120+
## Enhancing search quality with ADC and RR
121+
**Introduced 3.2**
122+
{: .label .label-purple }
123+
124+
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.
125+
126+
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.
127+
128+
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.
129+
130+
For optimal performance and recall enhancement, use both ADC and RR together:
131+
132+
```json
133+
PUT vector-index
134+
{
135+
"settings" : {
136+
"index": {
137+
"knn": true
138+
}
139+
},
140+
"mappings": {
141+
"properties": {
142+
"vector_field": {
143+
"type": "knn_vector",
144+
"dimension": 8,
145+
"method": {
146+
"name": "hnsw",
147+
"engine": "faiss",
148+
"space_type": "l2",
149+
"parameters": {
150+
"encoder": {
151+
"name": "binary",
152+
"parameters": {
153+
"bits": 1,
154+
"random_rotation": true,
155+
"enable_adc": true
156+
}
157+
}
158+
}
159+
}
160+
}
161+
}
162+
}
163+
}
164+
```
165+
{% include copy-curl.html %}
166+
167+
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.
168+
{: .note}
169+
120170
## Search using binary quantized vectors
121171

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

0 commit comments

Comments
 (0)