Scalar + HNSW in the optional project

Hi, it seems to me the idea in the optional project is different from what Kacper said in the videos.

The project asked us to implement Scalar + HNSW without mentioning something like MUVERA to reduce the embeddings to one vector per document, but Kacper reiterated in the videos that HNSW doesn’t work with multi-vector and that’s why he keeps hnsw_config=models.HnswConfigDiff(m=0) in the code.

Maybe I miss something here?

1 Like

Hi Pang.luo, Qdrant team member here.

No contradiction, you’re not missing anything.

Kacper’s right: HNSW can’t build a search graph directly on multi-vectors because MaxSim isn’t symmetric. That’s why m=0 is used. With m=0, it’s just an exact brute-force scan.

The project lists optional improvements, not things you have to combine. Scalar quantization simply makes that brute-force scan smaller and faster. It doesn’t make HNSW work on multi-vectors.

If you want actual HNSW graph search, that’s what MUVERA is for. It compresses each document into a single vector HNSW can index, then reranks the results with MaxSim.

So m=0 + scalar quantization is a valid setup. It’s just brute-force, not HNSW graph search.

Let me know if you have any other questions. :slight_smile:

2 Likes

That makes sense. Thank you for the reply Dylan.

1 Like