Back when Cohere originally released their v3 model, one of the interesting steps they took for relevance was reranking the top-N vectors by doing a dot-product between the float[] and the bit[] vectors. Effectively summing all the non-zero indices, allowing for the higher-fidelity of the query vector to provide better scoring.
We should dig a little bit to see if this is worth it with our own benchmarking with CohereV3 and see if there are any other models would benefit from this.
Scripting method definition changes to allow float & byte to be dot-product values to bit vector types
Panama Vector SIMD work so that the functions are not dog slow (using the bits as a bit-mask and then summing the lanes)
What's interesting is that we might want to allow dot-product between all our various element_type's in scripts. The tricky part is ensuring we always pick the right type.
Description
Back when Cohere originally released their v3 model, one of the interesting steps they took for relevance was reranking the top-N vectors by doing a dot-product between the
float[]
and thebit[]
vectors. Effectively summing all the non-zero indices, allowing for the higher-fidelity of the query vector to provide better scoring.We should dig a little bit to see if this is worth it with our own benchmarking with CohereV3 and see if there are any other models would benefit from this.
The work likely required are:
bit
vector typesWhat's interesting is that we might want to allow dot-product between all our various element_type's in scripts. The tricky part is ensuring we always pick the right type.