I am testing large language models against a ground truth data set we created internally. Quite often when there is a mismatch, I realize the ground truth dataset is wrong, and I feel exactly like the author did.
OpenAI is good at unminifying code
91–100 of 321 posts
Re: OpenAI is good at unminifying code
#92An interesting use-case of this capability is refactoring, which, for me, ChatGPT has been unmistakably good at. It's amazing how I can throw garbage code I wrote at ChatGPT, ask it to refactor, and get clean code that I can use without worrying if it's going to work or not, because in 99% of cases it works without breaking anything.
What language(s), out of interest?
Re: OpenAI is good at unminifying code
#93Earlier quoted context omitted.
Unfortunately the comments that could be generated are exactly the ones that should never be written. You want the comment to explain why, the information missing from the code.
This is something I always disagreed with. In my experience, I rather read a short comment explaining what is the purpose of a block of code, than trying to decipher it. Yes, code "should speak for itself", but reading a comment is almost always faster than reading blocks of code. And then there is also documentation (if you include it in what you define as comment). I much rather go through a website, with a search…
A comment that is incorrect can do a lot of damage, and they tend to get confused about implementation details over time.
Re: OpenAI is good at unminifying code
#94Earlier quoted context omitted.
> Seems like we could render all code open source Unfortunately not really. Having the source is a first step, but you also need the rights to use it (read, modify, execute, redistribute the modifications), and only the authors of the code can grant these rights.
Doesn't it count as 'clean room' reverse engineering - or alternatively, we could develop an LLM that's trained on the outputs and side-effects of any given function, and learns to reproduce the source code from that. Or, going back to the original idea, while the source code produced in such a way might be illegal, it's very likely 'clean' enough to train an LLM on it to be able to help in reproducing such an applic…
I would guess clean room would still require having someone reading the LLM-decompiled code, write a spec, and have someone else write the code.
But this is definitely a good question, especially given the recent court verdicts. If you can launder open source licensed code, why not proprietary binaries? Although I don't think the situation is the same. I wouldn't expect how you decompile a code matters.
Re: OpenAI is good at unminifying code
#95Here's a hint, STOP MINIFYING CODE! gzip over transport is enough.
Re: OpenAI is good at unminifying code
#96Dont know if this will apply directly here, but -- As someone who is "not a developer" - I use the following process to help my: 1. I setup StyleGuide rules for the AI, telling it how to write out my files/scripts: - Always provide full path, description of function, invocation examples, and version number. - Frequently have it summarize and explain the project, project logic, and a particular file's functions. - Hav…
Re: OpenAI is good at unminifying code
#97Re: OpenAI is good at unminifying code
#98Actually this opens up a bigger question. What if I like an open source project but don't like its license. I can just prompt AI by giving it the open source code and ask it to rewrite it or write in some other language. Have to look up the rules if this is allowed or will be considered copying and how will a judge prove?
Re: OpenAI is good at unminifying code
#99Okay, but if the unminified code doesn't match the minified code (as noted at the end "it looks like LLM response overlooked a few implementation details"), that massively diminishes its usefulness — especially since in a lot of cases you can't trivially run the code and look for differences like the article does. [ed.: looks like this was an encoding problem, cf. thread below. I'm still a little concerned about corr…
Re: OpenAI is good at unminifying code
#100Author of HumanifyJS here! I've created specifically a LLM based tool for this, which uses LLMs on AST level to guarantee that the code keeps working after the unminification step: https://github.com/jehna/humanify