PRIMER · MACHINE LEARNING

Machine Learning, Explained: How AI Learns From Examples

A plain-English primer on machine learning: how software learns from examples instead of hand-written rules, the difference between predicting a category and predicting a number, how large language models and deep networks fit in, and why the recent AI boom happened when it did.

On this page
  1. Artificial Intelligence, Machine Learning and Models
  2. Supervised Learning: Learning From Examples With Answers
  3. Generative AI Uses the Same Basic Idea
  4. Neural Networks and Deep Learning
  5. Why Machine Learning Took Off Now
  6. Transformers: The Architecture Behind Modern Language Models
  7. Machine Learning Is Not Only Supervised Learning
  8. How to Think About Business Uses
  9. The Practical Takeaway
  10. Glossary
  11. References
  12. Footnotes
In 60 seconds
  • Much of today’s AI boom comes from machine learning: software that learns from examples instead of following hand-written rules.
  • The most common type is supervised learning. It works by matching inputs to outputs. An email goes in, and the model predicts whether it is spam. An audio clip goes in, and the model predicts the transcript. A factory photo goes in, and the model predicts whether a product has a defect.
  • Generative AI uses a related idea. Large language models, such as ChatGPT, Claude and Gemini, learn by predicting the next piece of text across massive collections of writing. Later, they are trained to follow instructions more usefully.
  • This AI boom happened because three things came together: more digital data, stronger computer chips and larger neural networks.
  • The practical question is no longer whether AI is impressive. It is where prediction, automation and generation can create real value without creating unnecessary risk.

Much of today’s AI boom comes from machine learning: software that improves by studying examples rather than following hand-written rules. The most common form is supervised learning, where a system learns to turn one kind of input into one kind of output.

For example, give it an email, and it predicts whether the message is spam. Give it an audio clip, and it predicts the words being spoken. Give it a product photo from a factory line, and it predicts whether the item has a scratch, dent or other defect.

MODELSPAMTEXTDEFECTemailaudiophoto
Fig. 1 · Input in, prediction out. The same shape sits under most everyday AI: an email becomes 'spam,' an audio clip becomes text, a factory photo becomes a defect warning. Different inputs, one job: predict the answer.

At first, that may sound narrow. In practice, however, it is one of the most useful ideas in modern computing.

The bigger picture

Artificial Intelligence, Machine Learning and Models#

To begin with, artificial intelligence is the broad field of making computers perform tasks that normally require human intelligence. These tasks include recognizing speech, understanding visual information, translating languages, planning routes, detecting fraud, writing text and answering questions.

Within that broader field, machine learning is one of the most important branches. Instead of telling a computer every rule by hand, engineers give it examples. The system studies those examples and learns patterns.1

The trained system is called a model. Before training, the model knows little or nothing about the task. During training, it adjusts itself by comparing its predictions with examples. After training, it can make predictions on new cases it has never seen before. This final step, when the trained model is used in the real world, is called inference.

As a result, many AI products that seem very different on the surface rely on the same basic process. Microsoft Copilot helps draft documents and summarize meetings. Google Gemini answers questions and works across text, visual information and code. Apple announced Apple Intelligence in 2024 to bring generative AI features into iPhones, iPads and Macs.2 OpenAI’s GPT-4o, also announced in 2024, showed how quickly AI systems were moving toward voice, text and visual interaction in one interface.3

Although these products look new, the basic idea behind them is older: train a model on data, then use it to make useful predictions.

Learning from examples with answers

Supervised Learning: Learning From Examples With Answers#

The easiest type of machine learning to understand is supervised learning. Supervised learning is machine learning built from examples that already include the correct answer.

That correct answer is called a label. For instance, if the model is learning to identify spam, the label might be “spam” or “not spam.” If the model is learning to estimate house prices, the label is the actual selling price. If the model is learning to transcribe speech, the label is the correct written transcript.

In each case, the model learns by making a guess, checking that guess against the label, and adjusting itself to reduce future mistakes.

There are two common types of supervised learning: classification and regression.

Classification means choosing a category. For example, is this transaction fraudulent or legitimate? Is this scan normal or abnormal? Is this customer likely to cancel or renew?

Regression, by contrast, means predicting a number. For example, what will tomorrow’s demand be? What price should this product have? How long will this delivery take?

CLASSIFICATIONfraudokREGRESSIONlowhigh£420k
Fig. 2 · Two jobs, one method. Supervised learning splits by the kind of answer. Classification chooses a category (fraud or legitimate); regression predicts a number (tomorrow's demand, a price, a delivery time). Same learning, different output.

Together, classification and regression cover a large share of everyday machine learning applications. The same input-output pattern appears in many familiar systems.

In spam filtering, the input is an email and the output is a label: spam or not spam. Today, filters also detect phishing, malware links and suspicious sender behavior. This has become more important as criminals use generative AI to write more convincing scam emails.

Similarly, in speech recognition, the input is an audio recording and the output is text. This is the technology behind dictation tools, voice assistants, call center transcription and live captions. Public demonstrations of voice-based AI in 2024 made this feel new, but the underlying technology has been improving for years because models have been trained on huge collections of audio paired with transcripts. Commercial speech tools such as ElevenLabs (affiliate link) are built on exactly this pairing, in both directions: speech into text, and text back into natural-sounding speech.

Another example is machine translation. Here, the input is text in one language and the output is the same meaning in another language. Early translation tools often sounded stiff. Modern systems produce more natural translations because they have learned from enormous collections of multilingual text.

Online advertising is one of the clearest business examples. In this case, the input includes information about a user, an ad, a page, a location, a device and previous behavior. The output is a prediction: is this person likely to click, buy, subscribe or ignore the ad? This is not the noblest use of AI, but it is one of the clearest examples of prediction turning into revenue.

The same logic applies in manufacturing. A factory might use a photo of a product moving down an assembly line as the input. The output tells the factory whether the product has a scratch, crack, dent, contamination mark or alignment problem. As a result, defective products can be caught earlier, which reduces waste and improves quality.

In logistics, machine learning predicts delivery delays, address problems, demand spikes and routing bottlenecks. UPS, FedEx and Amazon have all invested heavily in prediction systems because even a small improvement in routing or delivery accuracy can save large sums of money.

Finance offers another clear example. Banks and payment networks use machine learning to detect fraud. The input might include transaction amount, merchant, location, time of day, device fingerprint and customer history. The output is a risk score. If the score is high, the transaction may be blocked or sent for review.

In short, the pattern is simple: input in, prediction out. The hard part is collecting the right examples and training the model well enough to work on messy real-world cases.

The same idea, at scale

Generative AI Uses the Same Basic Idea#

The same basic idea also helps explain generative AI. Generative AI produces new material, such as text, code, audio, designs or other structured outputs. Large language models, often called LLMs, are the text-based systems behind tools such as ChatGPT, Claude, Gemini and similar products.

An LLM is trained to predict text. More precisely, it predicts tokens. A token is a small chunk of text. Sometimes it is a word. Sometimes it is part of a word. The model reads previous tokens and predicts what token should come next.

Consider this sentence:

“My favorite drink is lychee bubble tea.”

That sentence can be turned into several training examples.

Given “My favorite drink,” the model should predict “is.”

Given “My favorite drink is,” the model should predict “lychee.”

Given “My favorite drink is lychee,” the model should predict “bubble.”

The same process continues through the sentence. When repeated across enormous text collections, this trains a model to produce fluent continuations of text.

Interactive // next-token prediction

This model has read a lot of one person's messages, so it has a strong guess for what comes next. Pick a word to keep going. Choosing a less likely one is exactly how the same model can write a different sentence.

My favorite drink is

Model's guesses for the next token, most likely first:

This approach is often called self-supervised learning. It is similar to supervised learning because the model still learns from inputs and answers. The difference is that humans do not have to label every example by hand. Instead, the text itself provides the answer. If the phrase is “the capital of France is Paris,” the word “Paris” becomes the answer the model tries to predict.

However, that explains only the first stage of training. A raw language model is good at continuing text. It is not automatically good at following instructions.

For that reason, developers add further training. They show the model examples of helpful answers, compare better and worse responses, and tune it to follow user instructions more reliably.

One common method is reinforcement learning from human feedback. In plain language, humans rank model answers, and the model learns to produce answers closer to the ones people preferred. Newer methods also use AI-generated feedback, synthetic training data and automated evaluation to improve behavior.

This distinction matters because a useful chatbot is not simply continuing random internet text. When someone asks it to summarize a contract, write code or explain a medical term, the system generates a likely answer based on patterns learned during training and shaped by later instruction tuning.

At the same time, this power creates problems. In 2024, Google paused parts of Gemini’s visual tool after users found that it produced historically inaccurate results.4 The incident showed that controlling model behavior is difficult. If developers push too hard in one direction, a model can produce strange or distorted results. If they push too little, it may produce biased, unsafe or low-quality output.

Legal and policy debates have also intensified. The New York Times lawsuit against OpenAI and Microsoft, filed in late 2023, turned public attention toward training data.5 Publishers, artists, software developers and media companies have asked whether AI firms should be allowed to train models on copyrighted material without permission.

Meanwhile, regulation has started to catch up. The European Union’s AI Act, approved in 2024, created rules for high-risk AI systems and transparency requirements for some general-purpose AI models.6 This reflected a wider shift: governments no longer see AI as just a research topic. They increasingly see it as infrastructure that affects jobs, markets, privacy, security and civil rights.

When the patterns get deep

Neural Networks and Deep Learning#

To understand why modern machine learning became so powerful, it helps to look at neural networks.

A neural network is a machine learning model made of layers of simple mathematical units. Each unit receives numbers, transforms them and passes the result onward. During training, the system learns by adjusting millions, billions or even trillions of internal values called parameters.

A parameter is a number inside the model that changes during training. The model’s knowledge is stored in these parameters. When a large language model seems to know grammar, facts, style and reasoning patterns, that information is not stored as a normal database. Instead, it is distributed across its parameters.

Deep learning means using neural networks with many layers. The word “deep” refers to depth: many layers of computation between the input and the output.

This matters because deep learning can find complex patterns that older methods often missed. A shallow model might notice simple signals. A deep model can combine simple signals into more complex ones.

In image recognition, for example, early layers might detect edges. Later layers might detect shapes. Deeper layers might detect eyes, wheels, cracks, tumors or road signs.7

EDGESPARTSOBJECT
Fig. 3 · From edges to objects. In a deep network, early layers pick out simple signals like edges; later layers combine them into shapes and parts; the deepest into whole objects. The network builds these ideas itself, because doing so improves its guesses.

In language, the pattern is similar. Early layers might capture word patterns. Later layers might capture grammar, meaning, topic, tone and relationships across long passages.

For this reason, deep learning became central to speech recognition, translation, visual analysis, recommendation systems, robotics and generative AI.

Why now, not ten years ago

Why Machine Learning Took Off Now#

Machine learning has existed for decades. The timing of the boom is not accidental. Three things changed: data, computing power and model size.

DATACOMPUTESCALENOW
Fig. 4 · Why now, not ten years ago. Three things changed together and reinforced one another: far more digital data to learn from, GPUs fast enough to train large models, and the discovery that bigger models trained on more data keep improving. No single one was enough.

First, the world created far more digital data. Emails, photos, search queries, clicks, purchases, GPS traces, medical scans, factory readings and customer service chats all became machine-readable. A model cannot learn useful patterns unless it has examples. The internet, smartphones, cloud software and connected sensors created those examples in huge quantities.

Second, computers became powerful enough to train large models. The key hardware is the GPU, or graphics processing unit. GPUs were originally built to render video game graphics, but they are very good at doing many mathematical operations at the same time. Neural networks require that kind of parallel computation.

This is one reason Nvidia became one of the most important companies in the AI economy. Demand for its H100 chips surged during the generative AI boom, and its Blackwell chips, announced in 2024, were designed for even larger AI workloads.8 The chip story matters because AI progress is not only about clever algorithms. It is also about electricity, data centers, memory, networking and specialized processors. Owning this hardware is out of reach for most teams, so smaller companies and researchers usually rent it by the hour from GPU clouds such as RunPod (affiliate link).

Third, researchers discovered that larger models often kept improving when trained on more data and more compute. Older approaches would often plateau. After a certain point, more data did not help much. Large neural networks behaved differently. In many tasks, they improved as researchers increased the data, the number of parameters and the amount of computation.

This process is called scaling.9 Scaling does not solve every problem, and it is expensive. Even so, it explains much of the leap from older AI tools to today’s generative systems.

However, the cost is becoming harder to ignore. Large AI models require expensive chips, large data centers and significant electricity. By 2024, the energy use of AI data centers had become a serious business and policy issue. As a result, companies began looking for smaller models, more efficient chips and better training methods because brute-force scaling is not always affordable.

The architecture behind chatbots

Transformers: The Architecture Behind Modern Language Models#

Another important breakthrough was the transformer.

A transformer is a type of neural network architecture that became central to modern AI.10 It is especially good at handling sequences: sentences, paragraphs, code, audio, DNA, time series and other ordered data.

The important feature of transformers is attention. Attention lets the model decide which parts of the input are most relevant at each step.

For example, if a sentence says, “The trophy would not fit in the suitcase because it was too large,” the model needs to infer that “it” refers to the trophy, not the suitcase. Attention helps the model track those relationships.

trophysuitcaseitbecause“…too large.”
Fig. 5 · What does 'it' point to? Attention lets a model weigh which earlier words matter at each step. In 'the trophy would not fit in the suitcase because it was too large,' the model leans heavily on 'trophy' and lightly on 'suitcase.' That weighting is the mechanism.

As a result, transformers made it practical to train very large models on huge datasets. They are one reason modern language models can summarize long passages, write code, translate languages and answer questions across many topics.

They also made AI more general. A single model can now handle tasks that previously required separate systems: translation, summarization, classification, question answering, writing assistance and code generation.

Beyond supervised learning

Machine Learning Is Not Only Supervised Learning#

Although supervised learning is the easiest place to start, it is not the only type of machine learning.

Unsupervised learning looks for patterns in data without labeled answers. For example, a retailer might use it to group customers by shopping behavior without first defining the groups. A cybersecurity system might use it to detect unusual network activity that does not match normal patterns.

Self-supervised learning creates its own labels from raw data. LLM pre-training is the best-known example. The model hides part of the text and learns to predict it. This reduces the need for humans to label every example.

Reinforcement learning, meanwhile, trains a system through rewards and penalties. Instead of learning from a fixed answer key, the system learns by trying actions and receiving feedback. This is used in game-playing systems, robotics, recommendation optimization and some AI alignment methods.

A related development is the AI agent. An AI agent is a system that can take steps toward a goal, rather than only responding once to a prompt. An agent might search information, call tools, write code, check the result and try again.

For businesses, this idea is attractive because it moves AI from answering questions to completing tasks. Companies are exploring agents for customer support, software engineering, data analysis, scheduling and business operations. However, it also creates risk because systems that take actions need stronger controls, testing and monitoring.

Putting it to work

How to Think About Business Uses#

The practical starting point is not “How can we use AI?” A better question is: “Where do we make repeated decisions that could be improved with better predictions?”

A strong machine learning opportunity usually has five ingredients.

First, there is a repeated task. The same kind of decision happens many times.

Second, there is usable data. The company has examples from the past.

Third, there is a clear target. The model knows what it is trying to predict.

Fourth, there is business value. Better predictions save money, increase revenue, reduce risk or improve customer experience.

Finally, there is a feedback loop. The company can measure whether the model is working and improve it over time.

A repeated taskUsable data from the pastA clear target to predictReal business valueA feedback loop to improve
Fig. 6 · Five ingredients of a strong ML problem. Machine learning fits best when a task is repeated often, has usable data from the past, a clear target to predict, real business value, and a feedback loop to measure results and improve.

These conditions appear in many industries. A hospital may want to predict which patients are at risk of readmission. A retailer may want to forecast demand by store and product. A bank may want to detect suspicious transactions. A manufacturer may want to spot defects earlier. A law firm may want to search contracts faster. An insurance company may want to estimate claim risk. A software company may want to identify customers likely to cancel.

In each case, the same principle applies. Machine learning works best when the problem can be expressed clearly: given this information, predict that outcome.

Question //What most sets machine learning apart from traditional, hand-written software?

The one thing to remember

The Practical Takeaway#

Taken together, machine learning is the central technique behind many practical AI systems. Its most common form, supervised learning, learns from examples with answers. The model studies inputs and outputs until it can make useful predictions on new cases.

Large language models use a related idea at much greater scale. They learn from massive text collections by predicting the next token, then receive further training to follow instructions. That is how systems such as ChatGPT, Claude, Gemini and Copilot can draft, summarize, translate, code and answer questions.

The recent AI boom came from a combination of more data, larger neural networks, better training techniques and powerful chips. News stories about Nvidia, Google Gemini, Microsoft Copilot, Apple Intelligence, OpenAI, copyright lawsuits and AI regulation are all different parts of the same larger shift: machine learning has moved from research labs into everyday business infrastructure.

Therefore, the useful question now is not whether AI is impressive. It is where prediction, automation and generation can produce real value without creating unacceptable risk.

In one line

Machine learning is software that improves by studying examples rather than following rules a person wrote by hand. Almost everything called “AI” today, from spam filters to chatbots, is built on that one idea.

Reference

Glossary#

Machine learning
Software that improves by studying examples rather than following rules a person wrote by hand.
Model
The trained system a machine-learning process produces: the learned pattern that turns an input into a prediction.
Inference
Using a trained model on a new case in the real world, as opposed to training it.
Label
The correct answer attached to a training example, such as "spam" or a house's actual selling price.
Supervised learning
Machine learning built from examples that already include the correct answer. The most common type in use today.
Classification
A prediction task where the answer is a category: spam or not, fraud or legitimate, normal or abnormal.
Regression
A prediction task where the answer is a number: tomorrow's demand, a price, a delivery time.
Parameter
A number inside a model that changes during training. A model's knowledge is stored across its parameters.
Neural network
A machine-learning model made of layers of simple mathematical units, each passing numbers to the next.
Deep learning
Using neural networks with many layers, which lets a model combine simple signals into complex ones.
Transformer
A neural network architecture that is especially good at sequences and underlies modern language models.
Token
A small chunk of text a language model reads and predicts: sometimes a whole word, sometimes part of one.

Sources

References#

Dates and product or industry facts below are 2013–2024 snapshots from the cited primary and news sources, verified 2026-07-22.

Footnotes#

  1. MIT Sloan School of Management, “Machine learning, explained,” 2021. mitsloan.mit.edu.

  2. Apple, “Introducing Apple Intelligence for iPhone, iPad, and Mac,” 10 Jun 2024. apple.com/newsroom.

  3. OpenAI, “Hello GPT-4o,” 13 May 2024. openai.com.

  4. Google, “Gemini image generation got it wrong. We’ll do better,” Feb 2024. blog.google. See also CNBC, “Google pauses Gemini AI image generator after inaccuracies,” 22 Feb 2024. cnbc.com.

  5. CNBC, “New York Times sues Microsoft, ChatGPT maker OpenAI over copyright infringement,” 27 Dec 2023. cnbc.com.

  6. European Parliament, “EU AI Act: first regulation on artificial intelligence,” 2024 (Regulation (EU) 2024/1689). europarl.europa.eu.

  7. Matthew D. Zeiler and Rob Fergus, “Visualizing and Understanding Convolutional Networks,” 2013. arxiv.org/abs/1311.2901. See also Yann LeCun, Yoshua Bengio and Geoffrey Hinton, “Deep learning,” Nature 521, 436–444 (2015). doi.org/10.1038/nature14539.

  8. NVIDIA, “NVIDIA Blackwell Platform Arrives to Power a New Era of Computing,” 18 Mar 2024. nvidianews.nvidia.com.

  9. Jared Kaplan et al., “Scaling Laws for Neural Language Models,” 2020. arxiv.org/abs/2001.08361.

  10. Ashish Vaswani et al., “Attention Is All You Need,” 2017. arxiv.org/abs/1706.03762.

Loading…

Sign in or create an account.

Enter your email and we will send you a sign-in link. No password needed.

or continue with