Concepts / How Neural Networks Process Data

How Neural Networks Process Data

The step that changes between the two paths is the feature step. Traditional machine learning relies on features obtained through manual extraction, while deep learning moves that work into the model, which learns features from the raw data.

  • Programming

Why the Three Terms Get Mixed Up

Artificial intelligence, machine learning, deep learning, and large language models appear together so often in news stories and product descriptions that they can seem like four names for the same thing. They are not interchangeable. These terms name fields that sit inside one another, like a set of nested boxes in which the outermost box is the broadest. Once you can see which box holds which, those headlines and product descriptions become much easier to read.

What do you think happens?

Is a large language model a separate field that competes with deep learning, or is it something that sits inside deep learning?

  • A separate field that competes with deep learning

  • A specific application of deep learning

Reveal answer
Answer:

A specific application of deep learning

Large language models are not a separate field that competes with deep learning. They take the deep learning toolkit and apply it to language, so they sit beneath deep learning in the hierarchy.

Three Nested Boxes

Read the hierarchy from the outside in. Artificial intelligence is the outermost layer and the broadest of the three. It is an umbrella goal, and everything else in this article is a method or subfield used to pursue it. A system can be considered part of AI without using any learning from data at all, which is why the inner boxes are needed to explain how modern systems actually acquire their abilities.

Machine learning sits inside artificial intelligence. It is the subfield concerned with the algorithms used to implement AI. Its central idea is that an algorithm can learn from data and then make predictions or decisions based on what it has seen, without a programmer spelling out every rule in advance. Performance can improve as the algorithm is exposed to more data.

Deep learning sits inside machine learning. It is a specialized branch of machine learning built on neural networks, which are machine learning models loosely inspired by the structure and function of the human brain. What makes deep learning distinctive is its use of multilayer neural networks, meaning networks with many stacked layers of processing. These layers let the model capture complex patterns and abstractions in data.

ArtificialintelligenceThe broadest umbrella goalMachine learningAlgorithms that learn fromdataDeep learningMultilayer neural networksLarge language modelsDeep learning applied tolanguageGenerative AICreates new text, images,or mediacontainscontainsspecific applicationuses deep neural networks
What does each field contain, and how does a deep learning method sit inside machine learning, which sits inside artificial intelligence? Read from the top down: the broadest field is outermost, and the most specialized applications sit at the bottom.

Tracing a Spam Filter Through Training

A spam filter is the classic practical example of machine learning. Follow the state of the system as it moves from raw examples to a decision about a new email. The worked example below uses only the steps described in the source.

Worked example

A learned spam filter

A developer wants a system that decides whether an incoming email is spam, and has a large collection of past emails that people have already labeled as spam or legitimate.

  1. 1
    Start with labeled examples

    The algorithm is given many emails labeled as spam and many labeled as legitimate. The labels are what tell the system the correct answer for each example.

  2. 2
    Adjust during training

    During training, the model adjusts itself to reduce its errors on this labeled collection. Nobody writes down the rule for spam; the model is tuned toward fewer mistakes.

  3. 3
    Pick up patterns

    Over the course of training, the model gradually picks up the patterns and characteristics that tend to mark spam.

  4. 4
    Classify an unseen email

    Once trained, the model looks at an email it has never seen before and classifies it as spam or not spam.

Result

The decision rule came from examples rather than from a list of hand-written phrases, and the trained model can be applied to emails that were not in its training collection.

Developer writes aruleFor example, flag aparticular phraseRule applied to eachemailFixed logic written inadvanceLabeled spam andlegitimate emailsExamples supplied to thealgorithmModel adjusts toreduce errorsDecision rule learned fromdataClassifies unseenemailApplied to new messagesthentrainingafter training
How does the program's logic differ when a developer writes explicit rules versus when the system learns a decision rule from labeled emails?

Hand-Written Rules Versus Learned Rules

The difference between the two columns in the comparison is the heart of machine learning. In the hand-written approach, the developer decides in advance what counts as spam and encodes that decision directly. In the machine learning approach, the developer supplies labeled examples and the algorithm works out a decision rule of its own from them. The first approach is only as good as the rules someone thought to write. The second approach can pick up patterns that a person might not have listed.

QuestionHand-written rulesMachine learning
Where does the decision rule come from?A person writes it in advanceThe algorithm learns it from labeled data
What does the developer supply?The explicit rulesLabeled examples of correct answers
What happens on a new email?The fixed rules are appliedThe trained model classifies it
Can performance improve with more data?Not by itself; rules must be rewrittenYes, performance can improve as more data is processed

The spam filter contrast, using the distinctions the source emphasizes

Where the Features Come From

A feature is a measurable property of the input that a model uses to make its decision. The source highlights how features are obtained as one of the key differences between the fields. Deep learning reduces the need for manual feature extraction. In other words, a deep learning model is not depending on a person to decide in advance which characteristics of the raw data matter. Instead, the stacked layers of a neural network learn the features themselves as the data passes through them.

Raw dataEmails, images, or otherinputHand-designedfeaturesExtracted manually by apersonTraditional modelLearns from the featuresgivenPredictionOutput of the modelLayers learn thefeaturesLearned from raw dataacross stacked layersa person designsfeatures passed inmodel learns
Where do the features come from in each approach, and at which step does a person hand-design them versus the model learning them from raw data?
Key point

The step that changes between the two paths is the feature step. Traditional machine learning relies on features obtained through manual extraction, while deep learning moves that work into the model, which learns features from the raw data.

Inside a Multilayer Network

A neural network is built from layers of processing stacked one after another. The source defines deep learning by the use of networks with three or more layers, and explains that these layers let the model capture complex patterns and abstractions in data. Think of the data as entering at one end, being transformed at each layer, and leaving as a prediction at the other end. The source does not describe the internal arithmetic of each layer, so the important idea to hold onto here is the flow: the same input is progressively reshaped as it passes through the stack.

EASY

Using the spam example, describe in your own words what the input is, what the stacked processing does to it, and what the output is. Then say at which step a person would have needed to choose features in a traditional approach.

Hints
  • The input is an email, and the output is a decision about whether it is spam.
  • A traditional approach has a person choose the features before the model sees them.

Where Large Language Models Fit

Large language models, usually abbreviated LLMs, are a specific application of deep learning techniques. Their defining ability is to process and generate human-like text. Because they apply the deep learning toolkit to language, the most accurate placement is as a specialized application near the bottom of the chain, below deep learning. Trace the path upward in the hierarchy diagram: a large language model is a deep learning application, a deep learning method is a machine learning method, and a machine learning method is an AI method.

Mistakes When Reading AI Terminology

  • Common mistake

    Treating the four terms as interchangeable

    What it looks like

    Using artificial intelligence and deep learning as if they named the same thing

    Why it fails

    The terms name fields that sit inside one another, with artificial intelligence as the broadest box.

    Do this instead

    Locate each term in the nested hierarchy before comparing them.

  • Common mistake

    Assuming every AI system learns from data

    What it looks like

    Concluding that any AI system must be trained on labeled examples

    Why it fails

    A system can be considered part of AI without using any learning from data at all.

    Do this instead

    Reserve machine learning for systems whose decision rules are learned from data.

  • Common mistake

    Equating deep learning with all of machine learning

    What it looks like

    Calling a hand-written rule system or a simple learned model deep learning

    Why it fails

    Deep learning is a specialized branch of machine learning built on multilayer neural networks.

    Do this instead

    Check whether the model uses a neural network with many stacked layers before calling it deep learning.

  • Common mistake

    Placing large language models as a rival field to deep learning

    What it looks like

    Describing LLMs as an alternative to deep learning

    Why it fails

    LLMs are a specific application of deep learning techniques applied to language.

    Do this instead

    Describe LLMs as sitting below deep learning in the hierarchy.

Placing New Terms in the Hierarchy

MEDIUM

A news article describes a chatbot that generates fluent text, and says it was built with deep neural networks trained on very large amounts of text. Using only the hierarchy from this article, state which box or boxes the chatbot belongs to, and explain how you know. Then say whether the spam filter from earlier would belong in the same deep learning box.

Hints
  • Start from the outermost box and ask which fields the chatbot falls inside.
  • Consider whether the system uses a multilayer neural network and whether it is applied to language.
  • For the spam filter, ask whether its model is described as a multilayer neural network in the source.

Recap of the Nested Fields

  1. 1
    Artificial intelligence is the broadest field, containing machine learning, which contains deep learning.
  2. 2
    Machine learning learns decision rules from labeled data, as a spam filter does, instead of relying only on rules written by hand.
  3. 3
    Deep learning uses multilayer neural networks with three or more layers and reduces the need for manual feature extraction.
  4. 4
    Large language models are a specific application of deep learning, so they sit beneath it in the hierarchy.

Key Takeaways

  • Artificial intelligence contains machine learning, which contains deep learning; these are nested fields, not interchangeable terms.
  • A spam filter trained on labeled emails learns its decision rule from examples rather than from hand-written phrase rules.
  • Deep learning differs from traditional machine learning mainly in how features are obtained: deep learning reduces the need for manual feature extraction.
  • Large language models are a specific application of deep learning applied to language, placed beneath deep learning in the hierarchy.

Related concepts

More concepts starting with H