Live data from Hacker News

OpenAI is good at unminifying code

glama.ai

221–230 of 321 posts

Re: OpenAI is good at unminifying code

#221
post #150

Earlier quoted context omitted.

I feel you’re downplaying the obfuscatory power of name-mangling. Reversing that (giving everything meaningful names) is surely a difficult problem?

I would say the actual difficulty greatly varies. It is generally easy if you have a good guess about what the code would actually do. It would be much harder if you have nothing to guess, but usually you should have something to start with. Much like debugging, you need a detective mindset to be good at reverse engineering, and name mangling is a relatively easy obstacle to handle in this scale. Let me give some con…

How do we end up with you pasting large blocks of code and detailed step-by-step explanations of what it does, in response to someone noting that just because process A is simple, it doesn't mean inverting A is simple?

This thread is incredibly distracting, at least 4 screenfuls to get through.

I'm really tired of the motte/bailey comments on HN on AI, where the motte is "meh the AI is useless, amateurish answer thats easy to beat" and bailey is "but it didn't name a couple global variables '''correctly'''." It verges on trolling at this point, and is at best self-absorbed and making the rest of us deal with it.

Re: OpenAI is good at unminifying code

#222
Would have been cool if this had been used in that air con reverse engineering story yesterday.

I noticed while reading the blog entry that the author described using a search engine multiple times and thought, "I would have asked ChatGPT first for that."

Re: OpenAI is good at unminifying code

#223
post #175

Earlier quoted context omitted.

GPT is not a brand. A court ruling turned down that notion. It's a technology.

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.

Re: OpenAI is good at unminifying code

#224

The site the post mentions for the original code ( https://reactive.network/hackathon ) is an accessibility nightmare.

The garbled text is included in the tree as relevant, pronounceable, and constantly changing text. Here's Chrome's accessibility tree: https://imgur.com/a/V1589Jr

(I'd love if a screen reader user could upload some audio of how awful this sounds, by the by)

Please use `aria-hidden="true"` for stuff like this, it just removes the element from the accessibility tree. I've also emailed Reactive a link to this thread.

Here is a decent intro to ARIA things: https://www.smashingmagazine.com/2022/09/wai-aria-guide/

Re: OpenAI is good at unminifying code

#225

JS minification is fairly mechanical and comparably simple, so the inversion should be relatively easy. It would be of course tedious enough to be manually done in general, but transformations themselves are fairly limited so it is possible to read them only with some notes to track mangled identifiers. A more general unminification or unobfuscation still seems to be an open problem. I wrote handful of programs that…

> 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 being used. Also, the rest of the code is also minified, making this even more challenging. Even if you do all that right, it's at best it's still a lossy conversion, since the name of the variable could capture characteristics that aren't explicitly outlined in the code at all.

Re: OpenAI is good at unminifying code

#226
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

how do you make an LLM work on the AST level? do you just feed a normal LLM a text representation of the AST, or do you make an LLM where the basic data structure is an AST node rather than a character string (human-language word)?

The frontier models can all work with both source code and ASTs as a result of their standard training.

Knowing this raises the question, which is better to feed an LLM source code of ASTs?

The answer is really it depends on the use case, there are tradeoffs. For example keeping comments intact possibly gives the model hints to reason better. On the other side, it can be argued that a pure AST has less noise for the model to be confused by.

There are other tradeoffs as well. For example, any analysis relating to coding styles would require the full source code.

Re: OpenAI is good at unminifying code

#228

Earlier quoted context omitted.

Sure, but that claim wouldn't be true for humans, right? So it's a nonsequiteur. The relevant claim would be: all humans can do is move around in their environments, adapt the world around them through action, observe using adaptive sensory motor systems, grow and adapt their brains and bodies in response to novel and changing environments, abstract sensory motor techniques into symbolic concepts, vocalize this using…

> all they can do is, in fact, sample from a compression of historical texts To me, results like the Othello paper make any sort of "stochastic parrot" thinking completely untenable. https://thegradient.pub/othello/

Abstract functions are fully representable by function approximations in the limit n->inf; ie., sampling from a circle becomes a circle as samples -> infinity.

This makes all "studies" whose aim is to approximate a fully representable abstract mathematical domain irrelevant to the question.

This is just more evidence of the naivety, mendacity, and pseudoscientific basis of ML and its research.

Re: OpenAI is good at unminifying code

#229
post #207

I recognized this a few months back when I wanted to see the algorithm that a website used to do a calculation. I just put the minified JS in ChatGPT and figured it out pretty easily. Let's take this a few steps out. What happens when a LLM can clone a whole SAAS app? Let's say I wanted to clone HubSpot. If an LLM can interact with a browser and figure out how a UI works and take code hints from un-mimified code I th…

I was with you until: >If an LLM can interact with a browser and figure out how a UI works and take code hints from un-mimified code I think we could see all SAAS apps be commoditized . The backend would be proprietary, but it could figure out API formats and suggest a backend architecture. whoooha! that's a lot of probing and testing of the SAAS that would be required in order to see how it behaved. SAAS aren't algo…

You wouldn't necessarily need to do much probing - consider that the documentation would provide numerous hints to the agent as to what each endpoint was actually doing.

Re: OpenAI is good at unminifying code

#230
post #190

Earlier quoted context omitted.

This does seem to be a smart use of the tools available to skip the grind and get to the point of the leetcode questions. However, I wonder about this: What will you do in a live interview situation? Will you pull up ChatGPT?

I have been told by people working in $200k+/$300k+ SWE jobs to look up at the answers and just be able to regurgitate something along the lines of the Grind 75 answers as a first step. As a next step - even within these 75 questions, Grind 75's eighth answer and fourteenth answer are answered essentially the same way, as are other questions in there. So the next step would be to see these patterns (binary search, pr…

This is a good way to do it IMO. Though I would say you don't want to just memorize answers; you want to fully understand them. Also, paying for LeetCode premium is very helpful since their official solutions are easy to understand and explain how you might arrive at these solutions yourself.
Post reply on HN