What is a Neural Network?
A neural network is the core architecture behind modern AI. Plain-English explanation of how layers, weights, and backpropagation work, with no maths required.

The building block: a single neuron
A single artificial neuron does one simple thing:
- Receives multiple numerical inputs (from the previous layer or from raw data)
- Multiplies each input by a learned weight (how important this input is)
- Adds all the results together
- Applies an activation function (to introduce non-linearity)
- Outputs a number to the next layer
# One artificial neuron
def neuron(inputs, weights, bias):
weighted_sum = sum(x * w for x, w in zip(inputs, weights)) + bias
return relu(weighted_sum) # activation function: return 0 if negative, value if positive
def relu(x):
return max(0, x)One neuron is trivial. A network of millions of neurons, organised in many layers, learns to represent extremely complex patterns.
Layers: how networks get their power
How learning works: backpropagation
Training a neural network is the process of finding the right values for all the weights, starting from random values.
Types of neural networks
| Type | Input | Used for |
|---|---|---|
| Feedforward (dense) | Tabular data | Classification, regression on structured data |
| Convolutional (CNN) | Images, video | Image recognition, object detection, medical imaging |
| Recurrent (RNN/LSTM) | Sequences | Time series, older language models (pre-transformer) |
| Transformer | Text, images, audio | Language models (GPT, Claude, Llama), vision models, audio |
| Diffusion model | Noise | Image generation (Stable Diffusion, DALL-E 3) |
| Graph neural network | Graphs (molecules, networks) | Drug discovery, social network analysis, fraud detection |
A concrete example: image classification
Training a neural network to classify handwritten digits (0-9):
import torch
import torch.nn as nn
class DigitClassifier(nn.Module):
def __init__(self):
super().__init__()
self.layers = nn.Sequential(
nn.Flatten(),
nn.Linear(784, 256), # 28x28 pixel image → 256 hidden neurons
nn.ReLU(),
nn.Linear(256, 128), # 256 → 128
nn.ReLU(),
nn.Linear(128, 10), # 128 → 10 output classes (digits 0-9)
)
def forward(self, x):
return self.layers(x)
model = DigitClassifier()
# Total parameters: 784*256 + 256 + 256*128 + 128 + 128*10 + 10 = 235,146
# Each parameter is one weight that will be learned during trainingAfter training on 60,000 examples, this small network classifies handwritten digits with 98%+ accuracy. A transformer with billions of parameters applies the same core principle to vastly more complex tasks.
Why this matters for understanding AI
Once you understand neural networks, the capabilities and limitations of modern AI make sense:
- Why does it get better with more data? More training examples mean more iterations of the weight-adjustment loop, producing better-tuned weights.
- Why is it hard to explain? There is no single “rule” to read out. Knowledge is distributed across millions of weights.
- Why does it hallucinate? The network learned to predict plausible output from training patterns. It has no external fact-checking mechanism.
- Why is training expensive? Millions of forward and backward passes through billions of parameters require thousands of specialised chips (GPUs/TPUs) running for weeks.
What’s next
- What is Machine Learning? : The broader context for how neural networks are trained
- What is a Large Language Model? : How transformer neural networks power text AI
- What is Generative AI? : How neural networks are used to create content
Further reading
- TensorFlow Neural Network Playground : Interactive browser demo where you can watch a neural network learn in real time
- But what is a neural network? (3Blue1Brown) : The clearest visual explanation available; highly recommended starting point
- Neural Networks and Deep Learning (Nielsen) : Free online book, mathematically precise but accessible
Frequently asked questions
