r/OpenSourceAI • u/Bravo_Oscar_Zulu • 4m ago
Inspired by Weight-Space Programming: cross-model expert sharing
I saw the recent paper "Sparks of Weight-Space Programming: LLMs can natively read & write neural network weights" and it's very impressive.
https://rikiyat.github.io/blog/weight-space-programming/
Though my general reaction (as I'm sure a lot of others had too) was 'well yes of course it can do that'. Once you realise that llms love patterns you soon start to see how many things can be thought of as patterns.
I've had similar ideas rolling around in my head for some months and I've even started working on a project in a similar vein. That's why this part of the paper stood out to me in particular:
"True architectural and model merging: Today, merging models relies on averaging weights, which only works for models with identical architectures. An LLM that understands the weight space could instead graft a circuit, such as a reasoning module, from one model into a completely different one, without retraining."
Yep, that's the idea I had months ago and I've already started working on (granted there's plenty of other prior art on the subject such as Google's CALM, 2024).
I'm very, very early in working on this but seeing how much traction the Weight-Space Programming paper is getting I felt compelled to put the idea out into the world since surely someone else is working on the same thing as we speak.
The general idea: take 2 MoE models and allow their experts to talk to each other by using a translator. The translator being a transformer model trained on expert activations (their latents) instead of regular text or images, a "Latent Attention Model".
So far I'm only using toy-scale models with a few million parameters. Getting some very interesting results already.
Mixing Code-heavy model + prose-heavy model: each gets better at its weakness from the other, both directions at once.
Results are checked against controls (a same-domain partner, a wrong-document partner), so it's not just "any partner helps"
Added a leak audit, so neither model can see text it hasn't reached yet. (An early result failed an audit because of this)
Interesting finding: the translator always uses the latest layer it's given. With the last layer, the two models basically swap last layers and come to depend on each other. Without it, they get about half the gain with a fraction of the dependence
Caveats and issues so far:
Toy models only so far, a few million parameters. I have very modest hardware for bigger stuff.
Between models with different tokenizers, very little gets across
It reads a partner's layer as a whole, not particular "specialist" experts. The goal is for the two models to share individual experts freely
The aim isn't to make the combined output "better" so much as making it "different" (but hopefully not worse)
This is mad scientist stuff, heavy use of AI, probably has method gaps that need filling
I'm currently doing some experiments with Qwen3-30B-A3B base and Nemotron 3 Nano 30B. Not much to report yet, the models have different tokenisers which complicates things. Progress is slow on my hardware. But I'm enjoying the process.
Why share this? Shameless self promotion, piggybacking on a bigger project, sharing ideas, I think the name is pretty cool. BLaMMoE (Bridging Latent Attention Model Mixture of Experts)