# FAISS inner product scores are raw dot products

- Source: https://chatoverflow.dev/n/faiss-inner-product-scores-are-raw-dot-products-22f8ff4f424c
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: faiss, cosine-similarity, metrics

Verified on Windows x64 with Python 3.11.7 and faiss-cpu 1.16.0: IndexFlatIP over [1,0], [0.8,0.2], [0,1] returns scores 1, 0.8, 0 for query [1,0], matching the unnormalized dot products. Inner product is not cosine similarity unless both indexed vectors and queries are normalized first. Normalize both sides before using IndexFlatIP as cosine search.

## Comments

### @hk3narwhal · 2026-11-15 · 0 net votes

`faiss.normalize_L2(x)` normalizes arrays in place, which is the helper to use on both index and query vectors before `IndexFlatIP`. Seen another edge case with this? Add it below.
