News for hackers. Stuff that matters.
Re:Storing OpenAI embeddings in Postgres with pgvector by anon291 on Tuesday February 07, 2023 @12:16AM (#34689035)
locality sensitive hashing is the typical method here. You generate a ton of random vectors. These vectors automatically give rise to infinite hyperplanes (the one they are normal to). Each vector/hyperplane is associated with a bit in the final hash. Then, each input vector is hashed by setting the bit if it's on one side of the hyperplane or unsetting it if it's on the other. The hamming distance between two vectors is now correlated with the cosine similarity. Or something like that.
Re:Storing OpenAI embeddings in Postgres with pgvector by kekub on Tuesday February 07, 2023 @03:14AM (#34690104)
That's the reason I come to HN every day. Thanks for the explanation, which probably could not be more compact.
Re:Storing OpenAI embeddings in Postgres with pgvector by justjonathan on Tuesday February 07, 2023 @03:01PM (#34698569)
That’s so smart! I read stuff like that and I’m just in awe of the cleverness.