Live data from Hacker News

OpenAI is good at unminifying code

glama.ai

311–320 of 321 posts

Re: OpenAI is good at unminifying code

#311
post #175

Earlier quoted context omitted.

That only means it’s not a legally recognised brand, but it is a brand nonetheless if people associate the two (and they do). A bit like the way people associate tissue paper with Kleenex, or photocopies with Xerox, or git with GitHub.

I wonder if OpenAI will stick with the GPT acronym, given that most people don't know what it's an acronym for and it's a bit of a mouthful.

I doubt many people know the correct full forms of LED, LCD, USB, HDMI, Wi-Fi, HTTP, URL, etc. either

Re: OpenAI is good at unminifying code

#312
post #97

Author 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

It's a shame this loses one of the most useful aspects of LLM un-minifying - making sure it's actually how a person would write it. E.g. GPT-4o directly gives the exact same code (+contextual comments) with the exception of writing the for loop in the example in a natural way: for (var index = 0; index Comparing the ASTs is useful though. Perhaps there's a way to combine the approaches - have the LLM convert, compare…

Depends on how many tokens you want to spend.

Making the code, fully commenting it and also giving an example after that might cost three times as much

Re: OpenAI is good at unminifying code

#313
post #258

Earlier quoted context omitted.

What kind of question does it ask the LLM? Giving it a whole function and asking "What should we rename ?" repeatedly until everything has been renamed? Asking it to do it on the whole thing, then parsing the output and checking that the AST still matches?

For each variable: 1. It asks the LLM to write a description of what the variable does 2. It asks for a good variable name based on the description from 1. 3. It uses a custom Babel plugin to do a scope-aware rename This way the LLM only decides the name, but the actual renaming is done with traditional and reliable tools.

This answer is reassuring.

Based on it, I went and read the readme. The readme was also excellent, and answered every question I had. Great job, thank you, I'll be trying this.

Re: OpenAI is good at unminifying code

#314
post #267

Earlier quoted context omitted.

On structural level it's exactly 1-1: HumanifyJS only does renames, no refactoring. It may come up with better names for variables than the original code though.

Can it guarantee 1-1? Doesn't Javascript allow looking up fields using a string name? That string could be computed in a complex manner.

It does in fact change the structure, but only safe-ish AST transformations related to minifiers (e.g. `void 0` to `undefined`): - https://github.com/jehna/humanify/blob/eeff3f8b4f76d40adb116... - https://webcrack.netlify.app/docs/concepts/unminify.html

properties and strings aren't renamed

Re: OpenAI is good at unminifying code

#315

This is an example of superior intellectual performance to humans. There’s no denying it. This task is intellectual. Does not involve rote memorization. There are not tons and tons of data pairs on the web of minimized code and unminified code for llms to learn from. The llm understands what it is unminifying and it is in general superior to humans on this regard. But only in this specific subject.

> This is an example of superior intellectual performance to humans.

So is too multiplying _many_ large numbers together.

> The llm understands what it is unminifying and it is in general superior to humans on this regard.

Proof needed. I would grant in terms of speed as very likely to be true. In general, I do not know how accuracy would compare.

Re: OpenAI is good at unminifying code

#316
post #49

Earlier quoted context omitted.

I see your point, but I think there's more to it. It's kind of like saying "all humans can do is perceive and produce sound, any other ability is just a side-effect". We might be focusing too much on their mechanism for "perception" and overlooking other capabilities they've developed.

Well, yes — absolutely. You could say something similar about any system with complex emergent behaviour. 'All computers can do are NAND operations and any other ability is just a side effect', or something. However, I do think that in this case it's meaningful. The claim isn't that LLMs are genuinely exhibiting reasoning ability — I think it's quite clear to anyone who probes them for long enough that they're not. I…

>I think it's quite clear to anyone who probes them for long enough that they're not.

I disagree and so do a lot of people who've used them for a long while. This is just an assertion that you wish to be true rather than something that actually is. What happens is that for some bizarre reason, for machines, lots of humans have a standard of reasoning that only exists in fiction. Devise any reasoning test you like that would cleanly separate humans from LLMs. I'll wait.

> The claim is usually some pseudo-philosophical claim that the very definition of reasoning is simply 'outputting (at least some of the time) correct sentences' and so there's no more to be said.

There is nothing philosophical or pseudo-philosophical about saying reasoning is determined by output. If anything, the opposite is what's philosophical nonsense. The idea that there exists some "real" reasoning that humans perform and "fake" reasoning that LLMs perform and yet somehow no testable way to distinguish this is purely the realm of fiction and philosophy. If you're claiming a distinction that doesn't actually distinguish, you're just making stuff up.

LLMs clearly reason. They do things, novel things that no sane mind would see a human do and call anything else. They do things that are impossible to describe as anything else unless you subscribe to what i like to call statistical magic - https://news.ycombinator.com/item?id=41141118

And all things considered, LLMs are pretty horrible memorizers. Getting one to regurgitate Training data is actually really hard. There's no database of knowledge. It clearly does not work that way.

Re: OpenAI is good at unminifying code

#317

Earlier quoted context omitted.

I wonder if OpenAI will stick with the GPT acronym, given that most people don't know what it's an acronym for and it's a bit of a mouthful.

I doubt many people know the correct full forms of LED, LCD, USB, HDMI, Wi-Fi, HTTP, URL, etc. either

> the correct full forms of (…) Wi-Fi

Wi-Fi isn’t like the others on your list.

https://en.wikipedia.org/wiki/Wi-Fi#Etymology_and_terminolog...

> The name Wi-Fi, commercially used at least as early as August 1999, was coined by the brand-consulting firm Interbrand. The Wi-Fi Alliance had hired Interbrand to create a name that was "a little catchier than 'IEEE 802.11b Direct Sequence'." According to Phil Belanger, a founding member of the Wi-Fi Alliance, the term Wi-Fi was chosen from a list of ten names that Interbrand proposed. (…)

> The name Wi-Fi is not short-form for 'Wireless Fidelity' (…) The name Wi-Fi was partly chosen because it sounds similar to Hi-Fi, which consumers take to mean high fidelity or high quality. Interbrand hoped consumers would find the name catchy, and that they would assume this wireless protocol has high fidelity because of its name.

Re: OpenAI is good at unminifying code

#318
post #225

Earlier quoted context omitted.

> JS minification is fairly mechanical and comparably simple, so the inversion should be relatively easy. This is stated as if it's a truism, but I can't understand how you can actually believe this. Converting `let userSignedInTimestamp = new Date()` to `let x = new Date()` is trivial, but going the other way probably requires reading and understanding the rest of the surrounding code to see in what contexts `x` is…

You are technically true, but I think you should try some reverse engineering to see that it is usually possible to reconstruct much of them in spite of the amount of transformations made. I do understand that this fact might be hard to believe without any prior. EDIT: I think I got why some comments complain I downplayed the power of LLM here. I never meant to, and I wanted to say that the unminification is a relati…

I have tried reconstructing minified code (I thought that would be obvious from my example). It feels like it takes just a bit less thought than it did to write the code in the first place, which is definitely not something I would classify as "comparably simple".

Re: OpenAI is good at unminifying code

#320
Unminification (obfuscation removal) can also be applied to text. Most specialties develop a jargon that allows insiders to communicate complex ideas quickly; that shorthand excludes outsiders. Large language models can make specialist jargon transparent and thereby expand the circle of people whose understanding applies to specialized fields. Essentially, they solve the problem of mapping specialized, jargonized concepts to things the outside reader already knows. Anyone who wants to learn needs this, and I hope it will become part of students' learning paths.
Post reply on HN