Live data from Hacker News

Show HN: A fast HNSW implementation in Rust

github.com

21–30 of 30 posts

Re: Show HN: A fast HNSW implementation in Rust

#22
Since this doesn't have documentation yet I piped the code through Claude 3 Opus and asked it to write some.

https://gist.github.com/simonw/9ff9a0ab8ab64e8aa8d160c4294c0...

You don't have a license on the code yet (weirdly Claude hallucinated MIT).

Notes on how I generated this in the comments on that Gist.

Re: Show HN: A fast HNSW implementation in Rust

#23
This is in pretty early stages. Might consider instant-distance which I wrote a few years ago and which is in production use at instantdomainsearch.com:

https://github.com/instant-labs/instant-distance

There are Python bindings, too:

https://pypi.org/project/instant-distance/

Re: Show HN: A fast HNSW implementation in Rust

#24
post #22

Since this doesn't have documentation yet I piped the code through Claude 3 Opus and asked it to write some. https://gist.github.com/simonw/9ff9a0ab8ab64e8aa8d160c4294c0... You don't have a license on the code yet (weirdly Claude hallucinated MIT). Notes on how I generated this in the comments on that Gist.

Thanks for the notes, I thought it would be a more detailed prompt :) Any reason why you choose Opus instead of other LLMs, was it because of the 200k context window?

Re: Show HN: A fast HNSW implementation in Rust

#25
post #24
post #22

Since this doesn't have documentation yet I piped the code through Claude 3 Opus and asked it to write some. https://gist.github.com/simonw/9ff9a0ab8ab64e8aa8d160c4294c0... You don't have a license on the code yet (weirdly Claude hallucinated MIT). Notes on how I generated this in the comments on that Gist.

Thanks for the notes, I thought it would be a more detailed prompt :) Any reason why you choose Opus instead of other LLMs, was it because of the 200k context window?

I'm defaulting to Opus at the moment partly because it's brand new and so I need to spend time with it to get a feel for it - but also because so far it seems to be better than GPT-4 for code stuff. I've had a bunch of examples of it writing mistake-free code that GPT-4 had generated with small bugs in.

Re: Show HN: A fast HNSW implementation in Rust

#27
post #22

Since this doesn't have documentation yet I piped the code through Claude 3 Opus and asked it to write some. https://gist.github.com/simonw/9ff9a0ab8ab64e8aa8d160c4294c0... You don't have a license on the code yet (weirdly Claude hallucinated MIT). Notes on how I generated this in the comments on that Gist.

Do you think it's possible to play a game of 20 questions and go from not knowing what HNSW is and in what context it is used, to become a sophisticated user of any library that implements this?

Re: Show HN: A fast HNSW implementation in Rust

#28
post #22

Since this doesn't have documentation yet I piped the code through Claude 3 Opus and asked it to write some. https://gist.github.com/simonw/9ff9a0ab8ab64e8aa8d160c4294c0... You don't have a license on the code yet (weirdly Claude hallucinated MIT). Notes on how I generated this in the comments on that Gist.

What was the total token count? The output is impressive (if accurate). I'm also curious if doing things like omitting function bodies would alter the output (obvious makes the process cheaper and would enable larger projects, but may lead to worse analyses).

Re: Show HN: A fast HNSW implementation in Rust

#29
post #3

Hello, I have a few questions: - how much time to insert 15 millions of vectors of 768 f32? - how much RAM needed for this operation? - if inserting another vector, how incremental is the insertion? Is it faster than reindexing the 15M + 1 vectors from scratch? - does the structure need to stay in RAM or can it be efficiently queried from a serialized représentation? - how fast is the search in the 15M vectors on ave…

I can answer how it would be in Qdrant if interested. The index will take around 70GB RAM. New vectors are first placed in a non-indexed segment and are immediately available for search while the index is being built. The vectors and the index can be offloaded to disk. Search will take some milliseconds.

Re: Show HN: A fast HNSW implementation in Rust

#30
post #22

Since this doesn't have documentation yet I piped the code through Claude 3 Opus and asked it to write some. https://gist.github.com/simonw/9ff9a0ab8ab64e8aa8d160c4294c0... You don't have a license on the code yet (weirdly Claude hallucinated MIT). Notes on how I generated this in the comments on that Gist.

What was the total token count? The output is impressive (if accurate). I'm also curious if doing things like omitting function bodies would alter the output (obvious makes the process cheaper and would enable larger projects, but may lead to worse analyses).

From the Anthropic logs looks like 1827 input tokens and 1038 output tokens.

I'm still on the free trial API plan, but at Opus price of $15 per million input tokens and $75 per million output tokens that comes to about 10.5 cents.

Post reply on HN