java-client icon indicating copy to clipboard operation
java-client copied to clipboard

Vector value seem rounded

Open tenpigs267 opened this issue 2 years ago • 3 comments

Hello, I'm currently trying to add a QDrantEmbeddingStore to Lanchain4J (https://github.com/langchain4j) but I have a problem. IT with testContainer keep failing because some Vector values seem rounded : expected: Embedding { vector = [-0.086097434, 0.033505224, 0.017902793, ... but was: Embedding { vector = [-0.08609743, 0.03350522, 0.017902792, ...

I don't know if it can be related to quantization, I did'nt enable quantization (but maybe it is enabled by default) If anyone have a hint that would be appreciated. Thanks

tenpigs267 avatar Jan 21 '24 21:01 tenpigs267

Hi @tenpigs267. I too ran into a similar issue when implementing https://github.com/langchain4j/langchain4j/pull/542. Not on my machine, but the reviewer's. Not quite sure why something like this would happen, that too inconsitently.

Anush008 avatar Jan 29 '24 01:01 Anush008

Hi @Anush008, I thought that it was related to quantization (as stated here, quantization can lead to a loss of precision https://qdrant.tech/articles/scalar-quantization/). But if you say that this problem doesn't show up on your machine it is weirder... maybe more related to rounding (a different FPU?). For history my PC is a i7-13620H with 16Gb of RAM

tenpigs267 avatar Jan 30 '24 14:01 tenpigs267

Hey @tenpigs267. Nice to meet you. To make it weirder, refer to this comment.

https://github.com/langchain4j/langchain4j/pull/542#issuecomment-1910640906

Anush008 avatar Jan 30 '24 15:01 Anush008

Closing for the time being since we haven't been able to reproduce this.

Feel free to re-open if needed.

Anush008 avatar May 19 '24 04:05 Anush008