Re:Show HN: Repo2vec – an open-source library for chatting w...
by zaptrem on Wednesday August 28, 2024 @09:31PM
(#41386338)
We have LLMs with hundreds of thousands of tokens context windows and prompt caching that makes using them affordable. Why don’t we just stuff the whole code base in the context window?
[ Parent
| on HN ]
Re:Show HN: Repo2vec – an open-source library for chatting w...
by nutellalover on Wednesday August 28, 2024 @09:38PM
(#41386379)
The truth is we started there. But for any reasonably-sized, complex codebase this just isn't going to work as the context window isn't sufficient and moreover it becomes harder for the LLM to reason over arbitrary parts of the context.
For the time being, indexing and retrieving a good collection of 10-20 code chunks is more effective/performant in practice.
Re:Show HN: Repo2vec – an open-source library for chatting w...
by CuriousJ on Wednesday August 28, 2024 @10:07PM
(#41386533)
This paper shows that 200-800 is the ideal chunk size; if you go above, the model starts getting confused / distracted. https://arxiv.org/pdf/2406.14497
Re:Show HN: Repo2vec – an open-source library for chatting w...
by zaptrem on Saturday September 07, 2024 @03:04AM
(#41472083)
Makes sense. Thanks!
Re:Show HN: Repo2vec – an open-source library for chatting w...
by siamese_puff on Wednesday August 28, 2024 @09:53PM
(#41386462)
Not an expert, but OP is right and this is generally a known issue with large windows and RAG. Small chunks are usually best. Also how you chunk is important. OP - what’s the most optimal way to parse/chunk code snippets?
Re:Show HN: Repo2vec – an open-source library for chatting w...
by jshobrook on Wednesday August 28, 2024 @10:07PM
(#41386531)
You can use the AST to chunk the code: https://docs.sweep.dev/blogs/chunking-2m-files
Re:Show HN: Repo2vec – an open-source library for chatting w...
by CuriousJ on Wednesday August 28, 2024 @10:09PM
(#41386547)
We're using an improvement over this exact blogpost actually. We started from there, but weren't happy that some of the chunks were really small (and they would undeservedly get surfaced to the top). So we added some extra logic to merge the siblings if they're small.
https://github.com/Storia-AI/repo2vec/blob/1864102949e720320...