A neural network is a machine learning model made of connected mathematical operations. During training, it adjusts numerical values called parameters to learn patterns from examples. Once trained, it uses those patterns to process new inputs and produce outputs: a category, an estimate, a useful representation, or generated content.
You may already use neural networks when a phone transcribes speech, a system recognizes objects in a photo, or an assistant drafts a response. Their common foundation is learning a way to transform data into a useful result. Their tasks and designs can be very different.
The name comes from an early, simplified inspiration from biological neurons. An artificial neuron performs a calculation; the name does not establish human understanding, awareness, or a faithful simulation of a brain.
Where neural networks fit in AI
Artificial intelligence is the broad field of building systems that perform tasks associated with intelligence. Machine learning is an approach within AI that learns from data. Neural networks are one family of machine learning models. Deep learning uses neural networks with multiple processing layers to learn increasingly transformed representations of data.
That means AI, neural networks, and generative AI are related terms with different meanings. A rules-based AI system may use no neural network. A neural network may classify an email without generating anything. A modern generative system can use a deep neural network to create text, images, or audio. Dive into Deep Learning: introduction
An LLM is a particular kind of language model built using neural networks; it is not the name for every neural network. See Large language models (LLMs) explained.
From input to output: layers, weights, and activations
Consider a small network that assigns a support request to a team. Before the network can process the request, the text must be converted into numbers. Images, audio, and spreadsheet fields also need suitable numerical representations.
In a simple feedforward network, those numbers move through a sequence of layers:
- The input layer represents the values supplied to the network.
- Hidden layers transform those values into intermediate representations. “Hidden” means between input and output; it does not mean secret information.
- The output layer produces values appropriate to the task, such as scores for the possible support teams.
Connections have weights, which scale the values passing through them. A bias adds an adjustable offset. Together, weights and biases let training change how the network responds to inputs. A typical neuron combines weighted inputs and a bias before applying an activation function. Google: nodes and hidden layers
This is a teaching diagram, not the internal layout of an LLM. Real networks can contain many layers, branches, and other operations. A node is a mathematical unit, not a person or a separately assigned subject expert.
A small calculation
Suppose one hidden unit receives two inputs. The values below are invented to show the arithmetic; they do not represent a trained support model.
Inputs: x1 = 0.5, x2 = 1.0
Weights: w1 = 0.6, w2 = -0.2
Bias: b = 0.1
Weighted sum = w1 × x1 + w2 × x2 + b
= 0.6 × 0.5 + (-0.2) × 1.0 + 0.1
= 0.2
ReLU output = max(0, 0.2) = 0.2
ReLU is an activation function that returns zero for a negative input and otherwise returns the input. Other activation functions behave differently. Nonlinear activations allow the network to represent relationships that a stack of purely linear transformations cannot. Adding layers alone does not provide that ability. Google: activation functions
The value 0.2 is an intermediate activation, not automatically a probability or a confidence score. Its meaning depends on where it appears and how the model is designed. In the next layer, it becomes an input to further calculations.
How a neural network learns
Training searches for parameter values that improve a defined objective. In supervised learning, examples come with targets: a support request and its correct destination, for instance.
- Make a prediction. Pass a training example through the network. This is the forward pass.
- Measure the error. A loss function gives a numerical measure of how the output differs from the target.
- Calculate gradients. Backpropagation works backward through the computation to calculate how the loss changes with each trainable parameter.
- Update parameters. An optimizer uses those gradients to adjust the parameters, aiming to reduce the loss over training.
- Repeat. Process more examples, usually in groups called batches. One pass through the training dataset is an epoch.
Backpropagation calculates gradients; the optimizer applies the update rule. They are related parts of training. The learning rate controls the update size and is a training setting, rather than a weight learned from an example. Individual updates do not guarantee better results on every example. Google: training using backpropagation, Dive into Deep Learning: forward and backward propagation
Not every target needs a person to write a label. In self-supervised learning, targets can be constructed from the data itself—for example, training a language model to predict the next token from preceding text. This still involves a training objective and parameter updates. Google: introduction to large language models
Training and inference are different stages
Inference uses a trained network to process an input. For the support example, this means assigning a new request to a team. Ordinary inference does not update the learned weights.
A conversation can change an assistant’s answers because its input context changes. That is different from retraining the model. An application may separately retain history or use feedback in a later training process.
You also do not have to train from scratch. A pretrained model already has learned parameters. You may use it directly or fine-tune some or all trainable parameters for a narrower task. Read AI inference vs AI training.
What neural networks can do
The task, training data, objective, and output design determine what a network learns to do.
| Task | What the network produces | Example use |
|---|---|---|
| Classification | A category or scores for categories | Route a support request or recognize an image category |
| Regression | A numerical estimate | Estimate demand or delivery time |
| Representation learning | A vector that captures useful patterns, often called an embedding | Find documents with similar meanings |
| Sequence processing | Outputs related to ordered inputs | Transcribe speech or translate text |
| Generation | New content conditioned on an input or context | Draft a response or generate an image |
A system may combine several networks and ordinary software. A document assistant, for example, can use an embedding model to retrieve passages and an LLM to draft an answer. Retrieval, access controls, and the user interface belong to the surrounding application. What is RAG / agentic RAG?
Common neural network architectures
An architecture is the arrangement of layers and operations. These are useful starting points, not mutually exclusive boxes: a single model can combine several kinds of components.
| Architecture | Main idea | Where it is useful |
|---|---|---|
| Multilayer perceptron (MLP) | Pass values through fully connected layers with nonlinear activations | Basic prediction tasks and processing blocks inside larger models |
| Convolutional neural network (CNN) | Reuse learned filters across local regions | Image recognition, visual inspection, and other spatial data |
| Recurrent neural network (RNN) | Carry a hidden state from one sequence step to the next | Sequence modeling, including some speech and time-series systems |
| Transformer | Use attention to combine information from different positions, alongside other processing layers | Many language, vision, and multimodal models |
An MLP makes the layer-by-layer idea concrete. CNNs exploit local structure and shared filters. RNNs process sequences using recurrence; LSTM and GRU are common variants. Transformers use attention to model relationships among representations. MLPs, convolutions, RNNs, the original transformer paper
Mixture of Experts (MoE) is another design choice: a learned router can select particular expert components for an input. Those experts are neural network components, not separate human-like agents. It can be used within transformer models. See Mixture of Experts (MoE) explained.
Learning patterns is not the same as generalizing
A useful network should work on relevant new examples, not only the ones it learned from. This is generalization. Overfitting happens when a model fits training examples too closely and performs poorly on unseen data. Underfitting means it has not adequately captured the patterns needed for the task.
Low training loss alone cannot establish that a model will work in practice. Improving data quality, adjusting model capacity, using regularization, or stopping training based on validation results can help, depending on the problem. A larger network is not an automatic solution. Google: overfitting
Keep separate data for different purposes:
- Training set: learn the parameters.
- Validation set: compare designs and training settings during development.
- Test set: assess the selected model on held-out examples after those decisions.
Prevent data leakage: information that would not be available in real use must not slip into training or evaluation. Duplicate examples across splits can make results look better than they are. Repeatedly tuning against the test set also weakens its value as an independent check. Google: dividing datasets
For our support router, keep messages from the same conversation together when splitting data. Check results for each team, including uncommon but important request types. Test realistic new wording and review performance after product names, policies, or customer behavior change. An overall accuracy figure can hide costly mistakes in a small category.
Benefits, limitations, and choosing an approach
Neural networks can learn complicated relationships and useful representations from text, images, audio, and other data. Reusing a pretrained network can make capabilities available without building and training every component yourself. These strengths help explain their wide use. Dive into Deep Learning: introduction
They also introduce practical tradeoffs:
- Data and coverage: missing, incorrect, or unrepresentative examples can produce unreliable behavior or uneven results across groups.
- Compute and cost: training and serving require resources; model size, architecture, hardware, and workload affect the cost and response time.
- Interpretability: a prediction may be difficult to explain in terms a person can independently verify.
- Changing conditions: new inputs can differ from the conditions covered during development, requiring fresh evaluation.
- Task-specific errors: a classifier can misroute a request; a generative model can produce a plausible but unsupported statement. Neither should be treated as correct solely because it produced an answer.
For a real project, first define the task and the cost of errors. Compare a neural approach with a simpler baseline, such as rules, linear models, or decision trees. Then measure quality, speed, and operating cost on representative cases. Use review or escalation where the consequences require it. This is a practical selection process, rather than a guarantee that any one model family will win.
Check your understanding
Does every neural network generate text?
No. Networks can classify inputs, estimate numbers, produce embeddings, process images or audio, and perform other tasks. Text generation is one use.
What is the difference between a weight and a learning rate?
A weight is a learned parameter used in the network's calculations. The learning rate is a setting that controls the size of parameter updates during training.
A network is excellent on its training examples. Is it ready to deploy?
That result is insufficient. Evaluate held-out, representative examples, check for leakage and important error types, and test the behavior and cost of the complete application.
To continue, explore large language models for a specific neural network application, or AI model parameters for a closer look at the numerical values that training learns.