Explore how AI systems work, learn the foundations of machine learning, practise writing better prompts and plan an AI-powered experience with privacy and human review built in.
✓ Clear beginner explanations✓ Practical examples and activities✓ Progress saved in this browser
MODULE 01LESSON 01 / 16
Understand Artificial Intelligence
What AI is and what it is not
Artificial intelligence (AI) is a broad field focused on building computer systems that perform tasks that usually require aspects of human intelligence. These tasks can include recognising patterns, understanding language, making predictions and helping people make decisions.
AI is a field, not one product
A spam filter, a voice assistant, a recommendation engine and an image classifier can all use AI, but they solve different problems. Some systems follow hand-written rules; others learn patterns from examples. The label AI does not tell you exactly how a system works.
Match the tool to the problem
AI can be useful when a task involves patterns in large or complex data. It is not automatically the best choice. A simple calculator, database query or clear set of rules may be cheaper, faster and easier to explain.
LEARN BY EXAMPLE
Try understanding this snippet
problem = "Sort incoming support messages"
if problem == "Sort incoming support messages":
print("Possible approach: classify messages by topic")
print("Keep a human review path for uncertain cases")
PRACTICE TASK
Now you try
Write down one repetitive task you encounter. Explain whether it needs AI, ordinary automation, or a combination—and why.
Understand Artificial Intelligence
AI, machine learning and deep learning
The terms AI, machine learning and deep learning are related, but they do not mean the same thing. Understanding the relationship helps you describe systems accurately.
A nested relationship
AI is the broadest idea. Machine learning (ML) is a way to build AI systems by learning patterns from data rather than specifying every rule. Deep learning is a family of ML methods that uses multi-layer neural networks.
Different approaches suit different tasks
A rule-based system may be appropriate when requirements are fixed and explicit. Traditional ML can work well with structured data such as tables. Deep learning is widely used for complex data such as images, audio and language, often requiring substantial data and computing resources.
LEARN BY EXAMPLE
Try understanding this snippet
approaches = {
"rule_based": "Human-written conditions",
"machine_learning": "Patterns learned from examples",
"deep_learning": "Machine learning with multi-layer neural networks",
}
for name, description in approaches.items():
print(name, ":", description)
PRACTICE TASK
Now you try
Create a simple diagram or written hierarchy showing AI, machine learning and deep learning. Add one example of a system for each approach.
Understand Artificial Intelligence
Data, models and predictions
Many AI systems learn from examples. Data is used to train a model, and the trained model can then produce a prediction or output for new inputs.
From examples to a model
A dataset contains examples. During training, a learning algorithm adjusts a model so its outputs better match the examples or learning objective. The resulting model is not a database of guaranteed facts; it represents patterns learned from the training process.
Inference and uncertainty
When a trained model receives new input, it performs inference. Its output may be a category, score, generated text or another result. Predictions can be wrong, especially when inputs differ from the data or conditions seen during training.
LEARN BY EXAMPLE
Try understanding this snippet
training_examples = [
{"message": "Where is my order?", "label": "delivery"},
{"message": "I need a refund", "label": "billing"},
]
new_message = "My parcel has not arrived"
print("A trained classifier could predict a topic for:", new_message)
PRACTICE TASK
Now you try
Describe a small prediction problem. Identify the input data, the pattern a model might learn and the output it would produce.
Understand Artificial Intelligence
Everyday AI use cases and limitations
AI already supports many everyday services. Knowing where it is used is useful, but knowing its limitations is essential before relying on its output.
Common applications
Examples include recommendations, fraud detection, speech recognition, translation, image search, forecasting and assistance with drafting or summarising. Each application has a specific goal and should be evaluated against that goal.
Limitations to recognise
AI systems can make mistakes, reflect biases in their data, behave unpredictably on unfamiliar inputs and provide explanations that sound more certain than the evidence supports. Important decisions need suitable checks, accountability and human oversight.
LEARN BY EXAMPLE
Try understanding this snippet
ai_output = "The system recommends approving this request."
confidence = 0.62
if confidence < 0.80:
print("Send for human review")
else:
print("Continue with the approved review process")
PRACTICE TASK
Now you try
Choose an AI feature you use. List what it does well, one way it could fail and a check that would help catch that failure.
Machine Learning Foundations
Features, labels and datasets
A machine learning dataset is often organised into examples. Features describe each example, while a label is the target a supervised model is trained to predict.
Identify the parts
For a house-price dataset, features might include floor area, location and number of bedrooms. The label could be the sale price. For an email classifier, the message text is input and the category may be the label.
Data quality matters
Incorrect labels, missing values, duplicates and unrepresentative examples can undermine a model. Data preparation should include understanding where information came from, what it represents and whether its use is appropriate.
Design a tiny dataset for predicting whether a learner may need help with a topic. List three possible features and one label. Avoid using sensitive personal information.
Machine Learning Foundations
Supervised and unsupervised learning
Machine learning methods are often grouped by the kind of feedback available during learning. Two foundational categories are supervised and unsupervised learning.
Supervised learning
Supervised learning uses examples paired with target labels. Classification predicts a category, such as a message topic. Regression predicts a numeric value, such as estimated delivery time.
Unsupervised learning
Unsupervised learning looks for structure in data without supplied target labels. Clustering can group similar items, while dimensionality reduction can represent complex data with fewer variables. The groups still need interpretation.
LEARN BY EXAMPLE
Try understanding this snippet
tasks = {
"supervised": ["predict spam or not spam", "estimate a home price"],
"unsupervised": ["group similar news articles", "explore customer behaviour patterns"],
}
for learning_type, examples in tasks.items():
print(learning_type, ":", ", ".join(examples))
PRACTICE TASK
Now you try
Classify four ideas as supervised or unsupervised: predicting exam scores, grouping similar photos, detecting spam from labelled emails, and exploring customer segments.
Machine Learning Foundations
Training, validation and testing
A model should be evaluated on examples that were not used to fit it. Splitting data helps estimate how well it may perform on new cases.
Three useful datasets
The training set is used to fit the model. A validation set helps compare approaches and tune settings. A test set is held back for a final, less-biased evaluation after choices are made.
Avoid data leakage
Data leakage happens when information unavailable at prediction time—or information from the test set—finds its way into training or model selection. It can make evaluation look much better than real-world performance.
LEARN BY EXAMPLE
Try understanding this snippet
from sklearn.model_selection import train_test_split
# First hold out a final test set
X_train, X_test, y_train, y_test = train_test_split(
features, labels, test_size=0.2, random_state=42
)
# Fit and tune using training/validation data.
# Use the test set only for final evaluation.
PRACTICE TASK
Now you try
Draw a dataset split showing training, validation and test data. Explain why the test set should not guide repeated model tuning.
Machine Learning Foundations
Accuracy, bias and overfitting
A model’s score is only one part of its quality. Evaluation should consider the task, the cost of different mistakes and whether performance is fair across relevant groups.
Read metrics in context
Accuracy is the share of predictions that are correct. Precision asks how many predicted positives were truly positive; recall asks how many actual positives were found. For imbalanced datasets, accuracy alone can hide poor performance.
Recognise overfitting and bias
Overfitting occurs when a model learns details of training examples that do not generalise. Bias can enter through data collection, labels, features or deployment. Check performance on appropriate data and investigate differences that could cause harm.
LEARN BY EXAMPLE
Try understanding this snippet
correct_predictions = 86
total_predictions = 100
accuracy = correct_predictions / total_predictions
print(f"Accuracy: {accuracy:.0%}")
# Always inspect more than one metric when the task needs it.
PRACTICE TASK
Now you try
Imagine a medical alert model where missing a true case is especially costly. Explain why accuracy alone may be insufficient and which error you would investigate closely.
Generative AI and Prompt Design
How large language models generate text
Large language models (LLMs) are trained on large collections of text and other data. They learn statistical patterns that help them generate a sequence of tokens in response to context.
Tokens and next-token prediction
Text is processed as tokens, which may be whole words, parts of words or punctuation. During generation, a model repeatedly estimates likely next tokens based on the preceding context and its learned parameters.
Fluent does not mean verified
An LLM can produce clear, natural-sounding language without checking whether every claim is true. It may invent details, misunderstand the task or rely on outdated information. Treat generated answers as drafts or suggestions until verified.
LEARN BY EXAMPLE
Try understanding this snippet
prompt = "Explain photosynthesis to a beginner in three steps."
# Conceptual flow:
# prompt + conversation context -> language model
# language model -> generated sequence of tokens
print("Review generated content before relying on it.")
PRACTICE TASK
Now you try
Explain in your own words why a language model can produce a convincing answer that is still incorrect.
Generative AI and Prompt Design
Tokens, context and model limitations
A model can only use the information available to it through its training and the current context provided to the system. Context limits and missing evidence affect the answer.
Context window
The context window is the amount of tokenised information a model can consider in one interaction. Very long documents or conversations may need to be shortened, split or summarised carefully.
Knowledge and tools
A model’s built-in knowledge may not include recent events or private information. Some applications connect models to search, databases or other tools. Tool results should still be checked for relevance, source quality and freshness.
LEARN BY EXAMPLE
Try understanding this snippet
source_notes = [
"Use the supplied course notes as the source.",
"If the notes do not answer a question, say so.",
"Do not invent missing details.",
]
print("\n".join(source_notes))
PRACTICE TASK
Now you try
Take a broad question and rewrite it so the model has a clear scope, a defined source and an instruction to say when information is missing.
Generative AI and Prompt Design
Write clear prompts with constraints
A useful prompt gives the model enough context to understand the task and enough constraints to produce an answer that can be reviewed.
A practical prompt structure
State the goal, provide relevant context, describe the expected audience, specify the output format and add constraints. Include an example when the required style or structure is difficult to describe.
Iterate deliberately
If the first result misses the mark, identify the specific gap and revise the prompt. Change one or two elements at a time so you can understand what improved the response.
LEARN BY EXAMPLE
Try understanding this snippet
prompt = """
Task: Explain what an API is.
Audience: A beginner learning web development.
Format: 4 numbered steps and one simple analogy.
Constraints: Use plain language. Keep it under 180 words.
If a detail is uncertain, state that clearly.
"""
print(prompt)
PRACTICE TASK
Now you try
Write a prompt for a beginner study helper. Include its role, learner context, output format and at least two constraints.
Generative AI and Prompt Design
Evaluate outputs and reduce hallucinations
Generated content should be evaluated against evidence and the intended use. A confident tone is not a quality metric.
Use a verification workflow
Break an answer into factual claims. Check important claims against reliable primary sources, confirm dates and figures, and test code before using it. For summaries, compare the output with the original source to make sure key qualifications were not lost.
Design for uncertainty
Ask for sources when appropriate, provide source material, require the system to distinguish facts from assumptions and allow it to say that evidence is insufficient. These steps reduce risk but do not eliminate errors.
LEARN BY EXAMPLE
Try understanding this snippet
claims = [
{"claim": "A library supports a feature", "verified": False},
{"claim": "The release date is 2025", "verified": True},
]
for item in claims:
status = "verified" if item["verified"] else "needs checking"
print(item["claim"], "->", status)
PRACTICE TASK
Now you try
Create a three-step checklist for checking an AI-generated answer before sharing it with classmates or using it in a project.
Build Responsible AI Experiences
Use an AI API conceptually
An AI application often sends an input to a model through an application programming interface (API) and receives a response. The surrounding application is responsible for safe handling and useful presentation.
The request-response flow
A client gathers an input, a server checks permissions and prepares a request, and an AI service returns an output. The application may then validate, format or route that output before showing it to a user.
Protect credentials
API keys are secrets. Keep them on a trusted server or in a secure secret manager, not in browser code or a public repository. Apply access controls, usage limits and monitoring, and avoid sending information the model does not need.
LEARN BY EXAMPLE
Try understanding this snippet
import os
api_key = os.environ.get("AI_API_KEY")
if not api_key:
raise RuntimeError("Configure AI_API_KEY securely")
# Send requests from a protected server-side environment.
# Never expose the secret in public client-side code.
PRACTICE TASK
Now you try
Draw a simple browser → application server → AI service flow. Mark where the API key belongs and where user input should be checked.
Build Responsible AI Experiences
Design inputs, outputs and user feedback
A useful AI feature is a complete user experience, not just a model call. It should make clear what users can provide, what the system returns and what happens when the result is uncertain or unavailable.
Define boundaries
Specify the intended use, acceptable inputs, output format and situations where the system should decline or ask for clarification. Keep the feature focused on a problem it can reasonably help with.
Make the experience understandable
Show loading and error states, explain that content is AI-generated when relevant, and give users a way to correct or report poor results. Do not imply that generated suggestions are guaranteed facts.
LEARN BY EXAMPLE
Try understanding this snippet
response = {
"status": "needs_review",
"suggestion": "Group these notes by topic",
"notice": "AI-generated suggestion; check before applying",
}
print(response["status"])
print(response["notice"])
PRACTICE TASK
Now you try
Sketch the main states for an AI study helper: empty input, loading, successful suggestion, uncertain answer and service error.
Build Responsible AI Experiences
Protect private and sensitive data
AI features can process personal information, confidential documents or account data. Collect and share only what is necessary, and explain how information is handled.
Minimise data
Avoid collecting information that is not needed for the feature. Remove or mask identifiers where possible, set sensible retention rules and restrict access to stored prompts and outputs.
Check providers and permissions
Understand the service’s data handling terms, access controls and retention options before sending user content. Do not paste passwords, private keys, confidential records or sensitive personal details into tools without explicit authorisation and an appropriate approved process.
LEARN BY EXAMPLE
Try understanding this snippet
def prepare_for_ai(text, contains_private_data):
if contains_private_data:
raise ValueError("Remove or protect private data first")
return text
safe_input = prepare_for_ai("Explain this public concept", False)
print(safe_input)
PRACTICE TASK
Now you try
List the minimum information an AI study assistant needs. Identify two kinds of data it should avoid collecting and one way to protect stored information.
Build Responsible AI Experiences
Human review, transparency and evaluation
Responsible AI design includes people, processes and ongoing evaluation. Human review is especially important when an output could affect someone’s rights, safety, finances or opportunities.
Keep people accountable
Define who reviews important outputs, who can override a recommendation and how users can appeal or report problems. A human reviewer needs enough information and authority to make a meaningful decision—not just approve every suggestion.
Monitor after launch
Evaluate quality with representative test cases, monitor errors and user feedback, document limitations and revisit the system when data or use changes. A one-time test cannot establish that a system will remain safe and useful.
LEARN BY EXAMPLE
Try understanding this snippet
review = {
"ai_suggestion": "Recommend a study topic",
"evidence_checked": False,
"human_approved": False,
}
if not review["evidence_checked"]:
print("Check the evidence before presenting this as advice")
PRACTICE TASK
Now you try
Write a short responsible-use plan for your capstone. Include what the assistant may do, what it must not do, how outputs are checked and how users can report a problem.
MODULE 01 CHECK
Check your understanding
Which statement best describes deep learning?
MODULE 02 CHECK
Check your understanding
What is the main purpose of a held-out test set?
MODULE 03 CHECK
Check your understanding
Which prompt is most likely to produce a useful, reviewable result?
MODULE 04 CHECK
Check your understanding
Where should a private AI API key normally be stored?
YOUR CAPSTONE PROJECT
Design a responsible AI study assistant.
Plan an assistant that helps learners organise notes and create revision questions. Define the user journey, the information it needs, the prompts it uses, how answers are checked and when a human should review the result.