A neural network is a stack of small calculations. Each one multiplies a few numbers by weights and adds them up, and training means adjusting those weights, often millions or billions of them, until the network’s answers come out right. Image recognition, speech-to-text, streaming recommendations, and ChatGPT all come from that process repeated at enormous scale. Each step is ordinary arithmetic, and what makes neural networks hard to follow is how many steps there are.
The short version: A neural network is a machine learning model made of layers of simple units. Each unit multiplies its inputs by weights, adds them up, and passes the result through a simple rule. During training, the network compares its answers to the correct ones and nudges every weight to shrink the error. With enough layers and examples, those small adjustments add up to a model that can recognize faces or predict the next word.
Table of Contents
ToggleWhat one neuron does
Start with a single unit, usually called a neuron. Say you want to predict whether a customer will cancel a subscription. You give the neuron three inputs: how many times they logged in last month, how many support tickets they filed, and how many months they’ve been a customer.
The neuron multiplies each input by a weight that says how much it counts and in which direction. Logins might get a negative weight (more logins, less likely to cancel) and support tickets a positive one. It adds the results, plus a fixed amount called a bias, and passes the total through an activation function, a simple rule for how strongly the neuron responds. A common one, called ReLU, turns negative numbers into zero and leaves positive numbers alone.
Swap ReLU for a sigmoid, which squeezes the total into a number between 0 and 1, and a single neuron becomes logistic regression, a model statisticians have used for decades. The power comes from connecting lots of them.
Layers
A neural network arranges neurons in layers. The input layer takes in the raw data. The output layer gives the answer, such as a probability that the customer cancels. Everything in between is a hidden layer, where each neuron takes in the outputs of the layer before it.
Hidden layers let the network build its own features. In an image model, early layers tend to respond to edges and color patches, middle layers to shapes and textures, and later layers to things like eyes or wheels. Nobody programs those features in. They come out of training. That’s the big difference from older models like support vector machines, where a person had to decide which measurements to feed in.
A network with many hidden layers is called deep, which is where the term deep learning comes from.
How a neural network learns
A new network starts with random weights, so its first predictions are nonsense. Training fixes that in a loop:
- Feed in a batch of training examples and get the network’s predictions.
- Measure how wrong they are with a loss function, a single number for the size of the error.
- Work out how much each weight contributed to that error. This step is called backpropagation, because the calculation runs backward from the output layer to the input layer.
- Nudge every weight a small step in the direction that reduces the error. This is called gradient descent.
A large network goes through this loop tens of thousands to hundreds of thousands of times, adjusting millions or billions of weights each time, which is why training takes serious hardware.
Then you check the trained network on data it never saw during training. Neural networks are very good at memorizing, so a model that looks great on its training data can still fail on new examples. That’s overfitting, and techniques like regularization help keep it in check.
Common types of neural networks
- Fully connected feedforward networks (sometimes called multilayer perceptrons) pass data straight through from input to output. They work for predictions like the subscription example.
- Convolutional neural networks (CNNs) scan images in small patches, reusing the same detectors across the whole picture. AlexNet, the 2012 model that set off the deep learning boom, was a CNN.
- Recurrent neural networks (RNNs), especially a version called LSTMs, read sequences one step at a time, which made them the standard for speech and text before 2017.
- Transformers use attention to look at a whole sequence at once. They power ChatGPT and most other large language models. The history of language models tells that story.
For a worked example with baseball data, see Statcast and Machine Learning: How MLB Tracks Every Pitch.
What neural networks are good and bad at
Neural networks shine on images, audio, language, and other large piles of unstructured data where hand-built features fall short. They have real weak spots too:
- They need a lot of data. With a few thousand rows, simpler models often do as well or better.
- They need a lot of computing power, both to train and sometimes to run.
- They’re hard to explain. A network can flag a loan applicant as high risk without giving a reason a person can easily check.
- For spreadsheet-style data, gradient boosted trees like XGBoost often beat them with less tuning.
None of these weak spots are new. When I started in machine learning around 2000, I was running small neural networks on my desktop for a breast cancer image project, and a single training run could take all night. For language work, most people had given up on them: the networks took days to train, needed more data than anyone had, and gave different results every time you ran them. Faster hardware, huge datasets, and better training methods solved most of the training problem. The appetite for data never went away.
Neural network FAQ
Is a neural network the same as AI?
No. Neural networks are one kind of machine learning model, and machine learning is one part of AI. Plenty of AI uses other methods, and plenty of useful machine learning uses no neural networks at all.
Is ChatGPT a neural network?
Yes. ChatGPT runs on a large transformer, a type of neural network with billions of weights, trained to predict the next word and then tuned with human feedback.
How many layers does a neural network need?
There’s no fixed number. A simple model for tabular data might use one or two hidden layers. Image models often use dozens, and large language models stack many more. GPT-3, for example, has 96 layers.
What’s the difference between a neural network and deep learning?
Deep learning means training neural networks with many layers. Today the terms are used almost interchangeably.
Do neural networks work like the brain?
Only loosely. The first artificial neuron, described by Warren McCulloch and Walter Pitts in 1943, was inspired by how brain cells fire, and the name stuck. Modern networks are math: multiplication, addition, and simple functions repeated at huge scale. Real neurons are far more complex, and most neuroscientists doubt the brain learns through backpropagation, though researchers still argue about how close it might come.
A neural network isn’t always the right tool. If you’re weighing your options, start with Do You Need Rules, ML, an LLM, or an AI Agent? or take the AI-ML Fit Quiz.


