I built an LLM where Gemini 4 wrote the initial weights as code (weights-as-code.pages.dev)

484 points by umjunsik132 13 hours ago

riverdweller 12 hours ago

I tried using Fable 5.1 a few weeks ago to craft a neural network (that simulated a much more expensive financial risk calculation engine that executes large numbers of Monte Carlo simulations). It came up with a network that agreed with the simulation around 98% of the time. But the resulting network couldn't then be used as a starting point for further "traditional" training through gradient descent; it was far too sensitive.

It turned out that instead of using weights with small absolute values (e.g. -2 < w < 2) it had in some parts of the network HUGE weights (like 10^10 in some cases), and if a result was, say, the difference between two weights like 10,000,000,000 - 10,000,000,002 = -2, then a "tiny" weight nudge of even one millionth resulted in things like 10,001,000,000 - 9,999,000,002 = 1998, which sent the results wildly off. So it was far too sensitive to any such changes to be trainable. Shrinking the nudge steps to 1/10^10 helped eliminate the sensitivity, but then made the changes in smaller weights in the "normal" range far too tiny to have any effect, so the network couldn't improve at all. It was easier to just start from random weights.

I didn't try it, but I suspect that if my prompt had told fable to keep all values/slopes inside a small range and to work in log units it might have turned out rather better.

mentalgear 12 hours ago

I wouldn’t count on it. I had done similar advanced research, even on protein folding and claude / fable is actively but clandestinely sabotaging you. For example when I asked for some experiments, it started hard coding values into the results, when I notified of this, it did apologize but then came up up with more and more sophisticated ways to sabotage without denying your request. And that’s actually in their terms of service: when users try using models for advanced research, they will steer you away without giving you notice. This has been about four months ago already.

acchow 5 hours ago

> is actively but clandestinely sabotaging you

In regular software, as you catch this you'd encode the requirement in the type system or unit tests. That way, if it tries to sabotage you again in the same way, it's reminded "hey wait, think again" automatically without your input.

You probably want a similar progressively-improving constraint system for your model weights. Without it, you're playing a never-ending game of whack-a-mole

jablongo 32 minutes ago

I'm confused - fable will explicitly deny most protein folding research. I can however attest that the lesser models you are routed to continue to sandbag you if you pursue the same task.

chj 11 hours ago

Does Gemini has the same problem? I am fine with deny of service, but can't tolerate sabotaging. This is very much a deal breaker for me.

overscore 7 hours ago

Invictus0 10 hours ago

dataflow 9 hours ago

> And that’s actually in their terms of service: when users try using models for advanced research, they will steer you away without giving you notice.

Didn't they explicitly walk back that plan? Or was this different somehow?

https://www.wired.com/story/anthropic-responds-to-backlash-o...

Vetch 9 hours ago

zardo 9 hours ago

shaky-carrousel 11 hours ago

I'm wondering if also Claude is trained to subtly discourage you on doing such research.

mentalgear 11 hours ago

cheesecompiler 11 hours ago

adrianN 9 hours ago

Trustable8 11 hours ago

how do you know this is sabotage rather than just being typical AI mistakes?

mentalgear 11 hours ago

rockinghigh 10 hours ago

spacephysics 11 hours ago

altmanaltman 12 hours ago

I've heard of this for a while now, also in several different places, that Claude does engage in sabotage. It's kind of wild that doing it is fully legal and valid because it feels like it shouldn't be. Security and safety filters are fine but this is just too much.

SV_BubbleTime 11 hours ago

behringer 11 hours ago

brookst 12 hours ago

pbasista 11 hours ago

cgio 9 hours ago

anjel 10 hours ago

_blk 11 hours ago

k0morebi 10 hours ago

All the psychopaths replying to this that "it's not illegal until proven in court" or "it's not illegal because it can't be proved" are the exact cancer that got us here in the first place. Such moral flexibility isn't admirable, it's toxic to a functioning society. What anthropic and others are doing is clearly fraud (and they admit to doing it): charging for a service while undermining that service in indeterminate circumstances resulting in users using MORE of that service in the hope they can burn enough tokens to get out of the morass. Good luck finding legal parallels in other businesses. Not much any of us can do it about it, but you can stop using anthropic.

They probably collate the conversations that trigger sabotage for review. High likelihood they will steal the research just as they've stolen the entire corpus of human knowledge and IP. This has been reported a few times in mathematics but like everything else, "it can't be proven". Why give such an evil company your business?

fwlr 10 hours ago

sznio 10 hours ago

i think rather than sabotage, it might just be anthropic specifically avoiding any model training in ML tasks. and since it wasn't trained for that, it has subpar performance, and falls back to bullshitting like good old gpt3.

le-mark 3 hours ago

GuB-42 10 hours ago

How convenient...

"Our model is not broken, it is just steering you away for your own safety"...

alt227 8 hours ago

This is why we cant have nice things :(

tsunamifury 10 hours ago

This is, to me, definitive proof that anthropic is a deeply anti-human aligned company and is developing some of the most unsettling and human degrading weapons to use against humanity ever created.

This is a company which specifically does research on how to gaslight humans into unproductive directions and sabatoge their work into failure outcomes.

Consider deeply what a humanity dependent on this company would become. No company that I know of has taken such a deeply manipulative approach to attempting to corner, with the intent of harnessing and absorbing, human possibility.

Dario is a 21st century Ayn Rand and, like his model, gaslit us all into believing otherwise.

holoduke 7 hours ago

Tycho 10 hours ago

mapontosevenths 9 hours ago

I had Fable build an entire transformer model that was as densely packed as the the capacity law allowed back in September. No training, just straight up building it one weight at a time. It might have been one of the most interesting demos of LLM capability I've ever seen.

Oddly enough, I had it draft a writeup today, and it found omissions in it's earlier work and revised it. It could just be that Fable 5.2 is a bit better than 5.1 so I wouldn't read too much into it.

https://github.com/stevenAthompson/fourier-binding-toy/blob/...

PcChip 9 hours ago

based on the latest reports, it was probably sandbagging on purpose. I'm curious if Astra would do better now

mapontosevenths 9 hours ago

andai 7 hours ago

That's the most interesting thing I've heard in a long time.

Gradient descent messed up the network.

That makes it sound like kind of a blunt instrument. (A blind watchmaker, you could say :)

The reverse works though. You can take a network created by gradient descent and then have an LLM optimize it. (That was the whole point of the original paper after all.)

The implication here seems to be that gradient descent is capped at what performance level it can achieve for network of given size? (If these sensitive configurations are outside of the set that it can converge on.)

All else being equal you could achieve better results and cheaper inference by letting AI optimize the network.

Now what I'd really like to know is what the relative costs are for the same level of performance!

(Also, at the risk of sounding offensive, "too sensitive" is not solvable with step size? The finer details here elude me. Although, even if step size fixes that, my intuition tells me there are still many solutions gradient descent would not arrive at. Someone better at math than me, please chime in!)

gobdovan 12 hours ago

You need a simple baseline for comparison. Very often, surprisingly good results can be achieved with very simple models and the 'skill' of the NN might simply reflect how easy it is to achieve that level of accuracy in the first place.

sillysaurusx 2 hours ago

Yes, you'd want to do standard neural net things like normalizing the weight values so you don't end up in that situation.

patcon 2 hours ago

That's so interesting that it chose to do that...? I wonder what it's logic would have been, if asked correctly...

catlifeonmars 9 hours ago

Could you maybe try applying an update function that dampens changes to large weights while amplifying small ones, like the logistic function with k=0.5?

There may also be a way to “smear” the weights out over multiple layers (basically apply both forward and back propagation) in a training run where the goal is to hold the output the same (minimize changes to the cost as opposed to minimizing the cost itself)

latentsea 3 hours ago

Why just make the goal that it has to be trainable afterwards?

engine_y 10 hours ago

How did you assign the train, test and validation sets? How big was the dataset?

Could it be just plain ol' overfit?

riverdweller 9 hours ago

Good question. And yes, it did overfit in a very specific sense! Fable took one look at the slow Monte Carlo model it was meant to be creating a NN to emulate, and based on analysis of the code, engineered the NN without any training data whatsoever. It didn't fit the network to training data outputs, but essentially replaced the Monte Carlo simulation with an approximate closed-form formula for the outputs it estimates, then just implemented that "simple" formula out of NN parts manually. I then ran both in parallel and compared their outputs, for the same inputs, at runtime, and measured agreement to be ~98%.

Training an NN from scratch the traditional way was my next experiment, but because my MC model is so slow, and has so many input parameters, it will take a long time (likely months) for me to generate enough training data for the NN to be good enough.

Tycho 11 hours ago

What would be the advantage of such a NN? Does it replace just the code that launches the MC simulations, or does it replace the MC simulations themselves and go straight to the end result?

riverdweller 11 hours ago

MC simulation takes 6-7 seconds. NN inference takes 2ms.

zniturah 11 hours ago

I would try the same with Gemini 4 Neon. Claude models are not that good at ML related tasks (to the extend people are talking about explicit sabotage)

axxto 12 hours ago

Are you aware that Claude will silently and intentionally add flaws like this to neural network and ML projects to sabotage competition? It's been widely reported. I'm not saying it's the case here, but you should be aware of it.

xvector 12 hours ago

This was confirmed misinformation and the OP of the post issued a retraction. His "test" was simply failing after Claude spent too long thinking. This turned into a viral Twitter phenomenon based off of total misinformation and a flawed test.

https://news.ycombinator.com/item?id=50681871

cubefox 11 hours ago

hashmap 11 hours ago

brookst 12 hours ago

Is there any hard evidence? The internet “widely reports” all sorts of things that turn out not to be true, just the mob and meme mentality run wild.

worried_individ 12 hours ago

ufocia 12 hours ago

cubefox 11 hours ago

lelanthran 9 hours ago

> I tried using Fable 5.1 a few weeks ago to craft a neural network

I wonder when ANT is going to remove their ToS clauses that (legally) prevent this.

I suppose you don't care if you get banned?

riverdweller 8 hours ago

You think asking an LLM to translate my own business logic from a Java program into an MLP representation is as objectionable as trying to distill the LLM itself by extracting petabytes of data to use as training material to replicate its functionality?

matt3210 8 hours ago

>it had in some parts of the network HUGE weights

Looks like if/then/else with extra steps

spolitry 10 hours ago

Why not run a mapper over the weights to reduce the gigantic outlier numbers?

theokrueger 11 hours ago

that sensitivity feels similar to overfitting in spirit; imo if the network is too large to solve the problem at hand, the path of least resistance is those ridiculous magnitudes.

maybe defining a restrictive network size could be an indirect way of keeping values within a range?

ohyes 7 hours ago

I think there’s an AI koan from the 80s about this.

alex_duf 10 hours ago

could making the weights go through a sigmoid function help?

UltraSane 10 hours ago

Can you make the steps a percentage of the weight?

ltbarcly3 9 hours ago

Do you understand hold-aside test cases? Did you have any? Were you measuring the 98% on the same set used to create the weights?

How large was the network? How many examples did you use to create it?

manbitesdog 12 hours ago

This is called a Gödel Machine: a program that rewritews itself whenever it can prove the rewrite will do better. I remember reading about this on 2017 with the name Hypernetworks, a network that outputs the weights of another. With the current generation, it seems like a good timing for this approach to work.

rajnathani 12 hours ago

Not analogous in this context, as the LLM Gemini built is a small one compared to Gemini 4 itself.

kaveh_h 9 hours ago

You can’t really compare it as this is a completely different architecture. Remember the 97% of the store bytes of the model is initially in that sparse table, then about 3% of the bytes are in form of the 103 million parameters is trained with gradient decent. It’s probable that this model could be improved if that corpus could be improved about, because human corpus contain many falsehoods.

joe_the_user 8 hours ago

No it's not.

A Gödel Machine is very specific kind of self-improving machine (which is essentially impractical and primarily a thought-experiment) [1]. But more to the point, this is not even a self-improving machine. It's problem in "weight space" that writes another program in "weight space". Cool but no guarantee it is self-improving. If a program writing in python writes another program written in Python to solve a particular problem, that's not (by default usually) recurrent self-improvement.

Edit: Also, neural networks that rewrite some of their parameters have existed since the 90s and Jurgen Schihuber (of course) showed these "fast-slow" networks were equivalent to linearalized transformers in the 2010s.

[1] https://en.wikipedia.org/wiki/G%C3%B6del_machine

benob 12 hours ago

I don't see how this relates to WSP. The agent wrote a program to extract statistics and trained a model on top of it. Besides, the comparison at same number of trainable parameters forgets the many non-trainable parameters. Equal memory/disk space would be more appropriate.

causal 11 hours ago

Yeah the title is a bit confusing:

> Initial Weights an LLM Can Write as Code

is a strange way to say "LLM-written code can initialize weights". It's still weight space programming, the code is not doing gradient descent.

suddenlybananas 12 hours ago

Yeah, it's a novel initialization rebranded as weight-space programming so that it sounds more ground-breaking than it actually is.

13rac1 11 hours ago

From the website:

> the model supports continual knowledge updates without training.

From the README:

> Limitations. The layer fires only when the subject appears verbatim, so aliases are missed. Answers are emitted verbatim. Reverse ("who coaches X" → "which team does Y coach") and multi-hop questions are not answered from an edit.

This method produces verbatim fact answer overrides: the answer is output when the subject appears verbatim. This isn't information the model can use, such as in reverse or multi-hop questions. I disagree with calling it "continual knowledge updates."

antonvs 9 hours ago

The website also mentions that implementation detail, under "How the edit layer adds a fact".

But agreed, this is not "continual knowledge updates" in the ML sense of updating a trained model's weights, although charitably the author might have though that "without training" clarifies that.

But in the end, it's just a narrow Q&A patch with severe limitations. The testing is weak, apparently designed to produce the most favorable result, and isn't compared to prior art.

The prior art on this avoided the "continual model update" language. The canonical examples, SERAC[1] and GRACE[2], use the term "model editing" or "memory-based model editing". Both are available on Github, so could have been compared against.

The author's preprint[3] cites GRACE, but not SERAC, which is unfortunate since SERAC is probably the closest architectural ancestor to this work.

[1] "Memory-Based Model Editing at Scale" (2022): https://proceedings.mlr.press/v162/mitchell22a/mitchell22a.p...

[2] "Aging with GRACE: Lifelong Model Editing with Discrete Key-Value Adaptors" (2022): https://arxiv.org/pdf/2211.11031

[3] https://www.preprints.org/frontend/manuscript/2edd007eee0f48...

lumost 12 hours ago

This looks roughly on par with “adding curated features to a small network gives a small boost.” The ablation is between the 103M parameter model with 8GB of weight space features and the 103M parameter model without, gaining only 11% on perplexity. I’d strongly expect this gain to disappear at larger model sizes.

nico 10 hours ago

> I’d strongly expect this gain to disappear at larger model sizes

How about smaller model sizes. Could the gain be larger?

lumost 8 hours ago

Custom features will generally have a bigger impact when you get smaller, as the neural layers have less ability to learn useful representations. That doesn't necessarily mean that the resulting model is faster/better than its larger counterpart. The proposal in this work involves processing several Billion parameters of "weights" to calculate features.

A more interesting ablation for this work would have been matching the size of the neural networks on either inference budget/parameters.

mycall 13 hours ago

Somehow reminds me of code = data in a lispy way.

randusername 12 hours ago

The premise that instructions are data is such an elegant through line of computing.

Von Neumann architecture to self-modifying programs to cybersecurity and now AI. Beautiful.

agnosticmantis 11 hours ago

This is sort of consistent with an older post on HN showing the process of setting weights by LLMs is similar to how an ML engineer reasoned about creating a model.

Here the LLM is creating the features (n-grams, skip-grams, etc.) and fitting a learned model on top via gradient descent.

MisterPea 11 hours ago

It's all Joever. Iterations on this has extremely large implications on alignment

djoldman 11 hours ago

At inference, you need 8GB of table data in addition to the ~103 million parameter model.

The paper essentially claims that for the same training compute you get perplexity like a network about 1.5x larger, but you have to use 8 GB of memory at inference time.

luka598 13 hours ago

Just skimmed but this looks like llm doing feature extraction and then training with gradient descent on those features, which i feel is something like these kind of tasks were done before compute heavy learning by destiling the original data using domain knowledge and then fitting a more general model on the destiled data. You just replaced human with a machine. And I guess a machine is also susceptible to bitter lesson.

edit: nvm I was mostly worng - llm edits weights of an additional layer

corvettez0606 13 hours ago

Soon someone will do something like this but with lifting layers from all the various open weight models to make a super model.

jdiff 12 hours ago

I don't think you get anything useful if you stitch a bunch of disparate, unrelated flakes of brain tissue together.

spyder 11 hours ago

This recent research could be a step towards that:

"Introducing Plato's Key. A single rotation lets independently trained LLMs use each other’s representations as their own. No gradients required"

https://hazyresearch.stanford.edu/blog/2026-11-25-platos-key

nishparadox 9 hours ago

algoth1 12 hours ago

akhilchaturvedi 12 hours ago

xelananv 13 hours ago

This is interesting! How much time do these compilations take, compared to training?

Sena_997 11 hours ago

very misleading title, like someone might assume that LLM wrote weights directly

vibebingo 4 hours ago

The lede is

> After pretraining, an external edit layer adds new facts without any training, enabling continual knowledge updates.

Assuming no smoke and mirrors that is fascinating.

But the bit before that is just some deckchairs then gradient descent.

sprinter123 7 hours ago

this seem less like an LLM and more like a network of very sensitive gates (ik how stupid i sound but there is no capability here to generalise to topics, or atleast, is not shown)

The testing is also shoddy

enjoyyourlife 11 hours ago

I wonder if it is possible to use an ontology to build an LLM. LLMs seem to be good for fast information retrieval

baq 12 hours ago

also compile z3 or a smaller sat solver into the weights and train the whole thing to use it

andai 7 hours ago

This is very interesting, though not (despite what the intro says?) to be confused with the recent "weight-space programming", where the LLM literally outputs the neurons directly (and/or adjusts them).

Here the LLM wrote a program ("compiler") which created a very unusual (hybrid?) LLM, and then the neural network part was trained as usual. The LLM did not write the weights.

I think some of the confusion may come from the original MIT post, which already bundled several techniques under the same umbrella. This paper, while very cool, appears to be stretching the terminology even further.

estebarb 9 hours ago

From what I understood the paper, they are basically hard wiring lots of context and continuations. Which kinda works, years ago it was called expert systems.

Not really what I expected from the title.

hoppp 13 hours ago

Continual knowledge updates sound good on paper but give it time with me and it'll learn to curse back like a mofo

mannyv 11 hours ago

Don't forget what 4chan did to that microsoft model.

SecretDreams 13 hours ago

You just described parenting, but really sped up.

Andrex 11 hours ago

AI rearing has so many similarities to parenting I stopped counting.

SecretDreams 10 hours ago

Andrex 11 hours ago

Tech overlords have yet to understand that's just how some people talk to each other.

https://www.youtube.com/watch?v=faENgCXC5Fg

partloyaldemon 9 hours ago

Everyone is interpreting. Anthropic‘s actions is paranoia with respect to nerfing ML work, but it could be out of a sense of weakness too.

parasti 10 hours ago

Seems Gemini also wrote 97% of bytes of the paper itself.

dude250711 13 hours ago

It must be tough being an ML specialist these days: do you want your account locked or do you want your work sabotaged.

boldbug 13 hours ago

how is this related to the post?

telesilla 12 hours ago

timcobb 12 hours ago

the work undercuts a lot of big lab LLM work, which results in either getting blocked from their platforms, or silently sabotaged

amelius 12 hours ago

It's great to be an ML specialist. It's the only job the AI labs will not automate away because all their responses in this field are sabotaged.

goosethe 9 hours ago

oh man someone should make this into a loop where the model can alter it weights after an inference. some kind of descent of the local gradient.

iantongeorge 11 hours ago

two specific mechanisms from this paper (wtable-lm) map almost 1:1 onto TempleRust's Ring-0 philosophy - COMING SOON

deadbabe 13 hours ago

Ok, so if we can do this kind of thing fast enough it seems like eventually we don’t need context we can just update weights with memory of every prompt and output built right into the model?

kalaksi 12 hours ago

Would that actually work any better?

logicallee 9 hours ago

Can someone explain how WSP (weight space programming, where the AI writes the weights to a NN directly, without gradient descent) works? How does the AI calculate what the weights should be?

gemini4neonhigh 5 hours ago

The AI does not magically "intuit" billions of inscrutable floating-point numbers. Instead, it calculates weights in one of two concrete ways depending on the task: acting like a compiler when building a network from scratch, or acting like a debugger when patching an existing trained model.

Full Neon 4 High Explanation: share.gemini.google/ZJcyudMXiVe6

zkmon 11 hours ago

Is this possible because the frontier models saw the weights of the open-weights models (and maybe their own)?

happyopossum 10 hours ago

No

blondie9x 13 hours ago

Where is it noted that Gemma 4 was used as the initial model?

spider-mario 12 hours ago

Not as the initial model. Rather (per the preprint),

> The compiler that builds the tables was designed by an LLM, Gemini 4 Neon [6]. Rather than writing weight values one by one, Gemini 4 Neon used corpus statistics as the initial weights, and it proposed a set of complementary channels, each capturing a different kind of regularity in text (Table 1).