Re:Chunking 2M files a day for code search using syntax trees
by kevinlu1248 on Monday July 31, 2023 @08:53PM
(#36950983)
This is interesting, I'm wondering what you mean by AST substitution. Is this like an agent that traverses the tree and picks what to edit? Is this language model based? Also, thankfully we don't support too many uncommon languages. The most recent ones we added support for are embedded templates (ERB/EJS for flask and Ruby) and mustache. Fortunately many uncommon languages are subsets of other languages.
Re:Chunking 2M files a day for code search using syntax trees
by reitzensteinm on Monday July 31, 2023 @08:59PM
(#36951017)
The agent specifies what function, class, method etc to replace, along with its full source. It's more costly, but I believe it leads to fewer hallucinations as it is generating a coherent piece of code.
But it requires parsing AST and language specific instructions. And things like metaprogramming or macros could cause some hairy confusion.
All of these factors don't hurt my use case.
Re:Chunking 2M files a day for code search using syntax trees
by kevinlu1248 on Monday July 31, 2023 @09:18PM
(#36951139)
We have a similar method under the hood, except it's purely text-based search-and-replace. The model decides what to replace. It seems to be consistent and is easy to implement.
Re:Chunking 2M files a day for code search using syntax trees
by reitzensteinm on Monday July 31, 2023 @09:28PM
(#36951205)
My gut feeling based on my experience over the last couple of months is that substitution of an entire function is more reliable than some lines of a function. The surrounding context reduces the chance of hallucinations.
Gut feeling doesn't account for much though - I'm working on an evals system to be able to quantify system performance. It won't be cheap to run.
It could easily be that your method is superior.
Re:Chunking 2M files a day for code search using syntax trees
by kevinlu1248 on Monday July 31, 2023 @10:06PM
(#36951480)
From our experience, single or few line replacements generally fine, since many of the changes are many few-line changes in multiple spots accross multiple files. We also provide surrounding context for the search-and-replace pairs, which helps with the model. Beyond 10 lines and the model also usually add the function headers in there which helps with the code generation.
I'm also curious, how are you guys evaluating the performance of your models?
Re:Chunking 2M files a day for code search using syntax trees
by reitzensteinm on Monday July 31, 2023 @11:30PM
(#36951964)
There's no systematic evaluation yet which is the next step. It's successfully bootstrapping itself which is a fairly high bar, but quantitative performance measurements are getting more and more important as the project progresses.
Re:Chunking 2M files a day for code search using syntax trees
by kevinlu1248 on Tuesday August 01, 2023 @12:18AM
(#36952241)
I feel the same, benchmarking in general is a pain but a good benchmark for us could go a long way.
I'm building a bot that's building itself, so it doesn't have to support large legacy code bases with different languages.