Developer Compiles NPU and Runs Stories260k Inside Qwen LLM Weights
A developer successfully built QwenPU, a custom Neural Processing Unit compiled directly inside the weights of the Qwen 3.5-4B large language model. This setup allows Andrej Karpathy's stories260k language model to run natively using Qwen's internal memory and resources without any external tools. This creative engineering achievement pushes the boundaries of in-context computing and model capability by demonstrating that complex neural network execution logic can be embedded directly within model weights. It opens up novel possibilities for running nested AI architectures and localized execution paradigms within a single LLM. The stories260k model operates as a C program where matrix multiplications, softmax, and attention mechanisms are executed bit-exact by the compiled NPU. The entire execution relies entirely on Qwen's internal memory space, with ongoing optimization efforts focused on reducing size and improving execution speed.
## BACKGROUND
Large language models are advanced machine learning systems trained on vast datasets to process and generate text by predicting subsequent tokens. Building upon previous experiments that embedded a RISC-V CPU into Qwen weights using state mechanisms as RAM, this project extends the concept to emulate a specialized neural processing unit.