The Machine Learning Process

Generative AI Award · Topic 1.3

The machine learning process

A model that predicts an exam score from hours studied, taken through every stage of the machine learning pipeline — from framing the problem to reviewing the result. Step through it below.

Loss trace (mean squared error)

Deep Learning Multi-Layer Neural Network Visualizer

Artificial Intelligence & Deep Learning

Demystifying Deep Learning & Backpropagation

A Visual & Mathematical Deep Dive into Multi-Layered Neural Networks

In the study of modern Artificial Intelligence—specifically within frameworks such as the EXIN BCS Generative AI Award syllabus—Deep Learning (DL) stands out as a critical subfield of Machine Learning. Unlike traditional rule-based or shallow statistical systems, deep learning utilizes multi-layered artificial neural networks capable of modeling complex, non-linear structures in massive datasets.

1. What is Deep Learning?

At its core, deep learning stacks multiple artificial neural layers between raw input data and final predictions:

  • Input Layer: Receives raw features (e.g., pixel intensities, token embeddings, sensor readings).
  • Hidden Layers: Perform mathematical transformations (weighted sums + non-linear activations) to extract hierarchical features.
  • Output Layer: Generates the target prediction (e.g., classification labels or continuous numerical values).

2. Interactive Visualizer: Single-File HTML5 CodePen Project

To visualize signal propagation across multiple stacked hidden layers, here is a complete, self-contained HTML5 & JavaScript project that you can embed or run directly in CodePen:

3. Understanding Backpropagation

If the forward pass is how a network makes a guess, backpropagation (backward propagation of errors) is how it learns from its mistakes.

The 4-Stage Learning Cycle

  1. Forward Pass: Inputs move forward computing weighted sum z = ∑(w·x) + b and activations a = σ(z).
  2. Loss Calculation: Compare network prediction against target output y via Loss Function L.
  3. Backward Pass (Chain Rule): Calculate derivative ∂L / ∂w from the output layer backwards.
  4. Weight Update: Adjust parameters via learning rate η: wnew = wold - η · (∂L / ∂w).

4. Step-by-Step Mathematical Example

Let's calculate one complete update step for a single neuron using real numbers:

Setup Parameters:

  • Input (x) = 2.0 | Target (y) = 1.0
  • Initial Weight (w) = 0.8 | Bias (b) = 0.1
  • Learning Rate (η) = 0.5

Step 1: Forward Pass & Loss Calculation

z = (0.8 · 2.0) + 0.1 = 1.7
ŷ = σ(1.7) = 1 / (1 + e⁻¹˙⁷) ≈ 0.8455
Loss (L) = ½ (0.8455 - 1.0)² ≈ 0.0119

Step 2: Chain Rule Gradient Derivation

∂L / ∂ŷ = (0.8455 - 1.0) = -0.1545
∂ŷ / ∂z = 0.8455 · (1 - 0.8455) ≈ 0.1306
∂z / ∂w = x = 2.0
∂L / ∂w = (-0.1545) · (0.1306) · (2.0) ≈ -0.0404

Step 3: Weight Adjustment

wnew = 0.8 - (0.5 · -0.0404) = 0.8202

5. Summary of Results

Metric Before Pass After Pass (w = 0.8202)
Weight (w) 0.8000 0.8202
Prediction (ŷ) 0.8455 0.8508 (Closer to target 1.0)
Loss (L) 0.0119 0.0110 (Decreased)

Prompting Generative AI

Module 03 // Communication Interface

Prompting Generative AI

Learn how an instruction requests an output, why small wording changes can reshape a response, and when to use zero-shot, one-shot, few-shot, character and structured reasoning prompts.

10% syllabus weightingK2 understanding level05 prompt types
USER PROMPT

Explain cloud computing.

GENERATED OUTPUT

Cloud computing provides computing services over a network.

Learning Outcome

The Role of Prompts

3.1

A prompt is the instruction given by a user to a generative AI model. It tells the model what output is being requested. A prompt might ask for an explanation, summary, list, recommendation or creative response. The model uses the prompt as immediate context while its transformer also considers patterns learned from training data and the content generated so far.

ROLE 01 // REQUEST

To Request an Output

The prompt starts the interaction. Without a useful instruction, the model does not know the task, subject or expected form of the response.

  • Task: what the model should do.
  • Topic: what the response should discuss.
  • Direction: details such as audience, tone or format.
  • Output: the generated completion returned to the user.
ROLE 02 // GUIDE

Powering the Transformer

The transformer examines the prompt, connects it with learned patterns from training data, and considers each part of the response as it is generated. The prompt therefore guides predictions about what content should come next.

  • The words in the prompt establish context.
  • The transformer uses that context during generation.
  • Each newly generated element becomes additional context.
  • A different instruction can lead to a different output.
01 // INSTRUCTUser enters a prompt.
02 // INTERPRETModel identifies context and task.
03 // GENERATETransformer predicts the continuation.
04 // RETURNUser receives an output.
PROMPT ENGINEERING

Refining Instructions for a Better Output

Prompt engineering is the art of altering and refining prompts to reach a desired or better-quality output. It is often iterative: the user reviews the response, notices what is missing or unsuitable, and rewrites the instruction with clearer direction.

A broad first prompt

“Explain cybersecurity.”

This requests an explanation but gives little direction about audience, length or focus.

A refined prompt

“Explain cybersecurity to a beginner in three short paragraphs and include one everyday example.”

The refined wording gives the model a clearer target.

Why small changes matter: changing a word, adding context or specifying a form changes the context supplied to the transformer. The model may therefore choose a different continuation and produce a noticeably different response. Prompt engineering improves direction, but it does not guarantee that the output is accurate.
Interactive Prompt Refiner
BEFORE
Explain artificial intelligence.
AFTER // ENGINEERED PROMPT

Explain artificial intelligence to a beginner using three short bullet points.

Learning Outcome

Types of Prompts and Their Uses

3.2

Prompt types differ mainly in the guidance supplied to the model. Zero-shot provides no example, one-shot provides one example, and few-shot provides several. Character prompts define a viewpoint, tone or style. Structured reasoning prompts ask the model to work through a complex problem in stages. Select each type to compare its purpose and construction.

Prompt typeExamples suppliedMain useKey distinction
Zero-shotNoneA direct, basic taskThe model receives an instruction but no demonstration.
One-shotOneShow the expected pattern onceOne example guides the desired form.
Few-shotSeveralMake a pattern clearerMultiple examples provide stronger guidance.
CharacterNot defined by examplesSet tone, style or viewpointUses characteristics such as a character, time period or location.
Structured reasoningMay varyHandle a multi-level problemRequests a staged, organised solution.
Core progression: zero-shot → one-shot → few-shot describes an increasing number of examples. In general, examples make the desired pattern clearer, but the prompt must still contain a clear instruction.
Interactive Practice

Prompt Pattern Builder

LAB

Choose a prompt type, enter a task and generate a model prompt. The lab shows how the same request can be framed with different kinds of guidance.



Generated Pattern
Exam-focused Recap

Remember the Distinctions

RECAP
PROMPT

Instruction

A prompt requests an output and gives the transformer immediate context.

ENGINEERING

Refinement

Prompt engineering alters wording and direction to seek a desired or better output.

SHOTS

Number of Examples

Zero means none, one means one, and few means several examples.

CHARACTER

Tone or Style

Characteristics can be based on a character, period or geographical location.

REASONING

Complex Problems

A structured prompt breaks multi-level reasoning into organised stages.

QUALITY

Guidance, Not Guarantee

Clearer prompts can improve relevance, but generated output must still be checked.

Knowledge Check

Test Your Understanding

20 QUESTIONS
SCORE // 0 / 20
Reference Index

Searchable Glossary

KEY TERMS
EXIN BCS Generative Artificial Intelligence Award // Module 03
Unofficial interactive study aid based on the supplied syllabus content.

How Generative AI Works

How Generative AI Works | EXIN BCS Study Guide
Module 02 // Systems Briefing

How Generative AI Works

Follow the journey from large banks of training data to a generated response—and discover how testing, transformers and human feedback improve the system.

04 syllabus outcomes05 process stages01 continuous improvement loop
STAGE 01

Training

Learn patterns from vast data sets.

STAGE 02

Testing

Evaluate with controlled, unseen data.

STAGE 03

Reinforcement

Learn from perceived output quality.

STAGE 04

RLHF

Use human checks and rewards.

STAGE 05

Inferencing

Respond to new data and prompts.

Learning Outcome

Stages of the Generative AI Process

2.1

A useful generative AI system is not created in a single step. It begins by learning from large quantities of data, is evaluated with information it has not previously seen, and is then improved through feedback. Only after the model has been trained and tested is it ready to receive new prompts and generate responses. Select each stage below to explore its purpose and place in the process.

DEVELOPMENT PHASE

Building Capability

Training gives the model its initial capability by exposing it to vast data sets. The model identifies patterns that can later be used to form new responses.

EVALUATION PHASE

Checking Performance

Testing uses controlled, unseen data. Because the examples were not used for training, they provide a more meaningful assessment of how the model handles unfamiliar input.

USE PHASE

Generating a Response

Inferencing occurs when a user supplies new data and a prompt to the trained and tested model. The output may be a prediction, recommendation or another generated response.

STAGEMAIN INPUTWHAT HAPPENSMAIN PURPOSE
TrainingVast data setsThe model learns patterns from information.Develop the model's initial capability.
TestingControlled, unseen dataThe model's responses and performance are assessed.Evaluate accuracy and performance.
Reinforcement learningInformation about output qualityThe model learns which kinds of responses are considered better.Improve future outputs.
RLHFPrompts, human checks and rewardsHuman operators review responses and reward correct ones.Use human judgment to guide improvement.
InferencingNew data and a promptThe trained and tested model generates a response.Put the model into practical use.
Important sequence: the model is first trained, then tested. Reinforcement learning and RLHF help improve its behaviour. Inferencing is different from these development activities because it is the stage in which the prepared model responds to a new prompt.
Learning Outcome

The Use of Data

2.2

Data is the foundation of generative AI. The model depends on training data to learn patterns and on separate test data to evaluate whether that learning can be applied successfully. The two data types have different purposes and should not be confused.

INPUT // LEARNING

Training Data

Training data supplies the enormous banks of information from which the AI model learns. Rather than storing a ready-made response for every possible prompt, the model learns patterns that help it construct a suitable response when prompted.

  • Pre-training data is the first broad batch fed to the model, before refinement or fine-tuning.
  • Later training data is generally more focused or specific and is used to refine the model.
  • The relevance and quality of this information influence what the model learns.
  • Poor-quality training data can lead to poor-quality or unreliable generated output.
INPUT // EVALUATION

Test Data

Test data is a separate bank of controlled information used to assess the model after training. It provides a fairer evaluation because the model has not previously learned from these examples.

  • It must be unseen data that was not used in any training capacity.
  • It is used to evaluate the model's performance and output.
  • It shows how the model handles information beyond its training examples.
  • Its role is assessment, not teaching or fine-tuning.
Interactive Data Bank
PRE-TRAINING
FOCUSED TRAINING
TEST

Quality of Datarelevant, suitable information
Quality of Outputresponses are directly affected

Why must test data remain unseen?

If the same information were used for both training and testing, the evaluation would not clearly show how well the model responds to genuinely new examples. Keeping test data separate allows performance to be assessed using information that did not contribute to the model's learning.

Simple analogy: training data is similar to the material a candidate studies, while test data is similar to new questions used to assess whether the candidate understood the subject. Studying the exact test answers would weaken the value of the assessment.

DATA TYPEWHEN USEDROLEKEY EXAM PHRASE
Pre-training dataAt the beginningProvides the first broad bank of information.Before refinement or fine-tuning
Training dataDuring model developmentTeaches and further focuses the model.Used to train the model
Test dataAfter or apart from trainingAssesses model performance and output.Controlled and unseen
Learning Outcome

The Role of Transformers

2.3

A transformer is a deep learning architecture that processes data in parallel using "attention mechanisms" to understand context and relationships between words.
Transformers are central to the way modern generative AI constructs language. They improve the model's ability to predict what should come next in a response—not only the next word, but also likely phrases, sentences and paragraphs. Repeating this prediction process allows the model to produce connected responses that may run into thousands of words.

Prediction at Every Step

A transformer uses the prompt and the response produced so far as context. It considers possible continuations, identifies a likely next element and then repeats the operation as the response grows.

01Word prediction: identifies a likely next word based on the surrounding context.
02Extended prediction: supports likely phrases, sentences and paragraphs rather than isolated words alone.
03Long responses: repeated predictions provide the capability to generate output extending across many paragraphs.
!Important limitation: a lengthy, fluent and confident response may still contain inaccurate information.
Next-word Predictor
PROMPT: “Generative AI learns patterns from training …”
data
88%
servers
34%
screens
13%
Awaiting prediction
Fluency is not proof of accuracy. Generated responses must still be checked.
STEP 01 // CONTEXT

Read What Is Available

The prediction is influenced by the user's prompt and by the words already generated in the response.

STEP 02 // PREDICTION

Select a Likely Continuation

The transformer helps estimate which word, phrase or sentence is most likely to follow in that context.

STEP 03 // REPEAT

Extend the Response

The newly selected content becomes part of the context, and the prediction process repeats to form a longer response.

Why transformers are required for long responses

A long response is not normally produced as one indivisible block. It is developed through continuing predictions, with each new part building on what came before. This continuing use of context enables responses containing many connected sentences and paragraphs.

However, the transformer is predicting plausible continuations; it is not guaranteeing that every statement is factually correct. Therefore, response length, detail and confident wording should never be treated as automatic evidence of accuracy.

Exam focus: connect transformers with two ideas: they make more accurate predictions about likely continuations, and they provide the capability for long responses. Always retain the qualification that those responses might not be accurate.
Learning Outcome

The Role of Feedback

2.4

Initial training gives a model broad capability, but its responses still need refinement. Human feedback helps demonstrate what a desired response looks like and which model-generated responses are judged correct. The syllabus identifies two related but distinct approaches: supervised fine-tuning and reinforcement learning from human feedback.

METHODWHAT THE HUMAN DOESWHAT THE MODEL RECEIVESMAIN IDEA
SFTCreates the desired response to a prompt.A prompt paired with a high-quality human-created response as training data.Show the model what a desired answer looks like.
RLHFPoses prompts, checks model responses and rewards correct responses.Feedback based on human judgment of response quality.Reinforce responses that humans consider correct.
SFT EXAMPLE

Provide the Target

A human writes a clear desired answer for a prompt. The prompt and answer are then used as a training example for the model.

RLHF EXAMPLE

Evaluate the Output

The model answers a prompt. A human checks that response and provides a reward when the response is considered correct.

CONTINUOUS PROCESS

Fine-tune Repeatedly

Feedback and fine-tuning are ongoing. Repeated adjustment explains why users may observe continuing improvement in generative AI responses.

Ongoing Fine-tuning
PromptResponseHuman FeedbackImproved Behaviour
Key distinction: in SFT, the human creates the desired response that becomes training data. In RLHF, the model first produces a response, and the human then checks and rewards it. Both contribute to fine-tuning, but the form of human feedback is different.
Exam-focused Recap

Remember the Distinctions

RECAP
01 // TRAIN vs TEST

Learning and Evaluation

Training data teaches patterns; unseen test data assesses performance.

02 // SFT vs RLHF

Example and Reward

SFT supplies a human-created desired response; RLHF rewards good responses.

03 // MODEL vs USE

Training and Inferencing

Training develops the model; inferencing uses it with new data.

04 // FLUENCY vs FACT

Length Is Not Accuracy

Transformers enable long responses, but those responses can still be wrong.

Knowledge Check

Test Your Understanding

10 QUESTIONS
SCORE // 0 / 10
Reference Index

Searchable Glossary

KEY TERMS
EXIN BCS GENERATIVE ARTIFICIAL INTELLIGENCE AWARD // MODULE 02