by yakubov_org · 1y ago · 0 comments
I ran an experiment to find out, testing 8 different AI models on 500 Python code samples across 7 naming styles. The results suggest that descriptive variable names do help AI code completion.
Full paper: https://www.researchsquare.com/article/rs-7180885/v1
Perhaps it will make them more intelligent ...
AIs are finite. If they're burning brainpower on determining what "x" means, that's brainpower they're not burning on your actual task. It is no different than for humans. Complete with all the considerations about them being wrong, etc.
I am far from an AI booster or power user but in my experience, I get much better results with descriptive identifier names.
They are also known to operate on high level abstracts and concepts - unlike systems operating strictly on formal logic, and very much like humans.
Also, I think this is anthropomorphizing the llms a bit too much. They are not humans, and I'd like to see an experiment on how well they perform when trained with randomized var names.
When I tried it once the model did a surprisingly good job, though it was quite a while ago and with a small model by today's standards.
But every time you make an AI think you are introducing an opportunity for it to make a mistake.
better to not, I think.