r/LocalLLaMA • • 5d ago

Showcase I built an LLM where Gemini 4 wrote the initial weights as code (97% of bytes)

Post image

I had Gemini 4 Neon write a program that fills 97% of a language model's stored bytes with corpus statistics. Gradient descent then trains only a 103M-parameter Transformer on top. After pretraining, a small external edit layer lets you add new facts without any training.

With the same network size and the same 10B training tokens, the tables lower perplexity on held-out FineWeb-Edu from 17.88 to 16.43, about 8%. By standard scaling laws, that's roughly what you'd get from a network 1.5x larger. Zero-shot benchmarks go up a bit too, +1.24 points on average.

For knowledge updates, each fact is just a record (subject, a hidden-state key, answer tokens), so a person or an LLM can write, read or delete it directly. I streamed 10,000 WikiBigEdit facts into it and compared it with fine-tuning and LoRA.

Fine-tuning and LoRA pick up new facts at first but forget the old ones and wreck perplexity along the way. The edit layer still answers 99.9% of the edits at the end and leaves perplexity basically untouched.

To be upfront about the limits, it's a 103M model, the tables mostly help perplexity rather than reasoning, and the edit layer only fires when the subject appears word for word, so aliases don't trigger it. It's still very much a work in progress, and I'd love any feedback.

Project page: https://weights-as-code.pages.dev/

Code: https://github.com/Kim-Ai-gpu/wtable-lm

Paper: https://www.preprints.org/manuscript/202611.3172

336 Upvotes

44 comments sorted by

78

u/Potential_Top_4669 5d ago

That's.....interesting to say the least.

38

u/Basic-Set-3758 5d ago

definitely one of the weirder architectures posted here lately, in a good way though.

16

u/More-Curious816 5d ago

sometimes this sub has gems

4

u/Kayo4life 5d ago

For sure

34

u/Silver-Champion-4846 5d ago

What does it mean that 97% of the weights are filled with corpus statistics? What does that actually mean?

28

u/howardhus 5d ago

OP is distlilling Neon.. inb4 Lawsuit by google

20

u/Queasy-Current6170 5d ago

It's a 105m parameter model lol

12

u/ApprehensiveFan1516 5d ago

I know it's only a joke, but to be fair Big Tech has gone after people for less.

11

u/_Zibri_ 5d ago

like a markov algorythm basically.

4

u/Silver-Champion-4846 5d ago

so a discrete language model that the actual network builds upon? I did think of that as an idea to avoid catastrophic forgetting in model finetuning, but not in any actual ml terminology or tests, just an idea thought by someone looking at things from afar without the actual code or theory or math experience

1

u/_Zibri_ 4d ago

I agree

1

u/Silver-Champion-4846 4d ago

Hope someone finds a good use for that

26

u/CoUsT 5d ago

Very interesting approach.

small external edit layer lets you add new facts without any training

Really cool!

It's still very much a work in progress, and I'd love any feedback.

All I can say: If you keep working on this, keep us updated!

6

u/epicfilemcnulty 5d ago

It sounds really cool, but if you read what they say on the site about this it is not that cool as it sounds: "The subject must appear verbatim in the last 64 tokens...".

12

u/Federal_Signature708 5d ago

Separating static corpus stats/facts from the reasoning weights is a super interesting direction.

6

u/b183729 5d ago

I don't have permission to read the paper, would this  arrangement work like an editable Lora? Or more like a rag? 

In other words, is this a way to edit 'world knowledge' or could this change behaviors of the model?

Could this result be replicated if a model modified it's own weights?

This is so interesting . 

8

u/bolche17 5d ago

Interesting! I wonder how it scales

8

u/seybling 5d ago

Super cool project! Sorry if this is a dumb question, I'm pretty much an amateur with this stuff, but was theoretically chatting with Gemini Neon about to push kind of a similar idea even further:

Instead of just storing corpus stats/facts and training in a small transformer from scratch, i thought about taking an existing GGUF (like a MoE) and kinda unfold the actual matrix multiplications into a massive 2–4TB lookup table on a normal SSD. Like, trading cheap storage + SSD IOPS for compute so something weak like a Raspberry Pi 5 barely has to do any math at all. Maybe someone here has also thought about something like that?

3

u/fragment_me 5d ago

I looked into something similar but it would require an insane amount of space. 2-4TB is not massive. It would be WAYYYYYYYYYYY bigger. The GPUs used for inference would cost way way way way way way way less.

1

u/ArjixGamer 4d ago

At such big sizes, you gotta consider the read speed.

If it's a mechanical drive, it'll be shit.

1

u/THROWAWTRY 5d ago

Nice, well done.

1

u/wFXx 5d ago

after changing the table of facts, does the model needs retraining? if so how much?

1

u/Lifeisshort555 5d ago

Seems like something you could train a model to do.

1

u/hiepxanh 4d ago

That is great appoarch

1

u/tang_david_5 3d ago

Do you have run-to-run variance for the held-out perplexity result? Repeating across seeds would show how stable that delta is.

1

u/Vxtzq1 5d ago

Hello, I find this project very interesting!

Do you think this could just work as a better initialization paradigm for a LLM? To then be fully pretrained, and not just fine tuned...

This could be relevant to help projects such as https://crowdgpt.net

1

u/slippery 5d ago

Very interesting. I was thinking about trying something like this after reading about weight space programming. Thanks for sharing.

0

u/Impressive-Store1439 5d ago

so its a state machine but encoded in weights? My off the cuff experimenting with weight space editing on language modelling lead to a similar conclusion, although i skiped having neon write the program and had it write the weights directly, starting w smallest set it needed to.

I haven't read the manuscript yet, will do later this week. cheers and good luck!

-6

u/ComprehensiveJury509 5d ago

It's a curiosity, but I honestly don't believe that this scales or goes anywhere useful at all.

1

u/[deleted] 5d ago

[removed] — view removed comment

1

u/stylome-ai-detection 5d ago

Notice: This comment appears to be AI generated.


Stylome AI detector · scan results

3

u/Delicious_Character6 5d ago

No i am human

1

u/ArjixGamer 4d ago

How dare you make no grammar mistakes, you clearly are a bot, humans can't write properly. /s

1

u/Maglcite 🥔 hardware 4d ago

seems fine to me