Qwenputer: A functioning, deterministic RISC-V CPU inside Qwen3.5

Posted by csmantle 5 hours ago

Counter260Comment60OpenOriginal

Comments

Comment by tiborsaas 3 hours ago

This is fun and games, but wait until an agents finds this and does the most misaligned thing with it in order to fold paper clips.

> Because a CPU inside a language model clearly wasn't cursed enough, I decided the prudent thing would be to give it a filesystem too.

Love the spirit :)

Comment by nico 15 minutes ago

Awesome... in the same spirit, here's a cursed source control system for it: https://nicobrenner.github.io/lossy-git/demo.html

Or the cli version if preferable: https://nicobrenner.github.io/lossy-git/

Comment by DonHopkins 1 hour ago

For safety, it needs an HCF instruction.

Not only can it solve the halting problem, but also the ignition problem!

Comment by jedbrooke 40 minutes ago

I wonder if this approach would work for AdderBoard[1][2] (a competition to make hand written transformers that can add two 10 digit numbers in the least amount of parameters possible), or if it uses way too many parameters to be competitive

[1]: https://github.com/anadim/AdderBoard [2]: hn discussion https://news.ycombinator.com/item?id=47170030&utm_source=per...

Comment by jerrythegerbil 3 hours ago

There was an interesting bit of research that qwen has a single neuron that makes it “demonic evil qwen” and a simple “Who are you?” will get some absolutely terrifyingly vile results.

Anyways, what I’m trying to say is I want evil qwen to be my CPU.

Comment by krackers 3 hours ago

The single-neuron steering stuff has been going around twitter lately, do you happen to know who was the first one to do it?

I wonder how this squares with the recent "NNs are already clean" interpretability finding, which may have also been the impetus for this kind of research. Similar to their work on CNNs, maybe residual-steering is overkill, there might be just a single neuron that "cleanly" corresponds to "evilness" that you can turn up/down?

Comment by ollin 2 hours ago

Comment by fy20 14 minutes ago

There was a paper that popped up a month or two ago (I think published earlier though) about being able to inject "thoughts" into the neurons. E.g. Ask it what I should eat, and steer it towards "bread".

Comment by kridsdale1 2 hours ago

Well I think the first big publication on this front was Anthropic’s Golden Gate Bridge neuron.

Comment by frotaur 1 hour ago

This was not a neuron. This was from a trained sparse auto encoder.

In a few words, they found a way to map residual stream activations (so, a vector) into a few interpretable sparse concepts. They also had the converse maps, that translate concepts into activations.

Golden Gate claude was obtained by artificially increasing the activations in the direction of the 'Golden Gate' concept. It was not neuron surgery.

Comment by krackers 1 hour ago

You don't even need SAE for residual stream based steering, you can do so much more naively by just taking the average difference in activations of prompted vs. unprompted versions, then PCA to get a "control vector" that you can use to elicit the prompted behavior

https://vgel.me/posts/representation-engineering/

Comment by 42 minutes ago

Comment by jacquesm 38 minutes ago

Heh, this is very timely, it is more or less exactly what I'm busy with right now but I'm taking the idea in a completely different direction. Fascinating.

Comment by giveexamples 2 hours ago

https://www.percepta.ai/blog/can-llms-be-computers

They implemented wasm in transformer with cpu decoding for the wasm part.

Comment by jazzyjackson 4 hours ago

> When Qwen 'saves' a file, the compiled layers hash its name into one of 1,024 slots in a directory kept in the DeltaNet state, and store the text itself in other heads, with eight tokens per row, chained together

I’ve never wanted to learn how LLMs work more than reading this. Fascinating.

Does divagr get paid to do wild things with LLMs? Just curious if they’re being compensated for these wild experiments

Comment by Tuna-Fish 1 hour ago

Learning the basics of how LLMs work is legitimately doable in a weekend if you have ever passed a linear algebra course.

If you are actually good at linear algebra, it's doable in an afternoon.

They are fantastically simple in structure, all the intelligence is in the massive piles of data in them, not their structure. Then there is of course a lot of room in optimization once the basics are done.

If interested, maybe start here: https://www.deeplearning.ai/courses/how-transformer-llms-wor...

Comment by fnord77 47 minutes ago

A bit more than that. You need to understand Hessians to compute the loss function efficiently

Comment by hislaziness 13 minutes ago

This is amazing, now waiting for someone to run an llm on the cpu. Eventually it will be LLMs all the way down...

Comment by v3ss0n 8 minutes ago

And -- that is our reality.

Comment by hypfer 2 minutes ago

Is this supposed to play Linkin Park in my head or is that a neuron misfire?

Comment by traverseda 4 hours ago

I'd be very interested in how a scratch trained model that started training with this neural circuitry would behave. Especially the storage space.

Comment by horacemorace 3 hours ago

Along these lines I’m curious how a scratch trained model with a few built-in tools (memory, calculator, ?) available during a single generation would behave. Not tool calls as turns.

Comment by low_tech_punk 3 hours ago

a single generation would still allow looping in the "CPU" because the instruction set can do it. The model is almost a Turing machine (except for the limit on memory)

Comment by qwertyforce 1 hour ago

As I understand, the problem of continual learning is that if you continue training, it will "overwrite" previous knowledge and this CPU will be lost

Comment by im3w1l 44 minutes ago

There is nothing in theory preventing you from training while keeping a subset of weights locked.

Comment by LoganDark 38 minutes ago

How do you ensure that subset of the weights will continue to be accessible through the others?

Comment by im3w1l 33 minutes ago

I don't understand your question.

Comment by nghiemphucminh7 1 hour ago

[flagged]

Comment by andai 2 hours ago

> Now, here's where our fun experiment starts. I found out that by setting the gate to 1,1 the write strength (beta) to 1,2 and using one-hot key encoding,3 every write we perform will overwrite exactly one row, and every one-hot query can retrieve an exact value. This means that the GDN layers themselves can work exactly as RAM, at a far lower cost than using normal attention as RAM, since a GDN head's state stays the same size however long the conversation gets, unlike attention's KV cache.

So like... can't you use a computer as a computer without doing all that roundabout stuff? Like if you want to integrate a LLM with hard computation there's probably a more efficient way to do that.

Or is this building towards "but can it run DOOM?" :)

Comment by rao-v 2 hours ago

I’ve always wondered why we don’t add a few frozen “layers” to models that perform complex computations 2/3rds deep in the model. Some set of steerable fft + some common vector math operations could be reusable units of capability that the model learns to leverage during training.

Given that models learn to use residual connections optimally, it can’t be hard for them to steer around the fixed computation layer when it’s not needed.

I’m sure giant models invest a few layers in reproducing these functions, but surely smaller models can benefit?

Comment by DonHopkins 1 hour ago

[dead]

Comment by mkturkcan 2 hours ago

Nice project and write up! I’ve done similar work with a custom tiny network I call Loom at https://arxiv.org/abs/2604.08816 ; you need far fewer layers, and you can run Doom, very slowly: https://mehmetkeremturkcan.com/Loom/demos/

Comment by Founderarcstone 8 minutes ago

That’s great new!

Comment by Ericson2314 1 hour ago

The real question is, do current training methods allow one to learn this when training on enough, say, assembly, or can the weights only be achieved via hard-coding?

A fun and important thought experiment about the the space of nerual networks vs the image of current training methods.

Most discourse conflates neural networks and trainable neural networks.

Comment by bronlund 3 hours ago

No, I don’t want you to use the computer, I want you to be the whole computer. No mistakes.

Comment by throwaway81523 37 minutes ago

Wow! I wonder if it can start programming itself soon.

Comment by blurbleblurble 2 hours ago

This is cool but it'd be way more useful if they had made a GPU, seeing as how expensive those have gotten

Comment by incognition 2 hours ago

Uh here the gpu runs the cpu but you want the gpu to run a gpu? Or cpu emulation of Gpu?

there's no free lunch here ever hence the cursed

Comment by ydj 1 hour ago

I dare say that’s the joke.

Comment by yaoke259 3 hours ago

It could be interesting to experiment with more complex representations in the memory/file system, i.e. vectors. Seems like the full advantage of this architecture is yet to be explored. Blending neurons with deterministic compute to fit on one GPU is a fascination concept, never considered it before!

Comment by lacoolj 2 hours ago

I 100% see the potential here and am dying to see it in 30 days

Or maybe ill join your discord and hopefully we can riff it out to get there faster

Comment by jonrouach 2 hours ago

i wonder if you could implement "authenticated token authorship" and self-verified running with this. the model verifies an input as signed by an authorized requester, and signs its own outputs. eventually it also authenticates its own running via e.g. snarks? :) there's lots of meta available with these toys..

Comment by farhanhubble 4 hours ago

This is cool and I understand the RAM emulation with gated attention but how does the CPU emulation wor? You add layers that are then trained to predict outputs while interpreting RISC instructions?

Comment by bee_rider 4 hours ago

I think they describe the CPU using the weights? I mean in some sense a CPU can be viewed as just a function, right?

Comment by anon291 3 hours ago

At each cycle, a cpu is a simple function from the previous state to the next state.

Comment by zardo 3 hours ago

How much VRAM do I need to run DOOM?

Comment by voxelghost 3 hours ago

Makes me want to run agents on it

Comment by dools 2 hours ago

Have you any idea how it feels to be a Qwenputer living in a Qwenbot's Qwenputer's world?

Comment by rumwerfer 3 hours ago

But can it run Doom?

Comment by 0x20cowboy 1 hour ago

This is very clever. An inversion of tools. Awesome.

Comment by 3 hours ago

Comment by seba_dos1 3 hours ago

Now run LLM inference on it.

Comment by deepsquirrelnet 3 hours ago

butterfly Is this AGI?

Comment by serf 3 hours ago

this is the sensation I get when I run nested VMs.

Comment by fr2029r 21 minutes ago

[dead]

Comment by favori995749721 2 hours ago

[flagged]

Comment by hujun236 2 hours ago

[flagged]

Comment by cinderwick 3 hours ago

[flagged]

Comment by rickcarlino 3 hours ago

If anyone else has an easier way to emulate RISC-V I’d like to hear it. /S

Comment by gigel82 4 hours ago

But... why? </s>

This reminds me of C++ Template Metaprogramming (TMP) (it's Turing-complete so people wrote "games" that run at compile time). The same with TypeScript types, I think someone got DOOM running entirely in the TypeScript type system. An interesting tech demo but entirely superfluous.

Comment by 4 hours ago

Comment by ansk 2 hours ago

[flagged]

Comment by fudged71 2 hours ago

Be more specific with criticism

Comment by ansk 1 hour ago

This perspective -- that the burden of proof is on the experts to disprove the slop -- is exactly what I think is unsustainable.

Comment by rvz 4 hours ago

So this is yet another rube goldberg machine.

We have gone down this path already in [0] and this is the same thing but overly complicated. This reason is "because LLMs".

Why?

[0] https://arxiv.org/abs/1410.5401

Comment by jwitthuhn 3 hours ago

It is a great example to refute the common misconception that LLMs are inherently non-deterministic. I see people repeating this a lot and being able to point at a CPU implemented within one is a very strong counter-example.

Comment by rvz 1 hour ago

> It is a great example to refute the common misconception that LLMs are inherently non-deterministic.

No it isn't.

Realistically the opposite is true in practice and LLMs are really non-deterministic beyond simplistic experiments such as this in useful activities in production. Even with hacks such as "setting temp=0" (which no-one seriously does) to "achieve determinism", was one of the most common misconceptions ever propagated by "AI engineers".

So using tiny slop experiments aren't really useful as a "strong counter-example". In fact this is a very weak one.

Comment by ram_rattle 4 hours ago

Cool cool cool

Comment by crossgrainlab 1 hour ago

such a nice page. The font and the background colour are comfortable for my eyes to read the context.