Neural Network — What They Are and How They Actually Work | AI Terms Guide
Category: FoundationsDifficulty: BeginnerFirst widely used: 1980sLast updated: Aug 6, 2026

Neural network (the foundation of modern AI)

A neural network is a computational structure of interconnected nodes with adjustable weights that learns to map inputs to outputs — the fundamental building block of every modern AI system.
The idea traces back to the 1940s, but neural networks became practical with backpropagation in 1986 and dominant with deep learning in the 2010s. Every AI system you interact with — Claude, GPT-5, Midjourney, self-driving car systems, medical imaging AI — is ultimately a neural network with a specific architecture and training procedure.

At a glance

Also known as
Artificial Neural Network, ANN
Category
Foundational Model Type
First widely used
1980s (backpropagation)
Difficulty
Beginner

Definition

A neural network is a computational model composed of interconnected units called neurons, organized into layers. Each neuron computes a weighted sum of its inputs, adds a bias, and applies a non-linear activation function. Neurons pass their output to the next layer, and the final layer produces the network's answer. The 'learning' happens by adjusting the weights and biases so the network's outputs match the desired outputs on training examples.

The core learning algorithm is backpropagation, published by Rumelhart, Hinton, and Williams in 1986. Backprop uses the chain rule of calculus to compute how much each weight contributed to the error, and gradient descent then updates weights to reduce that error. Repeat this on millions of examples and the network learns to map inputs to outputs even for tasks that resist explicit programming.

Modern neural networks are 'deep' — they have many layers (hence 'deep learning'). A modern large language model is a neural network with 60-100+ layers and hundreds of billions of parameters. An image generation model like Stable Diffusion is a neural network. Every specialized architecture — Transformer, CNN, RNN, Mamba — is a specific pattern of neural network structure.

What makes neural networks powerful is universal approximation: given enough width and depth, they can approximate any continuous function. What makes them practical is that gradient descent finds surprisingly good solutions even in enormous parameter spaces. What makes them dominant in 2026 is the combination of scale (billions to trillions of parameters), massive training data, and specialized hardware (GPUs, TPUs) — the perfect confluence that produced the current era of AI.

Real-world example

A minimal neural network — classifying handwritten digits

The classic first neural network task is MNIST — classifying 28×28 pixel images of handwritten digits (0-9). A simple network takes 784 input pixels (flattened), passes them through a hidden layer of, say, 128 neurons with ReLU activation, then outputs 10 numbers (one per digit class). Softmax turns those numbers into probabilities. Trained on 60,000 examples with backpropagation, this simple architecture reaches about 98% accuracy on unseen digits. From here, everything scales up — bigger networks, more data, deeper layers, better architectures.

PYTHON
# Minimal neural network in PyTorch
import torch
import torch.nn as nn
import torch.nn.functional as F

class SimpleNN(nn.Module):
    def __init__(self):
        super().__init__()
        # 784 input pixels → 128 hidden neurons → 10 output classes
        self.fc1 = nn.Linear(784, 128)
        self.fc2 = nn.Linear(128, 10)

    def forward(self, x):
        # Flatten input
        x = x.view(-1, 784)
        # First layer with ReLU activation
        x = F.relu(self.fc1(x))
        # Output layer (logits — softmax applied in loss)
        x = self.fc2(x)
        return x

# Training loop (simplified)
model = SimpleNN()
optimizer = torch.optim.Adam(model.parameters(), lr=1e-3)

for images, labels in train_loader:
    # Forward pass
    logits = model(images)
    loss = F.cross_entropy(logits, labels)
    # Backward pass (backpropagation happens here)
    optimizer.zero_grad()
    loss.backward()
    optimizer.step()
# After enough epochs: ~98% accuracy on MNIST test set
Notice: This is called a Multi-Layer Perceptron (MLP) — the simplest deep neural network. Every modern architecture (Transformer, CNN, RNN) uses the same underlying pattern: layers of neurons with activations, connected by learned weights, trained with backpropagation and gradient descent.

When you'll encounter this

  • You're using any AI product — every one is a neural network under the hood.
  • You're reading AI research — neural network vocabulary is assumed throughout the field.
  • You're building AI features — understanding the foundation helps you reason about capabilities and limitations.
  • You're training models — every training decision (learning rate, batch size, architecture) is a neural network hyperparameter.
  • You're debugging model behavior — understanding that models 'learn from examples' rather than 'know rules' explains many failure modes.

How it works

1

Neuron computation

Each neuron computes a weighted sum of its inputs plus a bias: z = w₁x₁ + w₂x₂ + ... + b. Then applies a non-linear activation: a = σ(z). Without the non-linearity, stacking layers would collapse into a single linear operation.

2

Layer stacking

Neurons are organized into layers. Each layer's outputs become the next layer's inputs. Deeper networks can learn more complex functions but are harder to train.

3

Forward pass

Given an input, activations flow through the network layer by layer. At the output layer, the network produces its prediction.

4

Loss computation

The prediction is compared with the ground-truth label using a loss function: cross-entropy for classification, mean squared error for regression. Loss is a single number measuring how wrong the network is.

5

Backpropagation

The chain rule of calculus computes how much each weight contributed to the loss. This produces a gradient vector — one number per weight — pointing in the direction of increasing loss.

6

Gradient descent

The optimizer (usually Adam) uses the gradient to update weights in the opposite direction: subtracting a fraction of the gradient scaled by the learning rate. Over many updates, the network learns to reduce loss.

7

Epochs and iterations

Training runs many epochs (passes through the entire dataset). Each epoch consists of many mini-batches. Modern LLM pretraining does one pass over trillions of tokens; fine-tuning may do multiple passes on smaller data.

8

Regularization

Techniques like dropout, weight decay, and early stopping prevent the network from overfitting — memorizing training data rather than learning generalizable patterns.

Feed-forward neural network Input layer Hidden layer(s) Output layer
A minimal feed-forward neural network. Modern deep networks have hundreds of layers with tens of billions of neurons; the underlying structure is the same.

Common misconceptions

Misconception #1: Neural networks work like biological brains.
The name and inspiration are biological, but modern deep learning is very different from biological neural computation. Real neurons spike; artificial ones output continuous values. Real brains use complex chemistry; artificial networks are pure math. The name stuck for historical reasons, but 'brain-like' is misleading.
Misconception #2: Deeper networks are always better.
Not without care. Deep networks can be harder to train (vanishing gradients), overfit more easily, and require more compute. Techniques like residual connections, batch norm, and layer norm made very deep networks trainable, but 'add more layers' isn't a universal solution.
Misconception #3: Neural networks are black boxes we can't understand.
Partially true, mostly overstated. Interpretability research at Anthropic, OpenAI, and elsewhere has made real progress understanding what specific neurons and circuits compute. Full mechanistic understanding remains hard, but 'utterly opaque' is not the whole story.

Where you'll see this in practice

Learn more

Sources & further reading

  1. Learning representations by back-propagating errors — Rumelhart, Hinton, Williams, 1986 (foundational backprop paper). Read →
  2. Deep Learning — Goodfellow, Bengio, Courville, 2016 (standard textbook). Read →
  3. Universal Approximation Theorem — Hornik et al., 1989. Read →
  4. ImageNet Classification with Deep Convolutional Neural Networks — Krizhevsky et al., 2012 (AlexNet — start of deep learning era). Read →
FAQ

Frequently asked about Neural Network

To use AI products, no. To build with AI APIs, understanding the high-level concepts (parameters, training, layers) helps. To build custom AI systems or fine-tune models, deeper understanding is essential. Our AI from Zero path takes you through the essentials at any comfort level.

Deep learning is a subset of neural networks — specifically neural networks with many layers. All deep learning uses neural networks; not all neural networks are deep. Modern AI is essentially all deep learning.

An LLM is a specific kind of neural network — a Transformer-based network trained on massive text data with the objective of predicting the next token. All LLMs are neural networks. Not all neural networks are LLMs — image models, speech models, and countless others aren't.

Because they learn from examples rather than rules. To learn patterns that generalize, you need enough examples covering the space. Larger networks have more parameters to fit and thus want more data. Modern LLMs train on 10-20 trillion tokens — roughly the entire filtered internet.

Yes — decision trees, random forests, gradient boosting (XGBoost, LightGBM), support vector machines, and classical statistical models are all still used and often better for tabular data. Neural networks dominate perceptual tasks (vision, speech) and language, but 'AI' is a bigger field than neural networks alone.

Share with