A neural network does not store facts. It stores a compressed map from inputs to outputs, learned from whatever examples it was trained on. When you ask it about something outside that map, it does the only thing it knows how to do: it interpolates. The result is fluent, confident, and often wrong. That is a hallucination.
This lab makes the mechanism visible. You train a small real network on a labeled pattern, then probe it with inputs it has never seen. The decision surface on the left shows what the network actually believes across the whole input space. The bars on the right show its softmax output â the confidence it attaches to each answer. Watch what happens when you probe far from the training data: the confidence stays high even as the answer drifts away from anything true.
This is a deliberately tiny network â a single hidden layer trained with plain gradient descent in your browser. It is not a language model and it does not reproduce the specific failure modes of any commercial system. What it does reproduce is the structural reason those failures happen: a network trained on a finite sample, asked to answer outside that sample, with no built-in signal for "I don't know."
Softmax normalizes the raw scores into a probability distribution. If the top score is even slightly ahead of the others, the top probability can be well above 50%. The network has no separate "unknown" output. Some systems add one â an abstain class, a distance threshold, or an ensemble disagreement check â but a plain classifier does not.
Label noise flips a fraction of the training labels before training. The network then has to fit contradictory examples, which distorts the decision surface and makes its confidence less meaningful. In real systems, noisy labels come from bad annotation, scraped data, or stale facts.
The canvas samples a grid of points across the input space, runs each through the trained network, and colors the cell by the network's top class. The brightness reflects confidence. You can see the boundaries the network has learned â and where those boundaries extend past the training data.
Yes. Training and probing happen entirely in your browser. Nothing is uploaded. The export is a local JSON file.