by anotherpaulg · 2y ago · 0 comments
1. Yes, GPT-4 Turbo is quantitatively getting lazier at coding. I benchmarked the last 2 updates to GPT-4 Turbo, and it got lazier each time.
2. For coding, asking GPT-4 Turbo to emit code changes as unified diffs causes a 3X reduction in lazy coding.
Here are some articles that discuss these topics in much more detail.
- System prompt 1: https://sharegpt.com/c/osmngsQ
- System prompt 2: https://sharegpt.com/c/9jAIqHM
- System prompt 3: https://sharegpt.com/c/cTIqAil Note: I had to nudge ChatGPT on this one.
All of this is anecdotal, but perhaps this style of prompting would be useful to benchmark.
As a side note, i wrote a very simple small program to analyze Rust syntax, and single out functions and methods using the syn crate [1]. My purpose was exactly to make it ignore lazy-coded functions.
Your link appears to be ~100 lines of code that use rust's syntax parser to search rust source code for a function with a given name and count the number of AST tokens it contains.
Your intuitions are correct, there are lots of ways that an AST can be useful for an AI coding tool. Aider makes extensive use of tree-sitter, in order to parse the ASTs of a ~dozen different languages [0].
But an AST parser seems unlikely to solve the problem of GPT being lazy and not writing the code you need.
The tool needs a way to guide it to be more effective. It is not exactly trivial to get good results. I have been using GPT for 3.5 years and the problem you describe never happens to me. I could share with you just from last week, 500 to 1000 prompts i used to generate code, but the prompts i used to write the replacefn, can be found here [1]. Maybe there are some tips that could help.
[1] https://chat.openai.com/share/e0d2ab50-6a6b-4ee9-963a-066e18...
// Handle struct-specific logic here
// Add more details about the struct if needed
// Handle other item types if needed
...etc...
It took >200 back-and-forth messages with ChatGPT to get it to ultimately write 84 lines of code? Sounds lazy to me.However for now, I have not run re-tests for every new version. I guess I know what I will be doing today.
This is an area I have spend a lot of time working on, would love to compare notes.
Longer answer:
I found that I could provoke lazy coding by giving GPT-4 Turbo refactoring tasks, where I ask it to refactor a large method out of a large class. I analyzed 9 popular open source python repos and found 89 such methods that were conceptually easy to refactor, and built them into a benchmark [0].
GPT succeeds on this task if it can remove the method from its original class and add it to the top level of the file with appropriate changes to the size of the abstract syntax tree. By checking that the size of the AST hasn't changed much, we can infer that GPT didn't replace a bunch of code with a comment like "... insert original method here...". The benchmark also gathers other laziness metrics like counting the number of new comments that contain "...". These metrics correlate well with the AST size tests.
This, and people generally saying that chatGPT has been intentionally degraded, are just super strange for me. I believe it’s happening but it’s making me question my sanity. What am I doing to get decent outputs? Am I simply not as picky? I treat every conversion as though it needs to be vetted because it does regardless of how good the model is. I only trust output from the model that I am a subject matter expert on or in a closely adjacent field. Otherwise I treat it much like an internet comment - useful for surfacing curiosities but requires vetting.
If we were all flipping coins there would be people claiming that coins only come up tails. There would be nothing they were doing though to make the coin come up tails. That is just the streak they had.
Some days I get lucky with chatGPT4 and some days I don't.
It is also ridiculous how we talk about this as if all subjects and context presented to chatGPT4 are going to be uniform in output. One word difference in your own prompt might change things completely while trying to accomplish exactly the same thing. Now scale that to all the people talking about chatGPT with everyone using it for something different.
Why this instead of GPT-4 through the web app? And how do you actually use it for coding, do you copy and paste your question into a python script, which then calls the OpenAI API and spits out the response?
Any advice appreciated!
Yes, along with what you want it to do.
> I also pay for github copilot, but not GPT-4. Can I use copilot for this?
Not that I know of. CoPilot is good at generating new code but can't change existing code.
"// ... the rest of your code goes here"
in it's responses, rather than writing it all out.
Claude is doing much better in this area, local/open LLMs are getting quite good, it feels like OpenAI is not heading in a good direction here, and I hope they course correct.
I hope some people remember and document details of this era, future generations may be so impressed with future reality that they may not even think to question it's fidelity, if that concept even exists in the future.
nowadays the autogpt gives up sooner, seems less competent, and doesnt even come close to solving the same problems
EDIT: This of course applies only if you’re using the UI. Using the API is the same.
public someComplexLogic() { // Complex logic goes here }
or another example when the code is long (ex: asking it to create a vue component) is that it will just add a comment saying the rest of the code goes here.
So you could test for it by asking it to create long/complex code and then running the output against unit tests that you created.
- Can you do XXX (something complex) ?
- Yes of course, to do XXX, you need to implement XXX, and then you are good, here is how you can do:
int main(int argc, char **argv) {
/* add your implementation here */
}It wouldn't be the top comment if it wasn't