Is it possible for the ANN indexing and MaxSim's error to be nearly zero in this case?

Your reasoning is essentially correct, with one important nuance. In an ideal scenario, if the ANN (e.g., a PQ-based index) always returns exactly the same maximum candidate for each query vector as the exact (native) method, then the aggregated score:

maxsim(q,x)=maxisim(qi,xi)

would be identical to the exact calculation. In other words, if for every query vector q, the index always finds the true xi such that:

xi=argmaxxisim(qi,xi)

then no error is introduced.

However, there are a few points to consider:

1. Quantization Error

ANN methods like PQ work by quantizing the vectors into subspaces. Within each subspace, the vector is approximated by a centroid. Even if the best candidate is selected, the cosine similarity is computed using the quantized (approximate) representation:

sim(qm,xm)sim(qm,cm)+em

where em is the error due to quantization. If the quantization is very fine (i.e., if the codebooks are well-trained and the subspaces capture the data accurately), then em may be very small. In that case, the error in the final aggregated maxsim score:

maxsim(q,x)maxi(sim(qi,ci)+ei)

will be nearly zero.

2. Max Operation Robustness

The max operator tends to be robust because it ignores non-maximal candidates. Even if there is some error in many of the approximated cosine similarities, as long as the ANN method reliably identifies the true maximum for each query vector, the aggregation remains accurate.

3. Practical Considerations

In practice, ANN search systems rarely achieve 100% recall, meaning that in some cases, the true maximum candidate might not be retrieved. However, modern ANN methods are often tuned to achieve very high recall, especially for moderate dataset sizes or when the data distribution is favorable. When recall is near perfect, the error due to approximation is minimal—often much lower than the errors seen in less targeted or coarser approximations of standard cosine similarity search.

Conclusion

If your ANN indexing method (e.g., using PQ) almost always returns the exact maximum candidate for each query vector, then the aggregated maxsim score will be very close to the native (exact) score. In this scenario, the error introduced by the approximation is nearly zero—especially when compared to methods that do not use the max operation or when the ANN method has lower recall.

So your statement is correct in spirit: because maxsim only considers the maximum per query vector, a highly accurate ANN method can yield a final score that is almost as accurate as the native computation, while still benefiting from the speedup of approximate search.