DefensiveHub

Types of AI: Understanding AI, Machine Learning, Deep Learning, and Generative AI

How AI, Machine Learning, Deep Learning, Generative AI and LLMs differ, and how each one relates to the work of a cyber defender.

Ahmed Eid 15 min read

Topic
AI Security
Level
Beginner
You leave with
Tell AI, ML, DL, Generative AI and LLMs apart, and know how each one serves security work

From rules to LLMs: a quick tour

1Rule-BasedRules you write2Machine LearningLearns from data3Deep LearningNeural Networks4Generative AICreates content5LLMsBuilt for language

  1. 1Rules you write yourself, executed exactly as written. The system does not learn from the messages.
  2. 2Machine Learning learns patterns from training data instead of you writing every rule.
  3. 3Deep Learning is ML built on multi-layer Neural Networks, able to pick up more complex patterns.
  4. 4Generative AI produces new content: text, images, audio and code.
  5. 5LLMs are Generative AI specialized in language, usually built on the Transformer.

Before exploring how Artificial Intelligence can be applied to Cybersecurity, we first need to understand what AI actually is and the technologies and concepts behind it.

As a Cybersecurity Professional, knowing how to use AI tools is useful, but it is not enough. You should also understand the technologies powering these tools, how they differ, and when each approach is appropriate.

In this article, we will explore the fundamentals of Artificial Intelligence, starting with rule-based systems and moving through Machine Learning, Deep Learning, Natural Language Processing, Generative AI, and Large Language Models.

We will also tie each concept to practical security scenarios and show how defenders can put it to use.

What Is Artificial Intelligence?

Artificial Intelligence, commonly known as AI, is a broad field of computer science focused on developing systems capable of performing tasks that are typically associated with human intelligence.

These tasks may include:

  • Learning: Acquiring knowledge or identifying patterns from data and experience.
  • Reasoning: Drawing conclusions and connecting information.
  • Problem Solving: Analyzing problems and identifying possible solutions.
  • Perception: Processing information such as images, audio, and other inputs.
  • Decision Making: Evaluating available options and selecting an appropriate action.
  • Language Understanding: Processing and interacting with human language.

The goal is to build systems that can process information and perform complex tasks with varying degrees of autonomy, rather than requiring every individual step to be explicitly programmed.

However, AI is not a single technology, and not all AI systems work in the same way.

Some systems rely on predefined rules. Others learn patterns from data, while more advanced models can generate entirely new content based on what they have learned.

Does All AI Depend on Machine Learning?

No.

This is one of the first concepts worth understanding.

AI is a broad field, and Machine Learning is one of its major branches, but it is not the only way to build intelligent systems.

Consider a simple example.

Imagine you are configuring an Email Security System to identify and block suspicious messages.

You could define rules such as:

  • If the sender appears on a blocklist, block the message.
  • If the email contains a known malicious domain, quarantine it.
  • If the subject matches a predefined suspicious pattern, generate an alert.

In this scenario, the system follows rules that were explicitly defined by an administrator.

It does not learn from incoming emails or independently discover new patterns. It simply executes the logic that has already been configured.

This approach is commonly associated with Rule-Based Systems and, in more sophisticated cases, Symbolic AI or expert systems that use predefined knowledge and logical rules to reach conclusions.

It is important to distinguish between these concepts: not every automation workflow or collection of conditional statements should be considered AI. Some are simply traditional software automation.

The key takeaway is that AI includes different approaches, and not all of them require Machine Learning.

Machine Learning (ML)

Machine Learning is one of the most important branches of Artificial Intelligence.

Instead of manually defining every rule, Machine Learning uses algorithms that learn patterns and relationships from data.

For example, rather than creating a rule that says:

“If an email contains a specific keyword, classify it as malicious.”

We can provide a model with a large collection of emails, some labeled as benign and others as malicious, and train it to identify characteristics that help distinguish between them.

Once trained, the model can make predictions or classifications on new emails it has not previously encountered.

One email, two approaches

Rule-BasedBlocklist · Domain · SubjectNo rule matchedDelivered to the userNew pattern, no rule for itMachine LearningModelFeatures > ScoreScore 0.93QuarantineHeld for review
A simplified teaching example. A model can be wrong too: the point is the difference in approach, not in accuracy.

How Does Machine Learning Work?

At a high level, a typical Machine Learning workflow includes several stages:

Machine Learning workflow

1Data CollectionGather training data2Data PreparationClean the data3Feature SelectionChoose the features4Model TrainingTrain the algorithm5Model EvaluationTest on unseen data6PredictionUse on new data
A simplified view. Result quality depends on data quality and on how well the test data represents real-world conditions.
  1. Data Collection: Gathering the data required for training.
  2. Data Preparation: Cleaning and preparing the dataset.
  3. Feature Selection: Identifying relevant characteristics that may help the model learn.
  4. Model Training: Using the prepared data to train the algorithm.
  5. Model Evaluation: Testing the model against data that was not used during training.
  6. Prediction: Using the trained model to analyze new data.

For an Email Security use case, relevant features might include:

  • Sender Reputation.
  • Email Header Information.
  • URL Characteristics.
  • Attachment Type.
  • Message Patterns.
  • Previous Classification Results.

The model uses these features to estimate whether an email is likely to be malicious or legitimate.

The quality of the results depends on several factors, including training data quality, model selection, evaluation methodology, and how well the test data represents real-world conditions.

Major Types of Machine Learning

There are several approaches to training Machine Learning models. Three fundamental categories are particularly important to understand.

Three ways to learn

SupervisedData with labelsBenignMaliciousModelUnsupervisedNo labelsAnomaly ?ReinforcementTrial and feedbackAgentEnvironmentActionReward / Penalty

  1. 1Supervised: the data carries labels (Benign or Malicious), and the model learns the link between features and label.
  2. 2Unsupervised: no labels. The model groups similar activity, and something different is not necessarily malicious.
  3. 3Reinforcement: an agent tries an action and gets a reward or penalty, learning over the long run.

1. Supervised Learning

Supervised Learning uses training data that contains predefined labels.

Each record in the dataset has an associated expected output.

For example:

EmailLabel
Email ABenign
Email BMalicious
Email CBenign
Email DMalicious

The model learns relationships between the email characteristics and their corresponding labels.

After training, it can use what it has learned to classify new emails.

Common applications include:

  • Spam Detection.
  • Malware Classification.
  • Phishing Detection.
  • Malicious URL Classification.

2. Unsupervised Learning

Unlike Supervised Learning, Unsupervised Learning works with data that does not have predefined labels.

The model attempts to identify patterns, groups, or relationships within the dataset.

Consider a Cybersecurity scenario.

You have thousands of authentication events, but you do not have predefined labels identifying which activities are normal or suspicious.

Clustering algorithms could help group similar activities together, making it easier to identify unusual patterns that deserve further investigation.

Related applications include:

  • Clustering.
  • Anomaly Detection.
  • Pattern Discovery.

However, an anomaly does not automatically indicate malicious activity. An unusual event may be perfectly legitimate within the context of a particular environment.

3. Reinforcement Learning

Reinforcement Learning takes a different approach.

Instead of learning from a dataset containing predefined correct answers, an agent learns by interacting with an environment.

The agent performs an action and receives feedback in the form of a reward or penalty, depending on the outcome.

Through repeated interactions, it learns which actions are more likely to produce favorable results over time.

Potential applications include resource optimization and certain automated decision-making scenarios.

It is important, however, not to assume that every security automation workflow uses Reinforcement Learning.

Other approaches also exist, including Semi-Supervised Learning and Self-Supervised Learning, which we will explore in more detail in future articles.

Deep Learning (DL)

Next up is Deep Learning.

Deep Learning is a subset of Machine Learning that primarily relies on Artificial Neural Networks.

These networks consist of interconnected computational units organized into layers, allowing models to process data and learn increasingly complex patterns.

A simplified Neural Network typically contains:

  • Input Layer: Receives the input data.
  • Hidden Layers: Process information and learn patterns.
  • Output Layer: Produces the final result.

How a Neural Network passes information

File featuresMaliciousBenignInput LayerHidden LayersOutput Layer
A simplified view: the dots lighting up in order are the information moving from layer to layer until a result comes out.

Deep Learning models use multiple hidden layers, allowing them to learn complex relationships within large datasets.

Some of the major applications of Deep Learning include:

  • Image Recognition.
  • Speech Recognition.
  • Natural Language Processing.
  • Computer Vision.
  • Complex Pattern Detection.

Deep Learning in Cybersecurity

Let’s look at a few examples relevant to Cybersecurity.

Malware Analysis

Deep Learning models can be used to analyze file characteristics or program behavior and help classify potentially malicious files.

Network Traffic Analysis

Models can analyze network traffic and identify unusual patterns or complex relationships between different traffic features.

Behavioral Analysis

Deep Learning can help analyze user or device behavior and identify activities that deviate from established patterns.

However, using Deep Learning does not automatically guarantee better results than traditional approaches.

The appropriate model depends on the problem being solved, available data, data quality, and computational resources.

Natural Language Processing (NLP)

Natural Language Processing, or NLP, is a field focused on enabling computers to process, analyze, and interact with human language.

In other words, NLP helps computers work with written text and spoken language to extract useful information.

This is particularly relevant to Cybersecurity because a significant portion of the information we deal with is text-based.

Examples include:

  • Security Logs.
  • SIEM Alerts.
  • Incident Reports.
  • Threat Intelligence Reports.
  • Email Messages.
  • Malware Reports.
  • Attacker Communications.

NLP Applications in Cybersecurity

1. Phishing Email Analysis

NLP techniques can analyze email content and identify suspicious language patterns, potential impersonation attempts, and other indicators associated with phishing.

2. Threat Intelligence Analysis

Security teams often deal with large volumes of threat intelligence reports.

NLP can help extract information such as Threat Actor names, Malware Families, Indicators of Compromise, and relationships between different entities.

3. Security Alert Classification

NLP techniques can help classify text within security alerts or group similar alerts together, making it easier for analysts to understand and investigate security events.

It is worth noting that NLP does not always require Deep Learning. Traditional statistical and rule-based techniques can also be used, while modern NLP systems increasingly rely on Deep Learning models.

Generative AI

Generative AI is probably one of the most widely recognized areas of Artificial Intelligence today, largely due to the popularity of tools such as ChatGPT.

Generative AI refers to AI systems capable of producing new content based on patterns and relationships learned from training data.

The generated content may include:

  • Text.
  • Images.
  • Audio.
  • Video.
  • Code.

Unlike systems designed primarily for classification or prediction, Generative AI models can produce new outputs in response to an input or prompt.

Common applications include:

  • Writing and summarizing content.
  • Image generation.
  • Code generation.
  • Text-to-speech.
  • Information analysis and assistance.

Modern Generative AI systems rely heavily on Deep Learning and advanced Neural Network architectures.

However, Generative AI is not limited to ChatGPT or text-based systems. Different generative models specialize in images, audio, video, and other types of content.

Generative AI in Cybersecurity

This is where it gets useful for security work.

1. Security Log Analysis

Generative AI can help interpret collections of logs, summarize relevant events, and explain potential relationships between them.

2. Incident Investigation

It can assist analysts in organizing available information, summarizing incident timelines, and suggesting additional investigation questions.

3. Detection Engineering

Generative AI can help draft or review detection logic, generate initial KQL or SPL queries, and explain what different parts of a query are intended to do.

However, generated queries must be reviewed and tested against actual data before being used in production.

4. Threat Intelligence

Generative AI can summarize lengthy threat reports, extract relevant indicators, and turn complex information into more accessible summaries.

5. Security Knowledge Assistance

It can help security analysts understand technical concepts, review documentation, and explore information related to a particular investigation.

There is an important limitation to consider: Generative AI can produce inaccurate information or invent details that are not supported by the available sources.

This behavior is particularly important in Cybersecurity, where incorrect assumptions can lead to poor investigation decisions or ineffective detection logic.

For that reason, generated outputs should always be validated before being used in security workflows.

Large Language Models (LLMs)

Closely tied to Generative AI is another concept worth knowing: Large Language Models, or LLMs.

LLMs are models designed to process and generate human language based on patterns and relationships learned during training.

Popular conversational AI systems, including those powering ChatGPT and similar assistants, use Large Language Models.

Most modern LLMs are based on Deep Learning and use an architecture known as the Transformer.

At a high level, an LLM is trained on large collections of text and learns relationships between words, tokens, and the context in which they appear.

During inference, the model receives an input and generates an output progressively.

An LLM generates one token at a time

MultiplefailedlogonsfromthesamePromptNext-token probabilities (illustrative numbers)IP62%user21%host9%IP?Repeats this step: token after token

  1. 1The LLM takes the prompt, split into tokens.
  2. 2It scores every token that could come next. The numbers here are illustrative, not from a real model.
  3. 3It picks a token (often the most probable one) and appends it to the sentence.
  4. 4Then it repeats. That is why it generates an answer rather than looking one up, and why it can be wrong even when it sounds confident.

An important distinction is that an LLM is not simply a search engine retrieving a ready-made answer from the internet.

It generates responses based on its learned representations and the context provided to it.

As a result, an LLM may produce incorrect information even when the response sounds confident and convincing.

This is one of the main reasons why verification is essential, particularly when using LLMs in security-related tasks.

How Are These Concepts Related?

After exploring these concepts, it may seem that they are all completely separate technologies.

In reality, they are connected in several important ways.

Concept map

Artificial IntelligenceThe broadest fieldMachine LearningLearns from dataDeep LearningMulti-layer Neural NetworksRule-Based SystemsRules we write ourselves, no learning from dataNLPA field that overlaps ML and DLGenerative AICreates new content, often via DLLLMsLanguage-focused Generative AI
The only strict hierarchy here is AI, then ML, then DL. NLP, Generative AI and LLMs cut across it rather than adding layers inside it.

We can summarize their relationships as follows:

  • Artificial Intelligence: The broader field that includes different approaches to building intelligent systems.
  • Machine Learning: A branch of AI focused on learning patterns from data.
  • Deep Learning: A subset of Machine Learning based on multi-layer Neural Networks.
  • NLP: A field focused on processing human language, often using Machine Learning and Deep Learning techniques.
  • Generative AI: AI systems capable of generating new content, with modern implementations often relying on Deep Learning.
  • LLMs: A type of Generative AI model specialized in language.

It is important to understand that these concepts do not all belong to a single, strictly hierarchical structure.

Machine Learning and Deep Learning have a clear subset relationship. NLP is a field that overlaps with both, while Generative AI describes a capability or category of models rather than simply another equivalent branch.

A single model can therefore belong to several of these categories simultaneously.

For example, an LLM can be described as:

  • An AI system.
  • A Machine Learning model.
  • A Deep Learning model.
  • An NLP model.
  • A Generative AI model.

Each description highlights a different aspect of the same technology.

Does AI Mean Cybersecurity Is Becoming Fully Automated?

No, and this is an important point to understand.

AI can help analyze large volumes of data, identify patterns, summarize information, and accelerate certain workflows.

However, this does not mean that security teams can rely entirely on AI without human review.

Consider Security Operations.

An anomaly detection system may identify unusual activity that turns out to be legitimate.

A Generative AI model may produce a query that looks correct but contains flawed detection logic.

It may also misinterpret a log entry or infer a relationship that does not actually exist.

That is why effective AI adoption requires several important considerations:

  • Data Quality: The quality and relevance of the data used by the system.
  • Model Evaluation: Measuring how well the model performs under realistic conditions.
  • Human Oversight: Keeping analysts involved in important decisions.
  • Output Validation: Verifying generated results before relying on them.
  • Continuous Monitoring: Monitoring model behavior and performance over time.

The objective is not simply to replace Security Analysts with AI.

It is to provide analysts with better tools that help them work more efficiently while preserving human judgment and verification.

AI Is Not Just a Defensive Tool

There is one more angle every security professional should keep in mind.

AI technologies can improve defensive capabilities, but they can also be misused by attackers to support malicious activities or develop more sophisticated techniques.

At the same time, AI systems themselves have become potential targets for cyberattacks.

This has led to the development of an increasingly important area known as AI Security, which focuses on securing AI systems and protecting the data, models, and infrastructure behind them.

A closely related field is Adversarial Machine Learning, which studies how Machine Learning models can be manipulated or exploited through carefully crafted inputs, training data, or other attack techniques.

Examples of relevant threats include:

  • Data Poisoning.
  • Evasion Attacks.
  • Model Extraction.
  • Privacy Attacks.
  • Adversarial Examples.

Attacks on AI systems: where do they hit?

Training DataLearns from itTrainingBuilds the modelModelThe finished modelInferenceUsing the modelData PoisoningTampered dataPrivacy AttacksLeaking dataEvasion AttacksAdversarial ExamplesModel ExtractionCopying the modelPrompt InjectionSteering an LLM
A simplified picture. One attack can touch more than one stage, and the more precise taxonomy is in the NIST Adversarial Machine Learning reference at the end.

As Generative AI and LLMs become more widely adopted, additional security concerns have emerged, including Prompt Injection and Sensitive Information Disclosure.

We will explore these topics in more detail in future articles within the AI Security section of DefensiveHub.

Final Thoughts

Artificial Intelligence is not a single technology. It is a broad field that includes many different approaches, techniques, and technologies.

In this article, we started by understanding the difference between rule-based systems and systems that learn from data. We then explored Machine Learning, Deep Learning, NLP, Generative AI, and Large Language Models.

The objective is not simply to memorize definitions or technology names.

It is to understand what happens behind the tools we use, how these technologies can be applied to Cybersecurity, and what risks we need to consider when adopting them.

As Cybersecurity Professionals, we should not only understand how to use AI.

We should also understand how to secure AI systems, how attackers may exploit these technologies, and how defenders can use them responsibly to improve Threat Detection and Security Operations.

These fundamentals will serve as the foundation for the rest of the AI Security series on DefensiveHub.

References and Further Reading

  • NIST - Artificial Intelligence Glossary.
  • IBM - What Is Artificial Intelligence?
  • Google - Machine Learning Crash Course.
  • NIST - AI Risk Management Framework.
  • NIST - Adversarial Machine Learning: A Taxonomy and Terminology of Attacks and Mitigations.

Ahmed Eid. I write about the defensive security work I do every day, and explain it in Arabic to save you time.