The paper, “Emergent Representations of Program Semantics in Language Models Trained on Programs” can be found here.
Abstract
We present evidence that language models (LMs) of code can learn to represent the formal semantics of programs, despite being trained only to perform next-token prediction. Specifically, we train a Transformer model on a synthetic corpus of programs written in a domain-specific language for navigating 2D grid world environments. Each program in the corpus is preceded by a (partial) specification in the form of several input-output grid world states. Despite providing no further inductive biases, we find that a probing classifier is able to extract increasingly accurate representations of the unobserved, intermediate grid world states from the LM hidden states over the course of training, suggesting the LM acquires an emergent ability to interpret programs in the formal sense. We also develop a novel interventional baseline that enables us to disambiguate what is represented by the LM as opposed to learned by the probe. We anticipate that this technique may be generally applicable to a broad range of semantic probing experiments. In summary, this paper does not propose any new techniques for training LMs of code, but develops an experimental framework for and provides insights into the acquisition and representation of formal semantics in statistical models of code.
wizardbeard@lemmy.dbzer0.com 2 months ago
Wow, that headline is significantly overstated. This has nothing to do with “understanding” or “reality”. Like holy shit this is an absurd leap from what they actually state in the abstract. Thanks OP for including it in the “preview” here.
Given a number of “starting states” and “ending states” of 2D grid based “environments”, an LLM is able to return increasing accurate “between states” as it is trained.
Neat! Not an understanding of reality. At the biggest stretch it is an “understanding” of an incredibly constrained problem space.
Hackworth@lemmy.world 2 months ago
I did some source digging to hopefully best address your observations. Science journalism (even when internal and likely done in concert with the authors) is fundamentally a game of telephone. But looking at the source papers:
They say it in an incredibly formal way, but they do seem to come to the conclusion that the LLM develops understanding. The paper makes that case within an incredibly narrow context, but it does include:
With it now clear that the generalized case is not shown: the specific type of understanding that they have shown is non-trivial.
MagicShel@programming.dev 2 months ago
I mostly get what you’re saying, though I don’t have the requisite understanding to follow formal proofs, but if there is one thing I do know for certain, it’s that “understanding” is anthropomorphizing and shorthand for something that is very much not understanding in a human context at all.
I get that it can be hard to find the right words to explain a some of these emergent phenomena, but I think it’s misleading to use words that make AI appear to have a thought process akin to anything we could understand as such—at least in settings where folks might not understand the shorthand as such.
And maybe everyone here is aware of that, but it makes me uneasy, hence this comment to hopefully make that point.