Toy Models of Superposition

Exploring AI Compression: How Simple Networks Visualize Complex Patterns

A tiny network trained to compress data drew a pentagon.

4 min readTowards Data Science
Exploring AI Compression: How Simple Networks Visualize Complex Patterns

There is a particular kind of joy that comes from building something small and watching it do something unexpectedly profound. The recent journey of reproducing Anthropic's "Toy Models of Superposition" from scratch in NumPy, with hand-derived gradients and no borrowed numbers, is exactly that kind of experience. It is one thing to read about how neural networks compress information; it is another to feel the weights shift under your own calculations and see a pentagon emerge as the visual answer to a deceptively simple problem. This is not about building a larger model or chasing a new benchmark. It is about understanding the fundamental geometry of how AI makes sense of complexity, and that is a lesson worth exploring.

We often talk about AI as if it were a black box, a mysterious entity that either works or does not. But this exercise pulls back the curtain in a way that feels almost radical in its simplicity. By stripping away the borrowed numbers and pre-trained shortcuts, the author forces us to confront the raw mechanics of superposition, the trick where a network uses a high-dimensional space to store more features than it has dimensions. The result, a pentagon, is not just a pretty shape; it is a map of the network's internal logic. This connects directly to broader discussions about how AI navigates structure, whether it is the Exploring Paragraph Structure: How LLMs Navigate Token Space or the way models compress language into coordinate systems. The principle is the same: understanding the geometry is understanding the model.

For our readers, the takeaway here is not that you need to go re-derive gradients by hand. The takeaway is that the tools we use every day are built on principles that are, at their core, learnable and observable. When you understand that a tiny network can visualize a pentagon, you start to see that the complexity of a large language model is not an insurmountable wall but a series of layered, comprehensible patterns. This is the same spirit that drives other explorations in our publication, where the focus is on demystifying the technology rather than treating it as magic. The fact that this was done with just NumPy, a library many of us use for data manipulation, makes it feel accessible. It is a reminder that you do not need a supercomputer to have a meaningful insight; you just need a clear question and the willingness to follow the math.

What we would tell a reader who asks about this is simple: do not let the title fool you into thinking this is just a technical curiosity. This is a masterclass in the value of first principles. In a field that often feels dominated by massive scale and opaque architectures, there is a profound sense of control in building something from the ground up. It is the difference between reading a map and walking the terrain. As we see companies like Anthropic Explores Akamai's Cloud for AI-Native Workloads make massive infrastructure bets, the underlying physics of the models remain the same. The question we should all be asking is not just "What can these models do?" but "What is the simplest possible way to see why they work?" This hands-on reproduction is a concrete answer to that question. The specific detail to watch is whether this kind of hands-on reproduction becomes a standard practice for developers, or if it remains a niche exercise for the curious. For now, it is a compelling argument that the most profound insights often come from the smallest, most deliberate experiments.

From Towards Data Science

Reproducing Anthropic's "Toy Models of Superposition" from scratch in NumPy, with hand-derived gradients and no borrowed numbers.

The post I Trained a Tiny Network to Compress Data. It Drew a Pentagon. appeared first on Towards Data Science.

Read the original at Towards Data Science