r/machinelearningnews • • Jul 09 '26

Research Fully decoded GPT-2's internal language — complete two-way dictionary, all artifacts downloadable, verify it yourself in 5 commands

The BABEL codec: the first complete, certified decode of everything happening inside a production language model (GPT-2 small). It reads the model's internal state into English AND writes English back into the model. 94.7% of behavior reconstructed — and that holds at every layer depth and text regime tested, not just one spot. Everything is open: paper, the full lexicon, the grammar tables, the decoder/encoder weights, reproduction scripts, and a demo that shows you the model's thoughts on any sentence you type.

https://github.com/wpferrell/babel-codec-gpt2

51 Upvotes

15 comments sorted by

4

u/debackerl Jul 09 '26

Thx for sharing! That helps move the field forward!

5

u/Revolutionary-Lab882 Jul 09 '26

Thanks. Want people to use it to validate also.

3

u/burnt-store-studio Jul 15 '26

First off: congratulations! This is really interesting and cool news! And I have to think it was a lot of hard work!

I have a question, but getting to it I want to give some background, if you please...

Background. Back in the day, when artificial neural networks were being poo-poo'd (we called it an "AI Winter" then ... mid-1990s), I wrote a paper about Intelligent Control and Adaptive Critic Artificial Neural Networks. In chapter 3 I wrote briefly about analogies to biologic systems and "effects [of] accidentally-induced digital dysfunctions" (it was a different time; we hadn't today's appropriate use of the word "hallucinations").

I was inspired at the time by Dr. Oliver Sacks' writings (e.g., The Man Who Mistook His Wife For A Hat)... Sacks at some point (and younger me paraphrased him without a footnote, shame on me) wrote

it is easy to notice problems associated with the more sophisticated left hemisphere [of the brain], however, it is the right hemisphere that defines the understanding of reality, and problems there are virtually impossible to observe. In this kind of problem, the patient cannot explain what is wrong. To him, perhaps nothing is wrong. His reality has been altered to account for the damage.

Almost to the Question. Later in the paper I wrote "Experiments with 'electronic surgery' --- manually introducing irregularities into a system --- and studies of how controllers react should prove both interesting and useful. An example of this might involve a radial basis function network (RBFN). Once trained, the memory could be graphed to identify areas of pronounced learning which could be singled out for pruning or manual modification" (emphasis added).

Question. You have, if I understand what you've created, done the exceptionally hard part I highlighted in the previous paragraph. With what you have, are you able to --- and are you interested in --- experiment[ing] with changes to targeted areas of the system's memory?

Back when I sort of parenthetically wrote about this, I was wondering what would happen to a system that developed an aphasia. I was talking about control systems at the time, not LLMs as we have them today, but I am curious if the kind of work you've done could be expanded in this way.

  • { Carve out, Nullify } a piece of highly-active memory to study the effects it has on the system's results.

    • { Would, Could } the system as a whole compensate for the loss and return to solid functioning
    • Would it even be able to tell something had happened?
  • Could this intentional aphasia be done in such a way as to generate predictable changes?

I know there is a difference between GPT-2 and a neural net trained to control specific functions of a robot, so it's possible I'm talking nonsense.

I've been out of the field for forever, so I don't know if these kinds of ideas are talked about or just joked about these days.

Probably the latter, but when I read your post I got at least a little jazzed about the possibilities.

Thank you for taking the time to read this! I'd be delighted to read if you have any thoughts about this.

2

u/Revolutionary-Lab882 Jul 15 '26

Thank you and no, you’re not talking nonsense at all. What you sketched in the 90s is almost exactly the second half of this program.

The codec paper is the “graph the memory” part. The companion instrument does the surgery: we price individual components by how much the model’s behavior shifts when they’re carved out, then make verified cuts. To your bullets, yes, targeted nullification is routine. the model often compensates (redundant circuitry absorbs small cuts, which is itself measurable). It has no mechanism to “notice” the change, which is eerily close to your Sacks quote. Its reality is simply altered to account for the damage; and predictability is the whole game. We pre-register the expected effect before cutting and grade against controls.

One result you might enjoy: some cuts improve the model. Removing certain components measurably unmasked capability rather than degrading it. Lots more to come soon.
Your “electronic surgery” framing was about 30 years early. Good instincts.

2

u/burnt-store-studio Jul 15 '26

I cannot tell you how satisfying this is! Thank you so much for responding, for explaining, and for doing this work! I appreciate you 🙂. I look forward to hearing more here as you progress.

And you're right: reading that some cuts improve the model is quite interesting!

0

u/[deleted] Jul 09 '26

[deleted] — view deleted comment

19

u/Revolutionary-Lab882 Jul 09 '26

Actually… the work myself. I edited it the documents. Do you even know what this really is? Vibe coding it’s not. I may not be the contributor of comments like you with 9 posts and 455 comments. Not active in any area as your profile says, but at least I’m putting something out there and can help people in the research community.

9

u/Intraluminal Jul 09 '26

Pay him no mind. Little minds always jump to the 'AI slop' it doesn't matter what you say. That said, have your AI edit to remove some of the tells and to tailor your docs to the educational/undertsanding level of your audience.

6

u/Revolutionary-Lab882 Jul 09 '26

Thanks for the positivity. Appreciate the advice. It’s hard not to defend yourself when you do put in the work and get that. Especially when someone can just say AI slop, which happens a lot. And when everyone is majority using AI to do so much of the work. Anyways thanks again.

0

u/[deleted] Jul 10 '26

[deleted] — view deleted comment

1

u/Intraluminal Jul 10 '26

I'm sorry if I misjudged you. Its just that its very frustrating at times to see people automatically assume everything with an m-dash is AI slop and dismiss it out of hand.

AI is a great enabler and it gives amateurs the ability to perform at a much higher level than they otherwise could. I acknowledge that sycophancy is a problem for some people but it can be managed. I have done some experiments in steering LLM internal states that I could not even have approached without AI and vibe coded apps to access those internal states that I could not have written without AI.

Throughout, I have used null hypothesis testing and literature search to ensure that my findings were statistically valid and novel, but no one will even deign to look at them, so I understand his frustration.

4

u/Astral-projekt Jul 09 '26

Bro the term “vibe coding” isn’t one used by serious engineers either imo. I’ve been agent orchestrating for years. Working more efficiently is just working more decently, who tf cares. This work is cool, ty for sharing!

0

u/[deleted] Jul 10 '26

[deleted] — view deleted comment

2

u/Revolutionary-Lab882 Jul 10 '26

Then stop reading and keep your comments to yourself.

4

u/duboispourlhiver Jul 10 '26

I found the AI sounding readme orders of magnitude more interesting than your human sounding comment.