How neural networks work
A step-by-step, non-technical explanation of what neural networks are made of and how they turn input into output, without diving into code or mathematics.
Approximate reading time: 12 min
Neural networks sit at the center of most recent progress in artificial intelligence, from image recognition to language generation. The name itself is borrowed from biology, since the earliest designs were loosely inspired by how neurons in the brain connect to one another. It is worth stating clearly from the start that this is a loose inspiration rather than an accurate model of how brains work; a neural network is a mathematical structure, not a simulation of biological tissue. Understanding what that structure actually consists of demystifies a term that is often used vaguely.
The basic unit: an artificial neuron
The smallest building block of a neural network is often called a neuron, node, or unit. Conceptually, an artificial neuron takes in one or more numbers as input, combines them using a simple mathematical rule, and produces a single number as output. That output can then be passed along to other neurons, forming a chain of small calculations that together perform a much more complex task than any single neuron could on its own.
It helps to think of a single neuron as a very small decision-maker. It looks at the values it receives, weighs how important each one is, and produces a response based on that weighted combination. On its own, this is not very powerful. The real capability of a neural network comes from connecting many of these simple units together into a larger structure.
Layers: how neurons are organized
Neurons in a neural network are typically organized into layers. The first layer, called the input layer, receives the raw data, such as the pixel values of an image or the numeric representation of a word. The final layer, called the output layer, produces the network's final result, such as a predicted category or a numeric value. Between these two, a network can have one or more hidden layers, so called because their values are not directly observed as input or output, but instead represent intermediate steps in the calculation.
Each neuron in one layer is typically connected to neurons in the next layer, and it is through this layered structure that a network builds up increasingly complex representations of the input. In tasks like image recognition, early layers might respond to very simple patterns, such as edges or contrasts in brightness, while later layers combine these simple patterns into representations of more complex shapes. This layered build-up is part of why the term "deep learning" refers specifically to networks with many layers stacked on top of one another.
Weights and biases, conceptually
Two terms that come up constantly when neural networks are discussed are weights and biases. Conceptually, a weight represents how much importance a particular input has when a neuron combines its inputs together. A higher weight means that input has a stronger influence on the neuron's output; a lower or negative weight means it has less influence, or pulls the result in the opposite direction. A bias is an additional adjustable value added to that combination, which allows a neuron to shift its output up or down independent of its inputs, giving the network additional flexibility in what patterns it can represent.
When a neural network is described as "learning," what is actually happening is that its weights and biases are being gradually adjusted, based on how well the network's current output matches what was expected. Nothing about the network's overall structure, the number of layers or neurons, typically changes during this process; only these internal numeric values are being tuned.
Activation: adding the ability to bend
If a neuron only combined its inputs in a simple weighted sum, an entire network built purely out of such neurons would behave in a fairly limited, straight-line way, no matter how many layers were stacked together. To allow networks to represent more complex, non-linear patterns, an additional step called an activation function is applied to each neuron's combined input before passing it along.
An activation function does not need to be understood in mathematical detail to grasp its role. Conceptually, it introduces a kind of bend or threshold into the neuron's response, allowing the network as a whole to represent curves, thresholds, and more intricate relationships between input and output, rather than being limited to simple straight-line combinations. This is a large part of why layered networks with activation functions can approximate extremely complex patterns, well beyond what simple weighted sums alone could achieve.
The forward pass: from input to output
When a trained neural network is given a new input, the process of computing an output is often called a forward pass. Data enters through the input layer, moves through each hidden layer in turn, being combined and adjusted at each neuron along the way, and finally produces a result at the output layer. This entire sequence typically happens very quickly, even for networks with a large number of layers and neurons, which is why trained systems can often respond to a request in a fraction of a second.
It is worth emphasizing that a forward pass, by itself, does not involve any learning. It is simply the network applying its already-established weights and biases to a new input. Learning happens in a separate process, described next.
Learning from error, at a high level
Training a neural network involves repeatedly showing it examples, comparing its output to the correct or expected answer, and adjusting its internal weights and biases to reduce the difference between the two. This difference is often referred to as an error or loss. Without going into the underlying mathematics, the general idea is that the network receives a signal indicating how wrong its output was, and that signal is used to figure out which weights and biases contributed most to the mistake, adjusting each one slightly in a direction expected to reduce the error next time.
This process is repeated across a very large number of examples, often many times over, gradually nudging the network's internal values toward a configuration that performs well across the whole dataset, not just any single example. It is this repeated, incremental adjustment, rather than any single dramatic step, that produces a trained network capable of useful predictions.
Deep vs. shallow, and why depth helps
A "shallow" network generally refers to one with very few hidden layers, while a "deep" network has many. Depth matters because each additional layer gives the network another opportunity to combine and recombine patterns detected by earlier layers into something more abstract or complex. In many tasks, particularly those involving rich, high-dimensional data such as images, audio, or natural language, deeper networks have been shown to capture more useful structure than shallow ones, which is a major reason "deep learning" became the dominant approach in many areas of AI.
That said, depth is not automatically better in every situation. Deeper networks generally require more data and more computational resources to train effectively, and beyond a certain point, adding more layers can introduce its own difficulties rather than continued improvement. Choosing an appropriate depth is part of the broader design process, not a simple rule of "more layers is always better."
Key limitations
Despite their capabilities, neural networks come with well-known limitations that are important to keep in mind when interpreting what they can and cannot do.
- Data hunger: effective training typically requires large amounts of example data, which can be costly or difficult to obtain for some tasks.
- Opacity: the internal reasoning of a trained network, spread across potentially millions of individual weights, is not easily interpretable by humans, which is why neural networks are often described as "black boxes."
- Sensitivity to training data quality: a network can only learn patterns present in its training data, including any biases or gaps in that data.
- Computational cost: training large, deep networks can require significant computing resources and time.
- Brittleness outside familiar patterns: networks can behave unpredictably when given inputs that differ substantially from anything seen during training.
These limitations do not diminish the practical usefulness that neural networks have demonstrated across many fields, but they are essential context for interpreting any specific claim about what a neural-network-based system can reliably do.