Section 4: Categories of AI
Machine Learning (ML)
Machine learning systems analyze large volumes of data to uncover patterns and use those patterns to make decisions, predictions, or classifications.
ML-driven tools can recognize abnormal network activity more quickly and consistently than human analysts.
Statistical Learning:
Applies probability and statistical methods to interpret data and forms the foundation of many traditional ML techniques such as Naive Bayes and logistic regression.
Logistic Regression:
Can detect spam messages by estimating the likelihood that an email belongs to the spam category.
Clustering:
Can identify suspicious behavior by grouping related network events together, even when labeled training examples are unavailable.
Deep Learning
Deep learning uses layered neural networks to process information and recognize patterns from data.
These systems automatically discover relevant features and hidden relationships without direct programming, making them effective for detecting subtle irregularities in large datasets.
Transformer Architecture:
Can associate events occurring across different times and systems, such as linking a suspicious account login earlier in the week to a later data theft attempt involving the same user.
Natural Language Processing (NLP)
NLP enables computers to read, interpret, and generate human language.
Earlier NLP technologies depended mainly on statistical techniques like word counting, while modern NLP uses deep learning to understand context, meaning, and intent.
Large Language Models (LLMs):
AI models trained on extensive text datasets to generate and interpret language, such as GPT-4, Claude, and Llama.
LLMs vs. SLMs
| Feature | LLM (Large Language Model) | SLM (Small Language Model) |
|---|---|---|
| Parameters | Hundreds of billions | Millions to several billion |
| Training Data | Massive, broad datasets | Narrow, specialized datasets |
| Task Scope | Handles many language tasks | Focused on specific functions |
| Compute Needs | Requires large cloud GPU infrastructure | Can operate on lightweight devices |
| Example Use | General AI assistant | Local medical coding assistant |
Generative AI
Generative AI creates original content such as text, images, code, audio, and video by learning patterns from existing data.
Within cybersecurity, it supports defensive capabilities like synthetic datasets and automated documentation while also enabling threats such as AI-created phishing attacks and deepfakes.
Synthetic Data:
Artificially produced data that resembles real-world information and is useful when authentic data is scarce, sensitive, or difficult to label.
Threat actors may use generative AI to produce polymorphic malware, realistic deepfakes, and highly personalized phishing schemes.
GAN (Generative Adversarial Network):
Consists of two competing neural networks: one generates fake content while the other attempts to detect it. As training progresses, the generated content becomes increasingly realistic.
Transformers are commonly used for applications like text summarization and code generation, including tools such as GitHub Copilot and ChatGPT.
Section 5: AI Model Training Methods
1. Supervised Learning
In supervised learning, models are trained using labeled datasets where every input includes a correct output.
- Classification: Predicts categories, such as determining whether an email is spam.
- Regression: Predicts numerical values, such as estimating the time until server failure.
Limitations
- Labeling datasets requires significant time and effort.
- Incorrect or inconsistent labels can reduce model quality.
- Models may fail to adapt well to unfamiliar data.
2. Unsupervised Learning
Unsupervised learning identifies hidden structures within unlabeled data.
It can detect unusual network patterns even when no predefined definition of “normal” behavior exists.
Common Techniques
- Clustering: Organizes similar data points into groups, such as identifying compromised network segments based on shared behaviors.
- Dimensionality Reduction: Reduces the number of variables while maintaining key relationships in the data.
Principal Components Analysis (PCA):
A dimensionality reduction approach that projects data onto fewer dimensions while preserving the greatest variance.
A major challenge of unsupervised learning is that results are often difficult to validate because no ground truth exists.
3. Reinforcement Learning (RL)
Reinforcement learning trains an agent through rewards and penalties, similar to conditioning behavior through repetition and feedback.
The agent continuously interacts with its environment, learns from outcomes, and refines its actions over time.
In cybersecurity, RL can optimize intrusion detection thresholds or train agents within simulated cyber environments.
4. Federated Learning
Federated learning enables model training directly where the data resides, without transferring raw data to a central location.
Devices or organizations train local copies of a shared model and send only model updates back to the central system.
Example
A financial institution can develop a fraud detection system across multiple branch servers without consolidating sensitive customer records.
This approach lowers privacy risks and supports compliance with regulations such as GDPR and HIPAA.
5. Model Validation
Model validation evaluates how effectively a model performs on previously unseen data.
Dataset Splits
- Training Set: Used to train the model.
- Validation Set: Used during development to tune settings and detect overfitting.
- Test Set: Used at the end for an unbiased evaluation.
Overfitting vs. Concept Drift
| Issue | Description | Sign | Solution |
|---|---|---|---|
| Overfitting | Model memorizes training data instead of generalizing | Strong training accuracy but weak testing accuracy | Simplify model, add more data, regularize |
| Concept Drift | Real-world patterns change over time | Declining production performance | Retrain using updated datasets |
Example:
A fraud model trained several years ago may become ineffective because attackers have changed their techniques.
6. Fine-Tuning AI Models
Transfer Learning
Transfer learning uses a model already trained on large datasets and adapts it to a specialized task using smaller, focused datasets.
Example
A language model trained on internet text can be fine-tuned using internal incident reports to create a threat-analysis assistant quickly and efficiently.
Fine-tuning helps models adapt to changing environments and improve performance in specialized domains.
Epochs and Iterations
- Epoch: One full pass through the complete training dataset.
- Iteration/Cycle: A single update step involving one batch of data.
Too many epochs may lead to overfitting.
Pruning
Pruning removes unnecessary neurons or connections to reduce model complexity.
This creates faster and smaller models suitable for limited hardware environments.
Quantization
Quantization improves efficiency by lowering the precision of model calculations, such as converting 32-bit values into 8-bit values.
This reduces operational cost and speeds up deployment while maintaining acceptable accuracy.
Section 6: Prompt Engineering
What Is Prompt Engineering?
A prompt is the input or instruction provided to an AI system.
Prompt engineering involves designing prompts that generate accurate, relevant, and useful outputs through iterative refinement.
Prompt Roles
| Role | Function |
|---|---|
| System Role | Defines overall behavior, tone, and restrictions |
| User Role | Specifies the task or request |
| Assistant Role | Shapes the style or context of responses |
Prompting Methods
Zero-Shot Prompting
Provides only instructions without examples.
Best suited for straightforward tasks the model already understands.
One-Shot Prompting
Provides one example along with the instruction.
Useful for demonstrating the desired format or reasoning style.
Multi-Shot Prompting
Provides several examples to establish a pattern.
Helpful for tasks requiring consistency or complex reasoning.
Choosing a Prompting Strategy
| Strategy | Best Use |
|---|---|
| Zero-Shot | Simple and familiar tasks |
| One-Shot | Demonstrating a required output format |
| Multi-Shot | Complex tasks needing structured reasoning |
Section 7: Data Processing
Data Categories and Security Concerns
| Type | Description | Security Concern |
|---|---|---|
| Structured Data | Organized with predefined fields | Easier to secure but vulnerable to SQL injection |
| Unstructured Data | No fixed format | Harder to classify and protect |
| Semi-Structured Data | Mix of structured and unstructured elements | Parsing and schema injection risks |
Data Cleansing
Data cleansing improves consistency and accuracy by removing duplicates, correcting formatting errors, and filtering corrupted records.
Cleaner datasets reduce the risk of incorrect model learning and lower exposure to data poisoning attacks.
Data Verification
Data verification confirms accuracy using trusted references or cryptographic methods like checksums, hashing, and digital signatures.
This helps ensure training data has not been altered.
Data Integrity
Data integrity ensures information remains accurate, complete, and protected from unauthorized modification.
Techniques such as cryptography, access controls, and version tracking support integrity and accountability.
Data Lineage vs. Data Provenance
| Concept | Meaning | Main Focus |
|---|---|---|
| Data Lineage | Tracks data movement and transformations | Where has the data traveled? |
| Data Provenance | Verifies source and authenticity | Where did the data originate? |
Both concepts are important for compliance and auditability.
Data Augmentation
Data augmentation expands datasets using techniques such as image rotation, text rewriting, noise injection, or synthetic generation.
Benefits include:
- Better model performance
- Increased resistance to adversarial attacks
- Reduced dependence on real-world labeled data
Data Balancing
Data balancing addresses unequal class distributions within datasets.
Techniques
- Oversampling: Adds more minority-class examples.
- Undersampling: Removes excess majority-class examples.
- SMOTE: Generates synthetic minority samples through interpolation.
Watermarking
Watermarking embeds hidden identifiers into media or data.
It supports:
- Ownership verification
- Tamper detection
- Provenance tracking
Section 8: Retrieval-Augmented Generation (RAG)
What Is RAG?
RAG allows AI models to retrieve current information during runtime instead of relying only on training knowledge.
Process
- Convert the user query into an embedding.
- Match the embedding against a vector database.
- Retrieve relevant information.
- Insert retrieved content into the prompt.
- Generate a grounded response.
Benefits
- Improved accuracy
- Better explainability
- Up-to-date information without retraining
Protecting the Knowledge Store
The knowledge store contains vectorized organizational information such as policies and threat intelligence.
Security controls should include:
- Strong access restrictions
- Encryption in transit and at rest
- Logging and monitoring
Unauthorized access could expose confidential data.
Ensuring Integrity of Retrieved Data
Organizations should:
- Verify new content before ingestion
- Validate trusted data sources
- Use human review for sensitive information
Poisoned documents can negatively affect all retrieved responses.
Privacy Considerations in RAG
- Store only necessary information
- Prevent unauthorized cross-team retrieval
- Apply encryption and access controls
- Redact confidential outputs when needed
Section 9: Security Throughout the AI Lifecycle
AI Lifecycle Stages
Business Use Case → Data Collection → Data Preparation → Model Development → Evaluation → Deployment → Validation → Monitoring → Feedback and Improvement
Business Alignment
Organizations should clearly define goals, expected value, and system boundaries before development begins.
Early risk assessments help identify potential failures and impacts.
Data Collection
Only approved and verified data sources should be used.
Security, legal, and ethical considerations include:
- Licensing
- Privacy compliance
- Third-party source trustworthiness
Excessive data collection increases both risk and cost.
Data Preparation
Preparation activities should occur within secure environments and include:
- Cleansing
- Sanitization
- Validation
- Dataset splitting
- Augmentation
- Version tracking
Maintaining data quality remains essential.
Model Development and Selection
Training environments must be secured.
- Simpler models are easier to audit.
- Neural networks are powerful but may be more vulnerable to adversarial manipulation.
Adversarial Training
The model is intentionally exposed to maliciously crafted inputs during training so it learns to resist attacks.
Pre-trained models can introduce hidden risks such as vulnerabilities or embedded biases.
Model Evaluation and Validation
- Evaluation: Measures technical performance metrics.
- Validation: Confirms compliance, fairness, and security readiness.
Independent teams and red-team testing often support validation efforts.
Model Deployment and Integration
Secure Deployment Practices
- Harden infrastructure
- Restrict model access
- Encrypt model files
- Validate inputs and outputs
- Maintain tamper-resistant logging
Monitoring and Maintenance
Data Drift vs. Model Drift
| Type | Meaning | Example |
|---|---|---|
| Data Drift | Input data characteristics change | New network traffic patterns emerge |
| Model Drift | Model effectiveness declines | Fraud detection accuracy decreases over time |
Monitoring identifies unusual behavior and potential attacks.
Maintenance tasks include:
- Updating libraries
- Applying patches
- Retraining models
- Adjusting parameters
Feedback loops help improve future performance.
Section 10: Human-Centered AI Design
Core Principles
Human-centered AI prioritizes people throughout the AI lifecycle.
The goal is to assist human decision-making rather than completely replace it.
Transparency and ethical operation remain central objectives.
Human-in-the-Loop
Humans review and approve AI-generated actions before execution.
This is especially important in high-risk cybersecurity environments.
Human Oversight
Monitoring dashboards, alerts, and explainable outputs allow humans to supervise AI behavior effectively.
Human Validation
Human validation ensures AI systems continue to align with organizational objectives and perform appropriately over time.