Within AI Sense
How Machines Learn From Examples
Machine learning replaces hand-written rules with systems that improve by finding patterns in examples.
On this page
- Learning from data instead of fixed rules
- Training objectives and error correction
- Why pattern learning can still fail
Page outline Jump by section
Introduction
Machine learning is the part of artificial intelligence that replaces many hand-written rules with systems that learn useful patterns from examples. Instead of programming every possible instruction for recognising spam, predicting demand, classifying an image, or recommending a film, developers provide data, define a task, choose a way to measure error, and let the model adjust until its predictions improve. This is why machine learning sits at the centre of many everyday AI systems: it turns past examples into a model that can make a judgement about new cases. IBM describes machine learning as algorithms that learn patterns in training data and then make inferences without explicit hard-coded instructions, while Google’s teaching materials frame training around reducing measurable loss, or prediction error. [IBM]ibm.comWhat is Machine Learning? | IBMThis pattern recognition ability enables machine learning models to make decisions or predictions witho…
The crucial idea is not that the machine “understands” in a human sense. It is that the system has found statistical regularities that are useful for a defined task. That power is real, but it is also limited: a model may learn the wrong pattern, memorise its training examples, inherit bias from the data, or fail when the real world changes.
Learning from data instead of fixed rules
Traditional software follows instructions written in advance. A tax calculator, for example, can be built from explicit rules: apply this rate, subtract that allowance, round the result in this way. Machine learning is more useful when the rules are hard to state but examples are plentiful. It is difficult to write a complete rulebook for every possible spam email, spoken accent, road sign, product preference, or medical image variation. In those cases, a model can be trained on examples and allowed to infer patterns that would be awkward, brittle, or impossible to list manually.
IBM’s design guidance puts the contrast plainly: instead of spelling out specific rules, developers give AI systems examples of what they will encounter and let them find patterns. This matters because real-world data often contains many interacting variables, and the right decision boundary may not be obvious to a human rule-writer. [IBM]ibm.comOpen source on ibm.com.
A simple spam filter shows the mechanism. A hand-written filter might block messages containing words such as “winner” or “urgent”, but spammers can change wording. A machine-learning filter can examine many labelled examples of spam and legitimate mail, notice combinations of features, and update as new examples arrive. The model does not need a single perfect rule; it learns a pattern that is good enough to reduce error on the task.
This pattern-learning approach also explains why machine learning is not one technique but a family of methods. Supervised learning uses examples with labels, such as images marked “cat” or “not cat”. Unsupervised learning looks for structure in unlabelled data, such as clusters of customers with similar behaviour. Reinforcement learning learns through rewards and penalties from interaction. The common thread is experience: the system improves its performance on a task by using data rather than relying only on fixed instructions. Tom Mitchell’s widely used definition captures this as improvement on a task, measured by a performance measure, through experience. [CMU School of Computer Science]cs.cmu.eduOpen source on cmu.edu.
What a model actually learns
A machine-learning model is a compressed way of using past examples to make future predictions. During training, the system searches through possible relationships between inputs and outputs. In a house-price model, the inputs might include location, floor area, age, and number of bedrooms; the output is an estimated price. In an image model, the inputs are pixels; the output might be a label. In a translation system, the inputs and outputs are sequences of words or tokens.
The “pattern” is encoded in model parameters: internal values adjusted during training. In a simple linear model, those parameters may be weights assigned to each input feature. In a neural network, they may be millions or billions of weights spread across layers. The principle is still the same: the model changes its internal settings so that its outputs better match the examples it has seen.
This is why data quality matters so much. Training data is not just background material; it is the experience from which the model learns. IBM defines training data as information used to teach a model how to make predictions, recognise patterns, or generate content, and notes that without it even sophisticated algorithms are not useful. [IBM]ibm.comOpen source on ibm.com.
A useful way to think about the process is:
- Examples provide experience. The system is shown inputs, and often the desired outputs.
- The model makes predictions. At first these may be poor or random.
- An error measure scores the predictions. The system needs a numerical signal showing how wrong it is.
- Training changes the model. The algorithm adjusts internal parameters to reduce future error.
- Evaluation tests whether learning transfers. The real test is performance on examples not used during training.
The last step is essential. A model that only performs well on its training examples has not learned a useful general pattern; it has learned the training set too narrowly.
Training objectives and error correction
Machine learning needs an objective: a way to say whether one model is better than another. In many supervised-learning tasks, this objective is a loss function, a numerical measure of how wrong the model’s predictions are. Google’s Machine Learning Crash Course defines loss as a metric describing the distance between predictions and actual labels, with training aiming to minimise that loss. [Google for Developers]developers.google.comOpen source on google.com.
Consider a model predicting delivery time. If it predicts 20 minutes and the actual delivery takes 35 minutes, the error is 15 minutes. Across thousands of examples, the training process searches for parameter settings that reduce such errors. This is not “learning” through reflection; it is repeated adjustment guided by feedback.
Different tasks use different error measures. A regression model may minimise average distance between predicted and actual numbers. A classifier may be rewarded for assigning high probability to the correct class. A ranking system may optimise whether the most relevant results appear near the top. The chosen objective shapes what pattern the model learns, because the system learns to do what it is measured on.
That creates a practical design problem. If the objective is too narrow, the model may optimise the metric while missing the human purpose. A recommender trained only to maximise clicks may learn patterns that increase short-term engagement without improving satisfaction. A hiring-screening model trained on historical decisions may reproduce old patterns of exclusion if those decisions are treated as the target. The mechanism is neutral, but the objective and data are not.
Generalisation is the real test
The central promise of machine learning is generalisation: learning from past examples in a way that works on new ones. If a model sees many labelled photos of cats, the goal is not to remember those exact photos. The goal is to classify a new cat photo correctly. This is why machine-learning projects divide data into training, validation, and test sets. The training set teaches the model; separate data estimates whether the learned pattern transfers.
Overfitting is the classic failure. It happens when a model matches the training data so closely that it performs badly on new data. Google describes overfitting as memorising the training set so tightly that the model fails to make correct predictions on new examples. A Stanford machine-learning lecture gives the extreme example of “rote learning”: simply storing the training data can achieve perfect training performance while being useless on unseen cases. [Google for Developers]developers.google.comOpen source on google.com.
Underfitting is the opposite problem. The model is too simple, or the training process too weak, to capture the real pattern. Scikit-learn’s teaching examples illustrate this with curves: a model can be too rigid to follow the underlying shape, or so flexible that it follows noise rather than the signal. [Scikit-learn]scikit-learn.orgOpen source on scikit-learn.org.
Good machine learning sits between these extremes. It should learn enough structure to perform the task, but not so much accidental detail that it becomes fragile. Techniques such as cross-validation, regularisation, more representative data, and careful testing are all attempts to answer the same question: has the model learned a pattern that will survive contact with new cases?
Why pattern learning can still fail
Machine learning can fail precisely because it is powerful at finding patterns. A model does not know which patterns are socially meaningful, causally reliable, temporary, biased, or accidental unless the data, objective, and evaluation process are designed to reveal that.
One failure mode is biased data. If the examples reflect historical discrimination, missing groups, or unequal measurement, the model can reproduce those patterns. NIST’s work on AI bias emphasises that bias can enter through training data, but also through wider human and institutional systems around the data. Its public summary warns against treating AI bias as only a technical problem. [NIST Publications]nvlpubs.nist.govOpen source on nist.gov.
A second failure mode is spurious correlation. A model may find a pattern that works in the training data but has no stable connection to the real target. For example, an image classifier might appear to recognise an object but actually rely on background cues that were common in the training images. When the background changes, performance collapses.
A third failure mode is distribution shift, where the real-world data changes after training. This is common because models are often trained on historical data and deployed into future conditions. The Dive into Deep Learning textbook warns that models can achieve strong test-set accuracy yet fail in deployment when the data distribution shifts, and the Vector Institute notes that shifts can range from small changes to large disruptions such as the COVID-19 pandemic. [Dive into Deep Learning]d2l.aiOpen source on d2l.ai.
A fourth failure mode is metric mismatch. The model may optimise exactly what developers asked for, but the metric may be an incomplete proxy for the real goal. In this sense, machine learning does not remove the need for judgement. It moves part of the design problem from writing rules to choosing data, labels, objectives, and evaluation tests.
A concrete lesson from algorithmic risk scores
Risk-scoring tools in criminal justice are often discussed because they make the stakes of pattern learning visible. ProPublica’s 2016 investigation of the COMPAS recidivism tool argued that the system’s predictions produced racially unequal error patterns, while later debate examined whether different fairness definitions were being applied and whether such tools should be proprietary or transparent. [ProPublica+2ProPublica]propublica.orgPro Publica Machine BiasPro Publica Machine Bias
The lesson for understanding machine learning is not that every model is automatically unfair, nor that all statistical prediction is useless. The lesson is that a model trained on historical patterns can make consequential predictions while hiding difficult questions: What outcome was used as the label? Arrest, conviction, reoffending, or something else? Are all groups measured equally? Which error is worse: a false positive or a false negative? Who gets to inspect the system? These are pattern-learning questions as much as ethical ones, because the model’s behaviour follows from the examples and objectives it was given.
That is why machine learning should be understood as a mechanism, not magic. It can detect regularities at a scale humans cannot manage, but it cannot by itself decide whether those regularities are fair, causal, stable, or appropriate to use.
What this changes about understanding AI
Seeing machine learning as pattern learning from data cuts through two common myths about artificial intelligence. The first myth is that AI systems must be explicitly programmed with everything they know. Many modern systems are instead trained: their behaviour emerges from data, objectives, model design, and feedback. The second myth is that AI systems think like people. Most machine-learning systems do not understand the world as humans do; they transform examples into statistical behaviour that can be useful, impressive, brittle, or misleading depending on the conditions.
This perspective also explains why machine learning became so central to AI. It scales better than hand-written rules in messy domains, adapts when new examples are available, and can exploit large datasets that would overwhelm manual analysis. But it also shifts responsibility. The important questions become: Were the examples representative? Was the label meaningful? Was the objective aligned with the real goal? Was the model tested on genuinely new conditions? Are errors monitored after deployment?
Machine learning is therefore best understood as a practical trade: less manual rule-writing in exchange for more dependence on data, measurement, and validation. When those are strong, pattern learning can power useful AI systems. When they are weak, the same mechanism can learn the wrong lesson with great confidence.
Amazon book picks
Further Reading
Books and field guides related to How Machines Learn From Examples. Use these as the next step if you want deeper reading beyond the article.
Hands-on Machine Learning with Scikit-Learn, Keras, and Tenso...
Direct introduction to how machines learn from examples and training data.
The Master Algorithm
Explains the core idea of learning patterns from data rather than rules.
The Hundred-page Machine Learning Book
Covers training, prediction, generalization, and common failure modes.
Grokking Machine Learning
Focuses on intuitive explanations of learning from examples.
Endnotes
-
Source: ibm.com
Link: https://www.ibm.com/think/topics/machine-learningSource snippet
What is Machine Learning? | IBMThis pattern recognition ability enables machine learning models to make decisions or predictions witho...
-
Source: developers.google.com
Link: https://developers.google.com/machine-learning/crash-course/linear-regression/loss -
Source: ibm.com
Link: https://www.ibm.com/design/ai/basics/ml/ -
Source: cs.cmu.edu
Link: https://www.cs.cmu.edu/~tom/files/MachineLearningTomMitchell.pdf -
Source: ibm.com
Link: https://www.ibm.com/think/topics/training-data -
Source: developers.google.com
Link: https://developers.google.com/machine-learning/crash-course/overfitting/overfitting -
Source: web.stanford.edu
Link: https://web.stanford.edu/class/archive/cs/cs221/cs221.1186/lectures/learning3.pdf -
Source: scikit-learn.org
Link: https://scikit-learn.org/stable/auto_examples/model_selection/plot_underfitting_overfitting.html -
Source: nvlpubs.nist.gov
Link: https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.1270.pdf -
Source: nist.gov
Title: theres more ai bias biased data nist report highlights
Link: https://www.nist.gov/news-events/news/2022/03/theres-more-ai-bias-biased-data-nist-report-highlights -
Source: propublica.org
Title: Pro Publica Machine Bias
Link: https://www.propublica.org/article/machine-bias-risk-assessments-in-criminal-sentencing -
Source: propublica.org
Title: how we analyzed the compas recidivism algorithm
Link: https://www.propublica.org/article/how-we-analyzed-the-compas-recidivism-algorithm -
Source: ibm.com
Title: machine learning
Link: https://www.ibm.com/think/machine-learning -
Source: ibm.com
Title: ai vs machine learning vs deep learning vs neural networks
Link: https://www.ibm.com/think/topics/ai-vs-machine-learning-vs-deep-learning-vs-neural-networks -
Source: ibm.com
Link: https://www.ibm.com/think/topics/ai-data-management -
Source: ibm.com
Link: https://www.ibm.com/think/topics/machine-learning-types -
Source: ibm.com
Link: https://www.ibm.com/think/topics/machine-learning-algorithms -
Source: ibm.com
Link: https://www.ibm.com/think/topics/supervised-learning -
Source: ibm.com
Link: https://www.ibm.com/think/topics/algorithmic-bias -
Source: web.stanford.edu
Link: https://web.stanford.edu/class/bios221/book/12-chap.html -
Source: developers.google.com
Title: crash course
Link: https://developers.google.com/machine-learning/crash-course -
Source: google.com
Link: https://www.google.com/ -
Source: developers.google.com
Title: rules of ml
Link: https://developers.google.com/machine-learning/guides/rules-of-ml -
Source: me.developers.google.com
Link: https://me.developers.google.com/u/115234236287988150607 -
Source: developers.google.com
Link: https://developers.google.com/machine-learning/glossary -
Source: cloud.google.com
Title: what is machine learning
Link: https://cloud.google.com/learn/what-is-machine-learning -
Source: nvlpubs.nist.gov
Title: NIST.SP.1270 draft
Link: https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.1270-draft.pdf -
Source: about.google
Link: https://about.google/ -
Source: scikit-learn.org
Link: https://scikit-learn.org/0.19/auto_examples/model_selection/plot_underfitting_overfitting.html -
Source: d2l.ai
Link: https://d2l.ai/chapter_linear-classification/environment-and-distribution-shift.html -
Source: blog.google
Title: machine learning crash course
Link: https://blog.google/innovation-and-ai/technology/developers-tools/machine-learning-crash-course/ -
Source: Wikipedia
Title: Machine learning
Link: https://en.wikipedia.org/wiki/Machine_learning -
Source: Wikipedia
Title: Supervised learning
Link: https://en.wikipedia.org/wiki/Supervised_learning -
Source: facebook.com
Link: https://www.facebook.com/groups/2059467967664033/posts/3393801757563974/ -
Source: zhaohuabing.com
Title: Machine Learning
Link: https://www.zhaohuabing.com/post/2018-12-24-machine-learningp-introduction/ -
Source: learnai.im
Link: https://learnai.im/courses/curated-external-training-for-experts/lessons/google-for-developers-machine-learning-crash-course-15-hours/
Additional References
-
Source: youtube.com
Title: Does learning require memorization? A short tale about a long tail
Link: https://www.youtube.com/watch?v=Fp7cgHRl8YcSource snippet
Machine Learning Explained in Plain English | AI Basics for Beginners - YouTube Machine Learning Explained in Plain English | AI Basics f...
-
Source: youtube.com
Title: Machine Learning Fundamentals | ML vs Traditional Programming
Link: https://www.youtube.com/watch?v=W87pTn0d91oSource snippet
Does learning require memorization? A short tale about a long tail - Vitaly Feldman, Google Brain...
-
Source: youtube.com
Title: Machine Learning Explained in Plain English | AI Basics for Beginners
Link: https://www.youtube.com/watch?v=8GtCvDF78cUSource snippet
Machine Learning and Pattern Recognition | | UPV...
-
Source: uscourts.gov
Link: https://www.uscourts.gov/sites/default/files/80_2_6_0.pdf -
Source: youtube.com
Link: https://www.youtube.com/watch?v=CUTnUpPohS4Source snippet
Machine Learning Fundamentals | ML vs Traditional Programming...
-
Source: researchgate.net
Link: https://www.researchgate.net/publication/224103556_Arthur_Samuel_Pioneer_in_Machine_Learning -
Source: researchgate.net
Link: https://www.researchgate.net/publication/350834453_Machine_learning_and_deep_learning -
Source: deeplearningbook.org
Link: https://www.deeplearningbook.org/contents/ml.html -
Source: kaggle.com
Link: https://www.kaggle.com/general/556370 -
Source: brookings.edu
Link: https://www.brookings.edu/articles/algorithmic-bias-detection-and-mitigation-best-practices-and-policies-to-reduce-consumer-harms/
Topic Tree
Follow this branch
Parent topic
AI SenseRelated pages 11
- AI Errors Why AI Can Be Confidently Wrong
- AI Outputs What Counts as AI Today?
- Business Adoption Why AI Pilots Often Stall
- Deep Learning Why Layers Changed AI
- Generative AI Why Generative AI Feels Different
- Language Models Why Chatbots Sound So Fluent
- Narrow vs AGI Is Today’s AI Actually General?
- Responsible AI Who Is Responsible When AI Fails?
- +3 more in sidebar



