Machine learning is a way of building software that learns patterns from examples, instead of following rules a person has written out one by one, and then uses those patterns to make predictions about new data.
Spam filters, fraud alerts, photo search and chatbots all rely on it. This guide is for newcomers, students, career changers and managers who want a clear, jargon-free picture. It explains what machine learning is, how a model is trained step by step, a worked example, common myths and what it means for security, so you can ask better questions about the tools you use.
By the end of this guide you will be able to:
- Explain what machine learning is and how it differs from ordinary software.
- Describe the main steps in training and using a model.
- Understand the main types of machine learning.
- Identify the security and quality risks to ask about.
Key takeaways
- Machine learning learns from examples. Instead of writing every rule, you show the computer many examples and it works out the patterns.
- The result is called a model. A model is the trained piece of software that makes predictions or produces content.
- Data quality matters most. A model can only be as good as the examples it learned from.
- Models make mistakes. They give their best guess, not a guaranteed answer, so people need to check important decisions.
- Machine learning has its own security risks. Attackers can tamper with training data, trick models with crafted inputs or try to extract information from them.
What it is, in plain English
Artificial intelligence (AI) is the broad idea of computer systems doing tasks that usually need human intelligence, such as recognising speech or images.[4] Machine learning (ML) is a widely used way of building AI. Google describes it as the process of training a piece of software, called a model, to make useful predictions or generate content from data.[1]
In ordinary software, a programmer writes the rules: "if the email contains this word, mark it as spam". In machine learning, you give the computer lots of examples, such as thousands of emails already marked "spam" or "not spam", and a training process adjusts the model until it gets most of them right. The model then applies what it learned to emails it has never seen.
A helpful comparison is learning to recognise birds. Nobody gives a child a rulebook for every bird. They see many birds, someone names them, and over time the child spots the patterns. Where the analogy breaks down: a child understands what a bird is, while a model only finds statistical patterns in the data. It can be confidently wrong when something looks unlike its examples, and it can pick up patterns that are accidental rather than meaningful.
Google groups machine learning systems into four broad types:[1]
- Supervised learning: learns from examples that include the right answer, such as emails labelled spam or not spam.
- Unsupervised learning: finds patterns in data without labels, for example by grouping similar items together.
- Reinforcement learning: learns by trying actions and receiving rewards or penalties, such as software learning to play a game.
- Generative AI: creates new content, such as text or images, by following patterns in its training data. Chatbots built on large language models are an example.
Why it matters to you
- If you run a small business: you probably already use machine learning in your email filter, your bank's fraud checks or your accounting software. Knowing its limits helps you decide when to trust it.
- If you are new to a security job: many security tools use machine learning to flag unusual behaviour, and AI systems are themselves becoming something you need to protect.
- If you are a manager: machine learning projects bring data, quality and security questions that are different from ordinary software, and they need an owner.
Machine learning brings new kinds of risk. The UK National Cyber Security Centre (NCSC) describes data poisoning, where an attacker tampers with the data an AI model is trained on to skew its results, and advises that security should be built into AI projects from the start.[4] The US National Institute of Standards and Technology (NIST) publishes a taxonomy of attacks on machine learning systems, which covers topics such as poisoning, evasion with crafted inputs and privacy breaches, along with ways to reduce them.[5]
How it works, step by step
Projects vary, but most supervised machine learning follows these steps.
- Define the question. Decide what you want to predict, such as "is this transaction likely to be fraud?", and how you will judge success.
- Collect and label data. Gather examples and, for supervised learning, attach the right answer to each one. Google's course puts it plainly: the quality and size of the dataset matter much more than which algorithm you use.[3]
- Split the data. Keep some examples back. The model trains on a training set, and a separate test set acts as a stand-in for real-world data.[2]
- Train the model. A training process adjusts the model again and again to reduce its mistakes on the training examples.
- Test it. Check the model on examples it has not seen. A model that matches its training data too closely and fails on new data is said to be overfitting.[2]
- Use it. Put the model to work on new data. Using a trained model to produce an answer is called inference.
- Monitor and retrain. Watch its accuracy over time. When the world changes, a model's performance can slip, which is called model drift, so it may need retraining with newer data.

Useful distinctions
- Machine learning is not the same as AI. AI is the broad goal; machine learning is one way to achieve it, and a widely used one.
- Generative AI is one kind of machine learning. Chatbots are built on large language models, which are machine learning models trained to generate text. Many everyday models do not generate anything; they classify or predict.
- Training and inference are different stages. Training builds the model and needs lots of data and computing power. Inference uses the finished model, often many times a second.
A worked example
Lakeside Garden Supplies is a fictional online shop with 25 staff. Its card payment provider offers a machine learning fraud check, and the operations manager, Grace, wants to understand it before switching it on.
The provider explains that its model was trained on a large set of past transactions, each labelled as genuine or fraudulent. It looks at features such as order value, delivery address and how quickly the order was placed. For each new order it gives a risk score, which is inference in action.
Grace runs the check in "flag only" mode for a month. It highlights several orders that turn out to be fraud attempts, which the team cancels. It also flags a few genuine orders from regular trade customers who suddenly placed unusually large Christmas orders. The model had not seen that pattern often in its training data.
Grace decides on a sensible set-up:
- Human review: high-risk orders go to a person for a quick check rather than being cancelled automatically.
- Feedback: the team marks each flagged order as genuine or fraud, so the provider can improve its model.
- Review: Grace checks the number of false alarms each quarter, especially before busy seasons.
The model reduces the time staff spend checking orders by hand and helps them catch some fraud attempts. It does not catch every fraud, and Grace keeps the shop's other checks, such as verifying unusual delivery changes, in place.
Myths and misunderstandings
| What people think | What is true |
|---|---|
| Machine learning models understand what they are doing. | They find statistical patterns in data. They do not understand meaning the way people do, and can be confidently wrong. |
| More complex algorithms always give better results. | Good, relevant data usually matters more than a clever algorithm. |
| A model that scores well in testing will stay accurate. | Performance can drift as the world changes, so models need monitoring and retraining. |
| Machine learning is unbiased because it is maths. | A model learns from its data, so gaps or bias in the data can show up in its decisions. |
| AI security is only about chatbots. | Every machine learning system, from fraud models to image classifiers, can be targeted through its data, inputs or outputs. |
Key terms
- Machine learning
- A method where software finds patterns in data and uses them to make predictions or classifications, without every rule being written by hand.
- Algorithm
- A step-by-step set of instructions that produces a result; in machine learning, the method used to learn from data.
- Training data
- The examples used to teach a model patterns and expected behaviour.
- Labelled data
- Data where each example is tagged with the correct answer, used in supervised learning.
- Supervised learning
- Training a model on labelled examples so it learns to give the right answer for new ones.
- Unsupervised learning
- Training a model to find structure in data that has no labels, such as groups or unusual items.
- Reinforcement learning
- Training a model by giving it rewards or penalties based on the results of its actions.
- Overfitting
- When a model learns its training data too closely and does poorly on new data.
- Inference
- Using a trained model to produce outputs from new inputs.
- Model drift
- The gradual change in a model's performance after it is deployed, as real-world data moves away from what it was trained on.
- Data poisoning
- Tampering with the data a model learns from to add weaknesses, hidden behaviour or bias.
- Deep learning
- A type of machine learning that uses layered neural networks to find patterns in large data sets.
Common questions
What is the difference between AI and machine learning?
AI is the broad idea of computers doing tasks that usually need human intelligence. Machine learning is a way of building AI by learning from data, and it is the approach behind many AI tools, including chatbots.
Do I need to be good at maths to understand machine learning?
Not to understand the ideas in this guide. Building models from scratch needs maths and programming, but using and questioning them mainly needs clear thinking about data and results.
How much data does a model need?
It depends on the task. Simple problems can need far fewer examples than large language models, which are trained on vast amounts of text. Quality and relevance matter as much as quantity.[3]
Can a machine learning model be hacked?
Yes, in ways that differ from ordinary software. Attackers may poison training data, craft inputs that fool the model or try to extract information from it.[4][5] The systems around the model, such as its data stores and access keys, also need protecting.
Is ChatGPT machine learning?
Chatbots such as ChatGPT are built on large language models, which are a kind of generative machine learning model trained on large amounts of text.
Why do models get things wrong?
They give their best guess based on patterns in their training data. If a new case looks unlike those examples, or the data had gaps or errors, the guess can be wrong.
First steps
Practical actions for this week:
- List where you already use machine learning, such as email filtering, fraud checks, chatbots or analytics features in your software.
- Ask your suppliers three questions: what data the model was trained on, how its accuracy is checked, and whether your data is used to train it.
- Decide where a person stays in the loop. For decisions that affect customers, money or staff, we suggest a human reviews the model's output before action is taken.
- Read the AI security basics in the learning pathway below before starting any machine learning project of your own.
Checklist
- We know which of our tools and suppliers use machine learning.
- Each machine learning system has a named owner.
- We know what data each model was trained on, at least in outline.
- We know whether our own data is used to train suppliers' models, and have agreed to it.
- Important decisions made with a model are reviewed by a person.
- Someone checks model accuracy or false alarm rates at regular intervals.
- Training data and models are stored with access controls like any other sensitive asset.
- Our risk register includes AI-specific risks such as data poisoning.
Check your understanding
1. How does machine learning differ from ordinary software?
Answer: in ordinary software a person writes the rules; in machine learning the model learns patterns from examples.
2. What is supervised learning?
Answer: training a model on examples that include the correct answer, so it learns to predict the answer for new examples.
3. What is overfitting?
Answer: when a model matches its training data so closely that it does poorly on new data.
4. What is data poisoning?
Answer: an attack where someone tampers with a model's training data to skew its results.
Suggested learning pathway
- Fine-Tuning and Model Training for Beginners: a related beginner guide to read next.
- Agentic AI for Beginners: a related beginner guide to read next.
- AI Agents for Beginners: a related beginner guide to read next.
- For how machine learning becomes a security topic, start with AI Security for Beginners.
- For the content-creating kind of machine learning, see Generative AI for Beginners.
- For the models behind chatbots, see How Large Language Models Work.
- For checking models over time, see ML model evaluation and monitoring for security teams.
- For the main risks to machine learning systems, see the OWASP Machine Learning Security Top 10.
- For tampering with training data, see the AI Data Poisoning and Backdoors Guide.
- For the full attack taxonomy, see the Adversarial ML Taxonomy Guide.
Standards and references
- What is machine learning? Introduction to Machine Learning, Google for Developers, last updated 27 Jan 2026. https://developers.google.com/machine-learning/intro-to-ml/what-is-ml, accessed 27 Nov 2026.
- Overfitting. Machine Learning Crash Course, Google for Developers, last updated 3 Dec 2025. https://developers.google.com/machine-learning/crash-course/overfitting/overfitting, accessed 27 Nov 2026.
- Datasets, generalization, and overfitting. Machine Learning Crash Course, Google for Developers, last updated 3 Dec 2025. https://developers.google.com/machine-learning/crash-course/overfitting, accessed 27 Nov 2026.
- AI and cyber security: what you need to know. National Cyber Security Centre (NCSC), 13 Feb 2024. https://www.ncsc.gov.uk/guidance/ai-and-cyber-security-what-you-need-to-know, accessed 27 Nov 2026.
- NIST AI 100-2 E2025, Adversarial Machine Learning: A Taxonomy and Terminology of Attacks and Mitigations. National Institute of Standards and Technology (NIST), 24 Mar 2025. https://csrc.nist.gov/pubs/ai/100/2/e2025/final.
Related NHI Mgmt Group resources: AI Security for Beginners · Generative AI for Beginners · How Large Language Models Work