Qwen 3.8 27B interprets raw neural network weights on a laptop
Simon Willison demonstrates that Qwen 3.8 27B can identify game-playing policies by analyzing raw model weights, replicating findings from the recent 'Sparks of Weight-Space Programming' paper.
A new research note titled "Sparks of Weight-Space Programming" claims that large language models can interpret and modify raw neural network weights without executing code. Simon Willison tested these claims using Qwen 3.8 27B on his local hardware, confirming that the open-weight model can successfully identify the behavior of simple reinforcement learning agents just by reading their weight matrices.
What happened
Researchers Rikiya Takehi, Jayden Teoh, Alex Zhang, and Omar Khattab published a document they describe as a "blog post" but which resembles a technical paper. They introduced the concept of Weight-Space Programming, arguing that frontier models like GPT-6 Astra can analyze raw floating-point numbers representing a neural network to determine its function. The authors further claimed these models could edit weights to improve performance or generate new networks from scratch, outperforming traditional training methods in specific small-scale tasks.
The core experiment involved four small neural networks trained via reinforcement learning to play simplified 10x10 grid versions of Breakout, Pong, Pac-Man, and Freeway. The researchers fed the raw weights of these networks into an LLM with a strict prompt: identify the game based solely on the weights, with no access to code execution, calculators, or external tools. The goal was to test if the model could understand the structural implications of the weight values directly.
Willison replicated this experiment using Qwen 3.8 27B, a model he runs locally on his laptop. He used the llm command-line tool with the lmstudio plugin to feed the same prompts from the researchers’ GitHub repository into the model. Despite the computational intensity and long context requirements, Qwen 3.8 27B successfully identified the games for three of the four tests, demonstrating that this capability is not exclusive to proprietary, closed-source frontier models.
How it works
Weight-Space Programming relies on the LLM’s ability to process long sequences of numerical data as text. Neural network weights are essentially arrays of floating-point numbers that define how inputs are transformed into outputs. By treating these numbers as a textual description, the LLM analyzes patterns, magnitudes, and distributions within the matrix. It attempts to reverse-engineer the logic embedded in those numbers, mapping specific weight configurations to known computational behaviors or game mechanics.
In Willison’s test, the model received a text file containing thousands of floating-point values. It had to correlate these values with the spatial structure of a 10x10 grid. For example, it looked for patterns indicating an agent’s position, moving obstacles, or reward targets. The model generated extensive reasoning traces, attempting to map specific rows and columns in the weight matrix to physical elements in the game environment, such as paddles, balls, or walls.
This process does not involve running the neural network or simulating the game. Instead, it is a static analysis task performed entirely within the language model’s context window. The model uses its internal knowledge of how neural networks are typically structured and trained to infer the purpose of the provided weights. It identifies clusters of high or low values and associates them with functional components like input sensors or output actuators.
Key details
- Qwen 3.8 27B correctly identified Pac-Man after 46 minutes and 12 seconds, processing 43,506 reasoning tokens.
- The model identified Pong in 1 hour, 4 minutes, and 54 seconds, assigning a 75% confidence level to its conclusion.
- Breakout was identified in 52 minutes and 25 seconds with an 88% confidence score, describing the paddle and brick mechanics accurately.
- Qwen failed to identify Freeway, incorrectly guessing it was a Pac-Man-like game, likely due to the obscurity of the 1981 Atari title.
- The experiment required a long context window; the default 8192 token limit caused errors, necessitating a larger configuration in LM Studio.
- The original paper also claimed models could edit weights to fix reasoning loops, improving Qwen3.5-0.8B math scores from 7.9% to 48.1% on MATH-500.
Why it matters
For software engineers and ML practitioners, this demonstration suggests that LLMs are developing a deeper structural understanding of machine learning models themselves. If a model can read weights and infer behavior, it opens the door to automated debugging and optimization tools that do not require retraining. This could significantly reduce the computational cost of refining small models, allowing developers to tweak performance by editing weights directly rather than running expensive gradient-based training loops.
However, the results also highlight significant practical limitations. The time required for Qwen 3.8 27B to analyze a tiny 10x10 grid network was nearly an hour per game. This latency makes real-time weight-space programming impractical for most current applications. Furthermore, the failure on the Freeway prompt indicates that the model’s success depends heavily on its training data familiarity with specific game mechanics, rather than a universal understanding of all possible neural network functions.
The distinction between static analysis and dynamic execution remains critical. While the model can interpret weights, it does not "run" the model in the traditional sense. This means that while it can identify broad behavioral patterns, it may miss subtle runtime dynamics or edge cases that only appear during actual inference. Developers should view this as a complementary analytical tool rather than a replacement for standard testing and validation pipelines.
What you can do
- Install the
llmcommand-line tool and thellm-lmstudioplugin to replicate these experiments locally. - Download Qwen 3.8 27B or a similar open-weight model capable of handling long context windows.
- Access the
RikiyaT/lm_understand-logsrepository on GitHub to retrieve the original prompts and weight files. - Configure your local inference engine to support context windows larger than 8192 tokens to avoid truncation errors.
- Experiment with other small, pre-trained neural networks to test if the model can identify their functions without code execution.
- Review the reasoning traces generated by the model to understand how it maps numerical patterns to logical structures.



