Join our Newsletter — 33% off our NHI Course
Home› Guides› Neural Networks for Beginners: How AI Learns From…
Guide AI Platforms

Neural Networks for Beginners: How AI Learns From Examples

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 28 November 2026 12 min read
On this page

A neural network is a computer program that learns patterns from examples by adjusting many small numbers.

This guide is for students, newcomers to tech and anyone curious about what sits inside modern AI. You do not need maths or coding. Face unlock, spam filters and AI chatbots all rely on neural networks, so the basics help you judge what they can and cannot do.

In short

  • A neural network is made of simple units arranged in layers. Each unit passes a number on to the next layer.
  • It learns by guessing, checking the guess against the right answer, and nudging its numbers to do a little better next time.
  • After training on many examples, it can spot patterns in new data, such as a face in a photo.
  • It learns from patterns, not understanding, so it can be fooled, can copy unfairness in its data and can be wrong with confidence.

What you will learn

  • Explain what a neural network is in one sentence.
  • Describe how layers, weights and training fit together.
  • Spot the main ways a neural network can go wrong.
  • Ask sensible questions about an AI tool built on one.
Strength setting (weight)
a number that sets how much one input counts towards a unit's result.
Row of units (layer)
a group of simple units that all take in the same inputs and pass results on.
Learning from examples (training)
showing the network many examples with known answers so it can adjust its weights.

What is a neural network?

Think of a sorting office with rows of desks. Letters come in at the front. Each desk in the first row looks at something simple, like the stamp or the postcode. It passes a note to every desk in the next row.

Each desk decides how much to trust each note it gets. A trusted note counts a lot, an untrusted one counts a little. The last desk makes the final call: which van the letter goes in.

A neural network works the same way, with numbers instead of notes. Each desk is a small unit, often called a neuron. Each row is a layer. How much a unit trusts each input is set by a number called a weight.[1]

The design is loosely inspired by brain cells, but it is not a copy of a brain.[1] It is a type of machine learning, which means software that learns rules from data instead of having every rule written by a person.

Where the comparison stops working: a sorting clerk knows what a postcode means. A unit in a neural network does not understand anything. It only multiplies and adds numbers, and nobody can easily read why it made a choice.

Why does it matter?

Neural networks now make or shape decisions about people: who gets flagged for fraud, which email is spam, what a chatbot tells you. Knowing how they learn helps you see where they can fail.

If you are a student

What could happen: you assume an AI answer is reasoned like a person's, and repeat a confident mistake in your work.

Check this: treat AI output as a strong guess from patterns, and check facts elsewhere.

Next: AI Hallucinations for Beginners

If you use AI tools at work

What could happen: a tool trained on old or one-sided examples treats some customers unfairly, and nobody notices.

Check this: ask the supplier what data the tool learned from and how it was tested.

Next: Machine Learning for Beginners

If you are new to security work

What could happen: an attacker makes tiny changes to an input, or slips bad examples into training data, to steer the network's answers.

Check this: learn where your models' training data comes from and who can change it.

Next: AI Security for Beginners

What does it look like?

You rarely see a neural network directly. You see its answer. Underneath, a tiny made-up spam checker might look like this.

Example only. All values are made up.

EXAMPLE spam checker (tiny made-up network)
Input 1: email contains "FREE PRIZE"  = 1        (1)
Input 2: sender is in contacts        = 0
Input 3: number of links              = 6
Weights learned: 0.9, -1.4, 0.3                  (2)
Hidden layer: 4 units                            (3)
Output: spam score 0.93 (FAKE)                   (4)
  1. Every input is turned into a number first. Words, pixels and sounds all become numbers.
  2. Weights set how much each input counts. A minus weight pushes the score down.
  3. Middle layers combine the inputs in ways no person chose. They are called hidden layers.
  4. The output is a score, not a fact. The tool then applies a rule, such as "above 0.9 goes to the spam folder".

Why this is risky: the score looks exact, so people treat it as certain. It is only as good as the examples the network learned from.

The safer way: treat scores as guesses. Let people review decisions that matter, and check the network on fresh examples from time to time.

How does it work?

A neural network does two jobs. First it learns, which is called training. Then it is used on new data. Here are the steps in plain words.

  1. Turn the input into numbers. A photo becomes pixel values. A sentence becomes numbers that stand for words or word pieces.
  2. Pass the numbers through the layers. Each unit multiplies each input by its weight, adds them up and passes the result on.[2] A small extra step lets the network learn curved, complex patterns, not only straight-line ones.[3]
  3. Make a guess. The last layer gives an answer, such as a score or a label.
  4. Check the guess during training. The network compares its guess with the right answer and measures how far off it was.[1]
  5. Nudge the weights. A method called backpropagation works out how much each weight added to the error. Each weight is then moved a little to reduce it.[1]
  6. Repeat many times. After many rounds, the weights settle into values that work well on the examples.
Diagram titled Layers in a neural network. On the left, an input layer of three circles labelled pixels, words or other inputs turned into numbers. In the middle, two hidden layers of four circles each, labelled combine and recombine the numbers. On the right, an output layer of one green circle labelled the answer, for example spam score 0.93. Lines join every circle in one layer to every circle in the next. A note says each line has a weight, a number that sets how much that input counts.
Figure 1. Numbers flow from the input layer through hidden layers to an answer. Each line has a weight.

Once training ends, the weights are usually fixed. The network then runs on new inputs it has never seen. Using a trained model in this way is called inference.

Loop diagram titled How a neural network learns. Four boxes in a circle joined by arrows. 1 Guess: the network gives an answer for one example. 2 Check: compare the guess with the right answer. 3 Nudge: backpropagation works out which weights caused the error and moves each a little. 4 Repeat: do this for many examples, many times. A green bar says the network learns patterns from its examples, so poor or one-sided examples teach poor or one-sided patterns.
Figure 2. Training is a loop of guess, check and nudge, repeated many times.

A network with many hidden layers is called a deep neural network, and training one is called deep learning. The large language models behind chatbots are very large networks of this kind, with special layers suited to text.[1]

Because a network learns only from data, its weak points come from data too. A US government report on attacks against AI lists several kinds, including these three. Attackers can feed a model inputs crafted to fool it. They can tamper with its training data, called poisoning. Or they can try to pull private information out of it.[4]

A worked example

Soren Pajari is studying business at college. His group project is about Thistle Couriers, a made-up delivery firm. The firm uses an AI tool that reads photos of parcels and sorts them as "damaged" or "fine".

Sana Mbeki, the operations lead at Thistle Couriers, explains it to the group. The tool is a neural network. It was trained on thousands of parcel photos that staff had already labelled. Each time it guessed wrong, its weights were nudged until it got most of them right.

Soren asks a simple question. "What kind of photos was it trained on?" Sana checks. Nearly all the photos came from the main depot, which has bright lights and plain brown boxes.

That explains a problem the firm had seen. At a smaller depot with dim lights and coloured boxes, the tool marked many good parcels as damaged. The network had learned patterns from one kind of photo. It had never been shown the other kind.

The fix is not magic. Sana's team adds labelled photos from every depot and retrains the tool. They also keep a person in the loop: any parcel marked "damaged" gets a quick human check before a customer is told.

Soren writes this up as his main finding. A neural network can only be as good as the examples it learned from. The firm now tests the tool on photos from each depot every quarter.

Myths and mistakes

What people thinkWhat is true
A neural network is a digital brain.It is loosely inspired by brain cells, but it is a set of numbers and simple sums. It does not think or understand like a person.
Someone writes the rules inside it.Nobody writes the rules. The network sets its own weights during training, which is why its choices are hard to explain.
More layers always means a better network.Bigger networks can learn more, but they need more data and computing power, and they can still learn the wrong patterns.
If it scored well in testing, it will work everywhere.It works best on data like its training examples. New conditions can make it fail.
A confident answer is a correct answer.A high score shows how strongly the network matches a pattern, not whether it is right.

What can I do this week?

  1. Spot three neural networks you use every day, such as face unlock, a spam filter or a photo search.
  2. Ask one AI supplier what kind of data their tool learned from and how it was tested.
  3. Check one AI answer against a trusted source before you rely on it.
  4. Read the model card for one AI tool you use, if the maker publishes one.

Checklist

  • I can explain layers, weights and training in my own words.
  • I know that a neural network learns patterns, not meaning.
  • I treat AI scores and answers as guesses that may be wrong.
  • I ask what data an AI tool was trained on before I trust it.
  • Decisions about people get a human check, not only a network's score.
  • We test AI tools on our own real-world conditions, not only the supplier's results.
  • I know who can change a model's training data in our team or supplier.

Common questions

Is a neural network the same as AI?

No. AI is the wide field of software that does tasks linked to human thinking. Machine learning is one part of AI. Neural networks are one family of machine learning methods. Most of today's best-known AI tools, including chatbots, use neural networks.

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

Deep learning means using neural networks with many hidden layers. So deep learning is a kind of neural network approach, not a separate thing. The extra layers let the network learn more complex patterns, such as faces or speech, from large amounts of data.

Why can't anyone explain what a neural network decided?

Because its knowledge is spread across many weights, none of which means anything alone. Large networks have a great many of them. Researchers are working on ways to explain network decisions, but it is still hard to give a simple reason for one answer.

Can a neural network be hacked?

It can be attacked in ways normal software is not. Small, crafted changes to an input can fool it. Bad examples slipped into training data can change what it learns. Attackers may also try to pull private training data back out of it.

Do I need maths to understand neural networks?

Not to understand the idea. Units, layers, weights and the guess, check and nudge loop are enough to ask good questions. To build or tune networks yourself, you would later learn some algebra, statistics and programming.

Where next?

Ready for the detail? Read the practitioner guide: AI Model Security Guide. It goes further into how trained models are attacked and protected, from training data to the systems that run them.

Also useful:

Related NHI Mgmt Group resources: Generative AI for Beginners · AI Threats and Model Security Guide · AI Hallucinations for Beginners

Key terms

Neural Network
A machine learning model, built from layers of simple units, that learns patterns from data to make predictions.
Machine Learning
A method where software finds patterns in data and uses them to predict or classify, without every rule written by hand.
Deep Learning
Machine learning that uses neural networks with many layers to find patterns in large amounts of data.
Parameters
The learned weights inside a model that shape its outputs.
Backpropagation
The training method that sends error information backwards through a network so its weights can be adjusted.
Training Data
The examples used to teach a model patterns and expected behaviour.
Inference
Using a trained model to produce outputs from new inputs.

Sources and further reading

  1. What is a neural network? IBM Think. https://www.ibm.com/think/topics/neural-networks, accessed 28 Nov 2026.
  2. Neural networks: Nodes and hidden layers. Machine Learning Crash Course, Google for Developers. https://developers.google.com/machine-learning/crash-course/neural-networks/nodes-hidden-layers, accessed 28 Nov 2026.
  3. Neural networks. Machine Learning Crash Course, Google for Developers. https://developers.google.com/machine-learning/crash-course/neural-networks, accessed 28 Nov 2026.
  4. Adversarial Machine Learning: A Taxonomy and Terminology of Attacks and Mitigations (NIST AI 100-2 E2025). National Institute of Standards and Technology, March 2025. https://csrc.nist.gov/pubs/ai/100/2/e2025/final, accessed 28 Nov 2026.

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.