> all information relevant to the execution of the program can certainly be recovered.
This is moving goalposts as it has little to do with my original premise.
Of course we're a long way off from this, but there's no reason it couldn't be done in theory.
Your original comment was (replying to one) about “decompilation” of binaries. You seem to be talking about some fantasy perfect decompilation that gets variable names too, but no such decompilation tool or human-employable method does this, and I would argue that variable names aren’t information so much as they’re implicit context - proper code implies certain variable names (stylistic differences notwithstanding) and vice versa.
> Some transformations irrecoverably lose information. A recontextualization engine such as an LLM might be able to "recover" some information by comparing it to other code in its training set, but it's still a guess and not all code will have representation in the training set.
It is a completely generalized statement about lossy transformations, aka transformations that aren't reversible with a 1 to 1 map. It says nothing in particular about decompilation, or getting variable names.
> I would argue that variable names aren’t information so much as they’re implicit context
You are free to argue what you want, but that doesn't change reality--variable names are information about the original state before it was irreversibly transformed. Is the information important to you and your current task? Who knows. But my original comment is absolutely correct.
1:1 Source recovery is never the goal of decompilation, or reverse engineering in general. You just want functionally equivalent, idiomatic code.
> 1:1 Source recovery is never the goal of decompilation
I am aware, but I appreciate the lesson. Now try to consider why that has no bearing on the points I've made.
It’s a guess, sure, but I don’t see why it would be a less good guess than a human’s.
> Stuff like variable names won’t be exact
Yes, this is the point of my comment around information loss. Lossy transformations inherently cannot be recovered with absolute certainty, and the degree of certainty depends on available context.
This is true for absolutely any system which produces lossy transformations, not just in the context of code and LLMs, but encoders, etc.
This is still a loss of information. You're completely misunderstanding the point: Minification is an irreversible process unless you happen to have exactly the context you need, and can verify the provenance of the source in question. Coming up with "better" variable names is not recovering information, it's extrapolating information about the old state to the point of error.
For that purpose there is no reason LLMs can’t be as good as the best humans.
I do appreciate your comment as it's not defensive, it's made in earnest, so please don't take my above statement to be a reflection of you in particular.
You lose a lot more than whitespace, you lose semantics, metadata, and lots of other information that makes it so
Obviously byte coded languages are a bit easier, and you may get lucky and experts help a lot, and perhaps LLMS can help a little.
Both Rice's theorem and the system identification problem from the cybernetics days relate to why it is so hard.
> Given a system in the form of a black box (BB) allowing finite input-output interactions, deduce a complete specification of the system’s machine table (i.e., algorithm or internal dynamics).
AND
> Given a complete specification of a machine table (i.e., algorithm or internal dynamics), recognize any BB having that description.
Decompilation doesn't give you the equivalent of the original source code, it gives you new source code that appears to be functionally similar to it, and many people who has been forced to use decompilation to recover from lost source code or consultant time-bombs have run into the problems that admittently seem pretty counter intuitive.
Remember that Rice-Shapiro and Kreisel-Lacombe-Shoenfield-Tseitin extend Rice to partial and total functions in finite time.
Telling if a program is equivalent to a fixed other program, even for total functions is still undecidable as they are 'non-trivial' properties.
Most of the time you can make it work, but it isn't a case of:
> “let’s construct source that can be used interchangeably with the original”
That means even though information is irrecoverably transformed during compilation, LLM could come up with semantically valid expanded solution that both fits the compiled information, that is it can be recompiled successfully, and makes sense semantically for whoever would eventually want to evolve the decompiled code with an understanding of the domain.
So the goal isn't to recover exactly what code really was, but to provide a possible solution that fits and is useful.
There is no good way to reconstruct that, AI/ML or not.