Home › Learn › AI Academy › Lesson 2
🤖 AI Academy • Lesson 2

How AI Works

Understand how artificial intelligence uses data, algorithms, training, models, prompts and human review to produce predictions and generated content.

🤖 AI Academy📘 Position 2 of 40📚 Module 1 of 5🟢 Beginner⏱ Learn at your own pace🔄 Updated October 2026
Difficulty🟢 Complete Beginner
Lesson TypeAI Foundations
Practical OutcomeMap an AI input, model and output
Next StepTypes of Artificial Intelligence

Before You Start

This is Lesson 2 of the MoneyOnliners AI Academy. Lesson 1 explained what artificial intelligence is. This lesson explains the process behind an AI result.

You do not need advanced mathematics. Focus on the main building blocks: data, algorithms, models, training, inputs, outputs and human review.

Keep a notebook or use the linked workbook. Your practical goal is to map one AI-assisted task, distinguish training from inference, and explain how you would test its output. You can complete the exercises with fictional examples and do not need a paid subscription.

Quick Answer

Quick Answer

Many modern AI tools use machine learning: a training process adjusts a model using data, and the trained model then produces outputs for new inputs. That second stage is called inference. A complete system may also include rules, search tools, databases and human review. Not every form of AI learns from examples, and a plausible output is not automatically a correct one.

Learning Objectives

  • Understand the role of data in AI.
  • Learn what algorithms and models do.
  • Understand training and inference.
  • Learn how prompts connect to outputs.
  • Recognize why AI can make mistakes.
  • Prepare for Lesson 3.

How Artificial Intelligence Works

Artificial intelligence works by combining data, mathematical methods, computer processing and human-designed goals. This lesson focuses on the machine-learning approach used by many modern AI tools. Rule-based and other AI methods also exist; the training pipeline below is not a definition of every possible AI system.

First, the system receives data. That data may be text, images, audio, numbers, transactions, sensor readings or user behavior. A learning algorithm uses suitable examples to adjust a model. The resulting parameters represent learned relationships. Developers also choose the architecture, objective and evaluation method.

After training, the model can receive new information and produce an output. The output may be a classification, prediction, recommendation, generated response or detected anomaly.

For example, an image model trained to identify cats studies many labeled examples. It learns visual features associated with cats. When shown a new image, it estimates whether the image contains a cat.

“AI does not begin with intelligence. It begins with data, instructions and a goal.”

— MoneyOnliners AI Academy

The visible answer is only one part of the system. The application around a model may retrieve documents, run software tools, apply rules or ask a person for approval. Judge the whole workflow, not just the fluency of its final message.

Step 1: Data Gives AI Something to Learn From

Data is the foundation of most AI systems. Training data may include articles, photographs, customer questions, financial records, purchases or sensor readings.

Quality matters. If the data is incomplete, inaccurate or biased, the model may learn the wrong patterns. A large dataset is not automatically a good dataset.

Text Data

Articles, books, conversations and documents.

Image Data

Photographs, scans, diagrams and video frames.

Numerical Data

Sales, prices, measurements and financial records.

Audio Data

Speech recordings, music and environmental sounds.

Behavioral Data

Clicks, searches, watch time and purchase history.

Sensor Data

Temperature, movement and machine readings.

Data dashboard used to train and evaluate artificial intelligence systems
AI depends on relevant, accurate and responsibly prepared data.

Step 2: Algorithms Define the Learning Process

An algorithm is a procedure for completing a task. A learning algorithm describes how a model is fitted to data. Other algorithms can clean information, retrieve documents or apply fixed rules without training a model.

A recipe is a useful analogy: data provides the ingredients, the learning algorithm provides a method, and the fitted model is an outcome of that process. The analogy has limits: a model contains learned numerical relationships, not a human understanding of the recipe.

The model architecture sets the structure of the system, while the learning method determines how its parameters are adjusted. Developers select objectives and measurements; a low training error alone does not prove that a tool will work well for real users.

Step 3: Training Builds the Model

Training fits a model to data by adjusting internal parameters. A parameter is a numerical value used by the model. In the supervised-learning example below, known labels provide a target for comparison. Other approaches use different learning signals and do not require a person to label every example.

Imagine training a spam filter. It receives messages labeled “spam” and “not spam.” The model makes a prediction, compares it with the correct label, measures the error and adjusts itself. The process repeats many times.

1

Provide Examples

The system receives training data connected to a clear task.

2

Make a Prediction

The model attempts to produce the correct output.

3

Measure Error

The prediction is compared with the expected result.

4

Adjust the Model

Internal parameters change to reduce future error.

5

Repeat

The process continues across many examples.

Training, Validation and Test Data

A model can perform well on familiar examples and still struggle with new situations. Overfitting happens when it learns details that help on the training data but do not generalize well. Evaluation therefore needs examples that were not used to fit the model.

Training set

Examples used to fit the model parameters. Repeating training examples is not the same as proving the model handles unfamiliar cases.

Validation set

Separate examples used during development to compare choices, tune settings or decide when to stop training.

Test set

Held-back examples used for a final assessment after development choices. Repeatedly tuning to the test set weakens its independence.

These are roles for data, not mandatory percentage splits. The right split depends on the task, dataset size and relationships between examples. A forecasting task may need older data for training and later data for evaluation so future information does not leak into the past.

Watch for data leakage

If nearly identical copies of the same message appear in both training and test data, the score may look better than real-world performance. Information that would not exist when making a real prediction should not be used to create an unrealistic test advantage.

Step 4: The Trained Model Handles New Inputs

After training, the model is used for inference. Inference means applying what the model learned to new information.

When you ask a chatbot a question, upload an image or request a prediction, the trained model processes the input and produces an output.

A model typically uses learned parameters rather than looking up each answer in a complete copy of its training data. Some applications also retrieve information from files or the web and supply it as context. Retrieval, conversation history and changes to the model itself are different mechanisms.

How Generative AI Produces Content

Generative AI produces text, images, audio, video or code using learned patterns. Many language models generate sequences of tokens, which can be words, word pieces or other units. Image-generation systems use different methods; for example, some progressively transform noise into an image conditioned on a prompt. The details depend on the model.

A prompt supplies a task, context, constraints and sometimes examples. Clear instructions can improve task fit, but they do not create missing knowledge or guarantee truthful output. Assigning a role such as “expert editor” does not give a tool professional credentials.

Simple Prompt Formula

Role + Task + Context + Requirements + Format. Example: “Act as a beginner-friendly editor. Rewrite this introduction for clarity, keep it under 150 words and use a professional tone.”

You will study this fully in Lesson 10.

Training vs Inference

AreaTrainingInference
PurposeTeach patterns from examples.Use the trained model on new inputs.
DataUses examples selected for fitting the model.Uses the current input and any supplied context or retrieved information.
ParametersThe learning process updates model parameters.Ordinary inference uses the existing parameters; a chat message does not necessarily retrain them.
ExampleTraining on millions of text samples.Summarizing one article.
Main riskPoor data teaches harmful patterns.The output may still be inaccurate.

Why AI Makes Mistakes

Incomplete Data

The model may not have learned enough about the topic.

Biased Data

The examples may reflect unfair or unbalanced patterns.

Unclear Instructions

A vague prompt can produce a vague result.

Hallucinations

Generative AI may invent facts, quotes or sources.

Outdated Information

The model may not know about recent changes.

Wrong Tool

Some tasks require verified databases or expert judgment.

Evaluate a Model Carefully

Define success before looking at a score. A useful spam filter should catch unwanted messages while avoiding the loss of legitimate mail. Different mistakes have different consequences, so one accuracy number can hide an important weakness.

A fictional 20-message test

Imagine a test with 18 legitimate messages and two spam messages. A system that labels every message “not spam” gets 18 out of 20 correct: 90% accuracy. It still catches none of the spam. The percentage is mathematically correct, but it does not show success at the intended task.

Review questionWhat to inspect
Which mistakes occur?Missed spam and legitimate messages incorrectly blocked.
Who is affected?People whose messages may be lost or whose inbox remains unsafe.
Does the test resemble real use?Languages, message types and conditions the system will encounter.
When should a person intervene?Ambiguous cases, unexpected inputs and outputs with serious consequences.

A useful review combines suitable metrics with examples of failures. Test different input styles and record the conditions. If the tool or real-world environment changes, repeat the relevant checks. A score from one dataset is not a promise about every future situation.

Guided Practice: Map a Fictional Support Task

Use this invented customer message: “My parcel arrived, but the mug inside is broken. Can you help?” Your task is to label the message and draft a brief response without inventing a refund policy.

1

Define input and output

The input is the message plus your category instructions. The output should be one category, a short explanation and a draft response. Suitable categories might be delivery delay, damaged item and general product question.

2

Write the instructions

Ask the tool to choose a category, quote the words supporting its choice and avoid inventing company rules. If no category fits, it should mark the case for human review.

3

Review a possible answer

“Damaged item” fits the message. A promise of an immediate refund is unsupported because no refund policy was provided. Correct the response to acknowledge the issue and say that a person will check the applicable policy.

4

Test an ambiguous case

Try: “The order is wrong.” The system should not confidently invent whether the parcel was late, damaged or a different product. A request for clarification or human review is a useful result.

Keep the original message, instructions, output and corrections in your notes. This exercise uses an already trained tool: it is inference, not evidence that you trained a new model. The short explanation can help you inspect the answer, but it is not a complete account of the model’s internal reasoning.

Your saved result

Write a one-paragraph system map: input → model or application → output → human check. Include one example of an unsupported claim you removed. Use fictional data; do not copy a real customer’s private details into a practice tool.

The Human Role in AI

Humans define the problem, collect data, select methods, write instructions, evaluate performance and decide whether an output is acceptable.

For important work, human review is essential. Medical, legal, financial, educational and employment decisions may carry serious consequences.

Human professional reviewing artificial intelligence model outputs
Human oversight turns AI output into a reviewed and responsible result.

Mini Case Studies

These are hypothetical learning examples, not measured business results.

Product Recommendations

An online store uses a recommendation model to suggest products from suitable browsing and purchase information. Staff check relevance and privacy practices, and avoid interpreting a predicted preference as certainty about a person.

Language Translation

An AI model produces a translation draft. A person who understands both languages checks meaning, names, numbers and important terms. Fluent wording alone does not establish that the original meaning has been preserved.

Content Drafting

A blogger supplies a brief and receives an outline. The blogger checks the structure, verifies factual claims and adds original examples. A polished draft is an intermediate output, not a substitute for editorial review.

Further Learning and Sources

Continue Learning on MoneyOnliners

Official External Resources

Your Weekly Challenge

Map an AI System

1. Choose one AI tool you use.

2. Identify its input, process and output.

3. Write one reason the output may be wrong.

4. Decide how a human should review it.

5. Add one normal input, one ambiguous input and one case that should be escalated. Record the actual output if you use a tool; otherwise label your predicted output as hypothetical.

Save: your system map, test examples and review checklist. Keep these in your own notes or workbook; this page does not save answers automatically.

Knowledge Check

Answer in your notes before opening the suggested answers. This self-check does not record progress or certify a skill.

  1. You ask an existing chatbot to categorize a fictional message. Is that training or inference?
  2. Why should test examples be kept separate from the examples used to fit a model?
  3. Does a 90% accuracy score prove that a spam filter catches spam?
  4. A draft promises a refund without an approved policy. What should you do?
Show suggested answers

1. Inference: you are using an existing model. 2. Separate examples help assess performance on unfamiliar inputs and reduce misleading results from memorization or leakage. 3. No. Inspect the kinds of errors and how the test is composed. 4. Remove the unsupported promise and check the actual policy or send the case for human review.

Reflection Questions

  1. Why is data important to AI?
  2. What is the difference between an algorithm and a model?
  3. What happens during training?
  4. What is inference?
  5. Why must AI output be reviewed?

Download the Lesson 2 Workbook

The workbook includes guided questions on data, algorithms and models, everyday AI examples, prompt practice, reflection and an action step before Lesson 3. Use your own notes for this page’s additional test-data, evaluation and system-mapping exercises.

If you try the workbook activity asking an AI assistant how it generates answers, treat its explanation as a starting point. A chatbot’s self-description is not proof of its internal implementation; compare important claims with reliable technical documentation.

📘 Download Lesson 2 Workbook

Frequently Asked Questions About How AI Works

Review the main ideas before continuing to Lesson 3.

Does AI learn by itself?

AI adjusts during training, but humans design the system and define the goal.

What is an AI model?

A model is the learned mathematical structure created during training.

What is inference?

Inference is using a trained model on new information.

Why does AI need data?

Data provides examples from which the system can learn patterns.

Why can AI hallucinate?

Generative AI predicts plausible outputs and may produce false information.

What should I learn next?

Continue to Lesson 3, Types of Artificial Intelligence.

↑