AI Glossary

Perceptron

A perceptron is a simple classifier that multiplies inputs by weights, adds a bias and applies a threshold to produce a class label. The basic single-unit perceptron draws a linear decision boundary in its input features.

· Updated · Chain of Thought

Model Architecture

Consider two switches represented by inputs 0 or 1. With both weights set to 1 and a bias of −1.5, the score is x₁ + x₂ − 1.5. Output 1 when that score is positive and 0 otherwise. Only two on switches give a positive score, so this perceptron computes the logical AND operation.

In the basic learning rule, a misclassified example triggers an adjustment to the weights and bias. The classifier can learn a separating boundary when the examples are linearly separable. If they are not, that rule does not guarantee training will reach zero errors.

The limit is visible in exclusive OR (XOR): the label is 1 when exactly one switch is on. No single straight line separates those cases in the original two-input plane. Additional nonlinear features or hidden layers can represent a boundary the plain perceptron cannot. This matters when distinguishing a single perceptron from a multilayer perceptron, which combines units and nonlinear transformations.

A perceptron can compute ANDFor two binary switches, each weight is one and the bias is minus 1.5. The score is x1 plus x2 minus 1.5; output one when positive and zero otherwise. Only two on switches produce one. A single linear boundary can separate AND, but cannot separate XOR in the original two-input plane. A perceptron can compute AND Multiply inputs by weights, add a bias, apply a thresholdx₁ = 1, w₁ = 1x₂ = 1, w₂ = 1Score = 1 + 1 − 1.5Score = 0.5Bias = −1.5Score is positiveOutput = 1AND outputs: 00 → 0 | 01 → 0 | 10 → 0 | 11 → 1Only two on switches cross this threshold.One linear boundary cannot model XOR in these same inputs.
A worked AND example using the threshold unit explained by Jurafsky and Martin. Nonlinear features or hidden layers are needed for XOR in these original inputs. Download the image

Sources

Go deeper

  • 3Blue1Brown: But what is a neural network? video

    Visualize weights and activations, then see why combining units matters.