What is a neural network? Explained simply, layer by layer

Neural networks power face unlock, translation and every modern chatbot. Despite the name, they are layers of simple maths, not artificial brains. Here is how a neural network works, how it learns, and the main kinds.

A neural network drawn left to right. Three input circles labelled with features of a fruit (colour, shape, size) connect by lines of different thickness (thicker means a bigger weight, red means a negative weight) to a hidden layer of four circles, which connect to two output circles labelled apple 0.92 and orange 0.08. A magnified view of one hidden neuron shows it multiplying each input by a weight, adding them up with a bias, and passing the total through an activation.
Fig. 1 — A neural network: inputs flow through layers of simple units. Each connection has a weight, and training adjusts those weights. (Numbers are illustrative.)

When you unlock your phone with your face, translate a sign with your camera, or ask a chatbot a question, a neural network is doing the work. It’s the technology behind almost every big AI breakthrough of the last fifteen years.

The name makes it sound like an artificial brain. It isn’t. A neural network is a big stack of very simple calculations, loosely inspired by how brain cells connect. Each calculation is easy; the power comes from having millions or billions of them, all tuned by learning from examples. This guide explains how a neural network works, how it learns, the main kinds, and where the idea came from.

What is a neural network?

A neural network is a type of machine learning model made of many small connected units, called neurons, arranged in layers. Data goes in one end, flows through the layers, and a result comes out the other end. The network learns by adjusting the strength of the connections between neurons.

It’s part of machine learning: the network isn’t given rules, it learns them from examples. When a neural network has many layers, the approach is called deep learning. “Deep” just means “many layers”.

The parts of a neural network

Neurons

A neuron (also called a node or unit) is a tiny calculator. It does three things:

  1. Multiplies each number coming in by a weight.
  2. Adds them all up, plus one extra number called a bias.
  3. Passes the total through an activation function, a simple rule that decides how strongly the neuron “fires”. A common one, called ReLU, turns negative numbers into zero and leaves positive numbers unchanged.

That’s all a single neuron does.

Weights and biases

Weights are the most important numbers in the network. Each connection has its own weight, which says how much one neuron’s output matters to the next. A big positive weight means “this matters a lot”; a weight near zero means “ignore this”; a negative weight means “this counts against”. The bias shifts a neuron’s total up or down. Together, weights and biases are the network’s parameters, and they are what the network learns. (Weights get their own letter, W.)

Layers

Four columns of circles. The input layer on the left receives raw data, such as the pixels of a photo. Two hidden layers in the middle are labelled simple patterns such as edges, and bigger patterns such as shapes. The output layer on the right gives the answer: cat 0.95, dog 0.05. Lines connect every circle in one column to every circle in the next.
Input layer, hidden layers, output layer. In an image network, early layers tend to pick up simple patterns and later layers combine them into bigger ones. (Illustrative.)
  • The input layer receives the data, turned into numbers: the pixels of a photo, the sound levels of a recording, or the tokens of a sentence.
  • The hidden layers in the middle transform those numbers step by step. In an image network, early layers tend to respond to simple things like edges and colours, and later layers combine them into shapes, textures and whole objects.
  • The output layer gives the answer, often as scores, for example “cat: 0.95, dog: 0.05”.

Nobody tells the hidden layers what to look for. They learn useful patterns on their own during training.

How does a neural network learn?

A brand-new network has random weights, so its answers are nonsense. Training fixes that, one small step at a time:

  1. Forward pass. Feed in a training example, say a photo labelled “cat”, and let the network make a guess.
  2. Measure the error. Compare the guess with the right answer. The size of the mistake is called the loss.
  3. Backpropagation. Work backwards through the network to calculate how much each weight contributed to the mistake.
  4. Gradient descent. Nudge every weight a tiny bit in the direction that makes the mistake smaller.
  5. Repeat, over thousands or millions of examples, many times.

Think of tuning a big mixing desk with thousands of knobs while listening to a song. You can’t set each knob by reasoning; you nudge them all a little, listen if it sounds better, and repeat. Backpropagation tells you which way to turn each knob.

After training, the weights are saved and frozen, and the network is used on new data. That’s called inference.

The main kinds of neural networks

  • Feedforward networks (multi-layer perceptrons): the basic kind described above. Data flows one way, from input to output.
  • Convolutional neural networks (CNNs): designed for images. They scan small patches of a picture with the same set of weights, which makes them good at spotting a pattern wherever it appears. Used in photo apps, medical scans and object detection.
  • Recurrent neural networks (RNNs): process sequences one step at a time, passing a memory forward. They were widely used for speech and text before transformers.
  • Transformers: introduced by Google researchers in 2017. They use a mechanism called attention to weigh how every part of the input relates to every other part. Transformers power today’s large language models and many image and speech models too.

A short history

  • 1943: Warren McCulloch and Walter Pitts describe a simple mathematical model of a neuron.
  • 1958: Frank Rosenblatt describes the perceptron, an early neural network that could learn from examples.
  • 1986: an influential paper by David Rumelhart, Geoffrey Hinton and Ronald Williams popularises backpropagation for training networks with hidden layers.
  • 2012: AlexNet, a deep convolutional network from the University of Toronto, wins the ImageNet image-recognition challenge with a top-5 error rate of 15.3%, far ahead of the runner-up’s 26.2%. Deep learning takes off.
  • 2017: the transformer is introduced, the design behind modern LLMs.
  • 2024: John Hopfield and Geoffrey Hinton receive the Nobel Prize in Physics for foundational discoveries and inventions that enable machine learning with artificial neural networks.

The core ideas are decades old. What changed was much more data, much faster chips (especially GPUs), and better training techniques.

Neural networks vs the brain

The name is inspiring but misleading if taken literally.

  • A brain has around 86 billion neurons and works with electrical and chemical signals in ways scientists still don’t fully understand.
  • An artificial neuron is a simple formula: multiply, add, apply a rule.
  • Brains learn continuously from very few examples; most neural networks need large amounts of data and are frozen after training.

“Loosely inspired by the brain” is the honest description.

Common misconceptions

“A neural network is an artificial brain.” It’s a mathematical model inspired by one idea from the brain: many simple units with adjustable connections.

“People program what each neuron does.” People choose the structure. The weights, and so what each part responds to, are learned from data.

“We can easily see why a neural network gave an answer.” Not easily. With millions of weights, the reasoning is spread across the whole network. Tools for explaining decisions are an active research area (letter X, explainable AI).

“Bigger networks are always better.” Bigger networks can learn more, but need more data, cost more to train and run, and can overfit small datasets.

Key takeaways

  • A neural network is a machine learning model made of layers of simple connected units called neurons.
  • Each neuron multiplies inputs by weights, adds a bias, and applies an activation function.
  • Networks learn by forward pass, measuring the loss, backpropagation and gradient descent, repeated many times.
  • Deep learning means networks with many layers; CNNs, RNNs and transformers are major kinds.
  • Key moments: the perceptron (1958), AlexNet (2012), the transformer (2017).
  • Neural networks are only loosely inspired by the brain.

Frequently asked questions

What is a neural network in simple words?

It’s a computer model made of many tiny calculators connected in layers. It learns from examples by adjusting how strongly each connection counts, until it gives good answers.

What is the difference between a neural network and deep learning?

Deep learning means using neural networks with many layers. Every deep learning model is a neural network, but a small network with one hidden layer usually isn’t called deep learning.

What are weights in a neural network?

Weights are numbers on the connections between neurons that set how much each input matters. They start random and are adjusted during training. They are what the network learns.

Is ChatGPT a neural network?

Yes. ChatGPT runs on large language models, which are very large transformer neural networks with billions of weights.

How many neurons does a neural network have?

It varies hugely. A teaching example might have a dozen. Large models are usually described by their number of parameters (weights and biases) rather than neurons. The biggest have hundreds of billions, and some over a trillion.

Comments

LEAVE A COMMENT
No sign-up. Comments appear after a quick review.