diff --git a/docs/knn/approximate-knn.md b/docs/knn/approximate-knn.md
index afd066cb..bcd0c49c 100644
--- a/docs/knn/approximate-knn.md
+++ b/docs/knn/approximate-knn.md
@@ -176,7 +176,7 @@ A space corresponds to the function used to measure the distance between two poi
innerproduct |
- \[ Distance(X, Y) = {A · B} \] |
+ \[ Distance(X, Y) = - {A · B} \] |
if (Distance Function >= 0) 1 / (1 + Distance Function) else -Distance Function + 1 |
diff --git a/docs/knn/knn-score-script.md b/docs/knn/knn-score-script.md
index d4c1ba55..448ca565 100644
--- a/docs/knn/knn-score-script.md
+++ b/docs/knn/knn-score-script.md
@@ -312,8 +312,8 @@ A space corresponds to the function used to measure the distance between two poi
innerproduct |
- \[ Distance(X, Y) = \sum_{i=1}^n (X_i - Y_i) \] |
- 1 / (1 + Distance Function) |
+ \[ Distance(X, Y) = -{A · B} \] |
+ if (Distance Function >= 0) 1 / (1 + Distance Function) else -Distance Function + 1 |
hammingbit |