-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Add Line numbers #348
Add Line numbers #348
Conversation
706451d
to
296b615
Compare
296b615
to
33d092c
Compare
Thanks for suggesting these changes. Have you run the full benchmark suite against this prompting? Can you share the detailed results? I have extensively explored this concept in the past, and found line numbers were not helpful to overall code editing success. I seemed to find they actually worsened performance. But perhaps you're seeing something different in the benchmarks? |
I run the full suit only with gpt-4-turbo. With line numbers:
Community:
Results are not too reproducible - when I run the community version a second time I got 48% and 58%, but I chose to use the ones consistent with your measurments. I performed some ablation study. Some of my performance boost comes from this trick: I changed the example SEARCH/REPLACE block,
Note about user experiance: |
I didn't keep the files from the ablation study benchmarking, when I used benchmarking for the first time I wasn't organized enough and I tested uncommited changes. I will re-run it to be sure. I will also take a look on previous implementation to have better context of what I am doing. Do you have old benchmarking of line numbers documented somewhere? |
The implementation is different
|
(would be great if could be turned on/off not only via ENVIRONMENT variable (and eventually flag) , but also during REPL (e.g. |
An update about this feature: I want to write a new benchmark, relevant to some problems I saw with this feature, to re-write some logic (searching for lines to replace) and to separate it as a third coder. I hope to find the time for it in the next few days. |
To my understanding how LLMs work (and my experience from [inference on graph algorithms] ), providing all line numbers , I can see how could become unnecessary obstructing noise to signal ration of piles of transformers , specifically distracting certain attention heads ... Maybe encoding line numbers in another way for specific languages could be more efficient (e.g. add as comment at ends of some important lines like , end of first line starting new function? ( |
Thanks for taking the time to experiment with new edit formats and share your results. I've also experimented with line numbers for code editing quite a bit. All the benchmarking I've done convinces me that it's worse to ask GPT to use line numbers. I'm going to close this PR as I'm not likely to add line number support at this time. |
I this pair of patches, I added line numbers both to files and to code in the prompt.
When creating SEARCH/REPLACE blocks aider write code with line numbers as well, and I chanegd the parser to handle it. When parsing I ignore the numbers and use existing SEARCH/REPLACE.
When benchmarking, it gives a small positive performance difference, and additional small improvement in the cases of "Malformed response".
This change allow me to tell aider things like this.
I am writing a vscode extension that will be able to perform this kind of commands, soon I will make it public and open source.