Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More efficient embedding lookup #45

Open
siddhartha-gadgil opened this issue Oct 20, 2024 · 2 comments
Open

More efficient embedding lookup #45

siddhartha-gadgil opened this issue Oct 20, 2024 · 2 comments

Comments

@siddhartha-gadgil
Copy link
Owner

Since it looks like embeddings will be used for a while, it is worth optimizing the search for nearest embeddings to some extent. There is partially written code to cluster embeddings and using a priori bounds find candidate clusters and then search within a cluster (in principle with iterated nesting).

@siddhartha-gadgil
Copy link
Owner Author

The code is in EpsilonClusters.lean.

@siddhartha-gadgil
Copy link
Owner Author

  • The commit 4bd2cd1 has (slightly more than) doubled the speed. So now it takes less than 0.3 seconds for each form of embedding.
  • Further, if one restricts to dimension 256, then the time is less than 0.12 seconds.
  • So we will not try clustering.
  • Instead on switching to newer (Matryoshka) embeddings we can try both simply taking fewer dimensions and two rounds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant