Foundations
The perceptron
A perceptron thresholds a weighted sum to draw one learned linear boundary — and one row of a Qwen3.8-27B weight matrix is that same weighted sum, minus the threshold and minus the mythology.
Updated
01 · Concept
Concept
Start with a problem that has nothing to do with neural networks. A bag arrives at a museum entrance and you have two measurements: the number of metal objects detected, and whether the visitor carries a verified equipment tag. You must decide, from those two numbers alone, whether to inspect the bag. You could write rules by hand. Instead, suppose you are given a few hundred past bags with the correct decision attached, and you want the machine to find the rule. What is the simplest device that can learn one?
The answer, from 1958, is the perceptron. It takes a feature vector , stores one number per feature in a weight vector , adds a bias , and computes a single score
If is positive it predicts one class, if negative the other. That is the whole device: a weighted sum and a threshold.
Each weight says how one feature moves the score. A positive weight raises the score as its feature grows; a negative weight lowers it. Magnitude reflects sensitivity in whatever units the feature arrives in, which is why feature scaling matters — a measurement that ranges over thousands will dominate one that ranges over zero to one, whether or not it is more informative. The bias is the intercept, the score when every feature is zero. It slides the whole policy toward leniency or strictness.
Work one example through by hand. Let metal count be and equipment tag be , and suppose training has landed on with . A bag with four metal objects and no tag scores , which is positive, so it is inspected. The same four objects carried by a tagged technician score , which is negative, so it passes. The tag weight is large enough to cancel two and a half metal objects. In two dimensions the boundary is a straight line, the vector points perpendicular to it, changing the weight ratio rotates it, and changing slides it without rotation. In more dimensions the same equation describes a hyperplane.
Learning is mistake-driven. For a misclassified example with labels encoded as and , one classic form updates and , with learning rate . A positive example wrongly predicted negative pulls the weight vector toward that input; a negative example wrongly predicted positive pushes it away. Correctly classified examples trigger nothing. If the data really is linearly separable, the perceptron convergence theorem guarantees this procedure stops making mistakes after finitely many updates. It does not promise the widest margin, calibrated probabilities, or good behavior on new bags.
Now the classic wrong turn, and it is worth walking into deliberately. Take the XOR pattern: label and as one class, and as the other. Train the perceptron; it oscillates. The instinctive diagnosis is an optimization problem — lower the learning rate, run more epochs, try a different initialization. All of that is wasted effort. Draw the four points and try to separate the diagonals with a ruler: it cannot be done. The failure is representational, not numerical. No values of and exist that classify all four correctly, so no procedure for finding values can succeed. Fixing it requires changing the representation — adding a transformed feature such as , or composing several units with a nonlinearity between them, which is exactly the move lesson 2.2 makes.
The hard threshold has a second defect that shaped everything after it. Its derivative is zero almost everywhere and undefined at the boundary, so gradient-based learning has nothing to work with. Modern classifiers keep the linear score and replace the step with something differentiable — a sigmoid, or the softmax of lesson 0.3 — then apply a decision threshold afterward if a decision is needed at all.
So the perceptron is not merely a museum piece. It teaches the geometry that survives at every scale: learned weights define a direction, the bias defines an offset, a dot product scores compatibility, and a model can only separate what its representation makes separable. When you inspect any fitted linear boundary, plot the examples and the margin rather than reporting accuracy alone — a separator can classify a small sample perfectly while sitting so close to every point that measurement noise flips the decision.
02 · Analogy
Analogy
A museum guard scores each bag using a checklist: metal-object count weighs positively, a verified equipment tag weighs negatively, and a baseline bias shifts strictness. The scores are added. Above a threshold the bag receives inspection; below it passes. Changing weights rotates the policy's boundary, while changing the bias slides it. No matter how the checklist is tuned, one straight boundary cannot isolate visitors arranged in an XOR checkerboard.
03 · Teach it back
Teach it back
Explain the perceptron's weighted sum, bias, threshold, learning update, and linear-separability limitation with a two-feature example, then say where that same weighted sum reappears inside a modern language model.
Compare with a model answer
For features x, the perceptron computes z=w·x+b and assigns a class from the sign of z. In two dimensions z=0 is a line; weights set its orientation and bias shifts it. On a misclassified example, the update moves weights toward the correct labeled input. If no line separates the classes, as in XOR, updates cannot converge to a perfect separator because the limitation is representational, not an optimizer failure. Inside Qwen3.8-27B, one row of a weight matrix computes exactly the same dot product against a 5120-dimensional hidden vector; what modern layers drop is the hard threshold, replaced by a smooth activation so gradients can flow.
04 · Check your understanding
Check your understanding
Complete the teach-back and answer the quiz correctly to finish this lesson.
◎ · Evidence marker
Sources
- Frank Rosenblatt (1958). The Perceptron: A Probabilistic Model for Information Storage and Organization in the Brain.
- Qwen Team (2026). Qwen3.8-27B Model Card.
- Qwen Team and Hugging Face (2026). Qwen3.5 model implementation.