IB COMPUTER SCIENCE | 2027 CASE STUDY | SL & HL

01.3 Training and generation: how a model learns and creates

Explain how training changes learned parameters and how generation uses a trained model, with clear links to Visionary Studios’ choices and computing needs.

Understand the technology

Follow the learning, then follow the request.

For May and November 2027. This introductory lesson is shared SL and HL content.

01 | TWO STAGES, TWO DIFFERENT JOBS

A designer enters a description and receives an image. The model appears to respond immediately, but its ability to do that depends on learning that happened earlier. Separating those stages makes generative AI much easier to understand.

Training adjusts a model using examples. Generation uses a trained model to produce an output. Inference is the broader term for using a trained model; image generation is one kind of inference.

For Visionary Studios, this distinction matters because developing or adapting a model is a different undertaking from using an existing trained system. The booklet asks the company to consider the resources needed for training and deployment; it does not say the company must train a model from scratch.

02 | START WITH TRAINING EXAMPLES

A training dataset contains the examples used for learning. Depending on the approach, it may include images, captions, category labels or other information. These examples provide material from which a model can learn visual patterns and relationships.

For a text-guided system, paired images and descriptions can help connect language with visual features. However, not every generative model uses captions, and different parts of a complete system may be trained using different data and objectives.

A dataset should be selected deliberately. Repeated, inaccurate, unrepresentative or unsuitable examples can affect what is learned. Dataset size alone does not tell Visionary Studios whether a system will meet its creative requirements.

03 | WHAT CHANGES WHEN A MODEL LEARNS?

A neural network performs numerical calculations. Within those calculations are adjustable numbers called parameters , often including weights and biases. Together, their values influence the output.

Training changes those numbers. It does not normally create a hand-written rule for every possible object, and it is not simply storing a finished answer to every prompt.

As a deliberately simplified analogy, imagine adjusting several dials that influence a drawing machine. One adjustment affects many future results. Real models have far more parameters and more complex relationships; there is usually no single dial labelled “draw a mountain”.

04 | A LEARNING OBJECTIVE DEFINES THE TASK

A learning objective specifies what training is trying to improve. The model performs a task on training examples, and the training process measures how well it performs.

The precise task depends on the model. In a diffusion approach, a common training task is to predict noise added to an image. Other formulations predict related quantities. This lesson uses noise prediction as a teaching example; later diffusion lessons explain it in more detail.

Do not assume that training always asks a person to judge whether a complete generated image looks attractive. A useful learning task can be much more specific than the final creative task the user sees.

05 | MEASURING ERROR WITH A LOSS

A loss function produces a numerical measure of error for the learning task. If the task is predicting added noise, the prediction can be compared with the noise that the training process actually added.

A lower loss on that task generally indicates a closer fit to the chosen objective. It does not automatically mean that every image will follow a client brief or that bias, copyright concerns and character consistency have been solved.

The distinction is important for Visionary Studios: training measurements are useful evidence about learning, but finished outputs still need evaluation against the studio’s requirements.

06 | ADJUST, TRY AGAIN, REPEAT

An optimizer uses information about the loss to update parameters. A common approach uses gradients, which describe how changes to parameters affect the loss locally. The update is intended to improve performance on the learning task.

Training repeats this process across many examples: produce a prediction, calculate the loss and update the parameters. A single update does not make a model complete, and loss does not necessarily decrease on every individual step.

1. Use examples

Prepare a training task from the data.

2. Predict and measure

Run the model and calculate its loss.

3. Update parameters

Use the optimizer, then repeat.

The diagram simplifies a numerical process. It is not a claim that a human supplies corrections for every image.

07 | A TINY NUMERICAL ANALOGY

Imagine a toy model that predicts a target by multiplying an input by a weight. For input 2 and target 6, a weight of 1 produces prediction 2. The squared error is (6 − 2)² = 16.

If an update changes the weight to 2, the prediction becomes 4 and the squared error becomes (6 − 4)² = 4. The prediction is closer. With weight 3, it would be 6 and the error would be 0 for this example.

This arithmetic illustrates a parameter, prediction and loss. It is not an image generator or a full training algorithm. We have chosen the updates for explanation; real optimization must calculate updates and consider many examples.

Important: zero error on one example does not prove that a model will work on new examples.

08 | BATCHES, STEPS AND EPOCHS

A batch is a group of examples processed together during training. A training step commonly calculates a loss from a batch and applies an optimizer update. An epoch is one pass through a defined training dataset.

For example, a dataset with 1,000 examples divided into batches of 100 has 10 batches in one pass. In a simple setup with one update per batch, that is 10 training steps per epoch.

These are supporting terms for understanding the process, not additional official case study terminology. Larger systems may organise data and updates differently, so avoid assuming every training run follows this exact arrangement.

09 | CHECK LEARNING ON DIFFERENT DATA

A model should do more than fit the examples used to adjust it. Generalisation means performing usefully on new examples or situations relevant to the intended task.

A validation set contains separate examples used to assess development choices. A held-out test set can support a later assessment after those choices are made. If developers repeatedly use test results to choose a model, that test set is no longer an independent final check.

Overfitting occurs when learning fits training examples too specifically and performance does not transfer well. Separating datasets helps reveal this, although duplicates and closely related images across sets can make results misleading.

10 | SAVE THE LEARNED MODEL

Training can save a checkpoint : a record containing learned parameter values and, depending on its purpose, additional state such as optimizer information. A saved model can then be loaded for use.

The parameters encode learned relationships numerically. They are not a browsable photo album, although models can memorise particular training material and sometimes reproduce it closely.

A complete usable system also needs its architecture, processing steps and compatible software. A checkpoint alone does not necessarily contain everything required to run the application.

11 | THE DESIGNER NOW MAKES A REQUEST

During generation, a designer supplies the inputs supported by the application. A text-guided image system processes a prompt into numerical representations that can guide the model. The exact components depend on the architecture.

The system may also accept a sketch, a reference image or settings. The model uses its learned parameters with these request inputs to compute a result.

Changing a prompt usually changes the guidance for this computation. It does not, by itself, update the model’s learned weights. A separate fine-tuning or adaptation process is different.

12 | A DIFFUSION GENERATION PREVIEW

In a diffusion system, generation commonly begins with random noise and uses repeated model-guided steps to produce an image. Depending on the system, those steps may operate directly on image values or in a compressed representation called a latent space.

The trained model supplies information used to remove noise progressively. Text guidance can influence the process so the result is associated with the requested content. The noise is not simply covering a hidden original photograph that the system uncovers.

These generation steps are different from optimizer updates. A model can perform many denoising steps while keeping its learned parameters fixed.

13 | WHY RANDOMNESS AND SETTINGS MATTER

Different random starting values can produce different images from the same prompt. A seed initialises the pseudorandom process. Recording it can help investigate a result when the model, software and other relevant settings are also recorded.

Generation settings can change the output or resource use. For example, changing the number of denoising steps changes the computation performed. More steps do not guarantee a better image in every system or beyond every point.

Visionary Studios should record conditions when comparing outputs. Otherwise, a difference attributed to the model might actually result from different prompts, settings or software versions.

14 | TRAINING FROM SCRATCH, FINE-TUNING AND USE

Training from scratch begins the learning process without using an existing trained checkpoint as its starting point. It can require extensive data and computation.

Fine-tuning continues learning from a pretrained model using additional data and a training objective. It may update all parameters or only a selected subset, depending on the method. This is different from rewriting a prompt.

Using a pretrained model means running an already trained model to produce outputs. Visionary Studios could investigate these options without assuming it must develop every component itself. The booklet does not specify which deployment or training arrangement it has selected.

15 | COMPUTING NEEDS IN BOTH STAGES

Training repeatedly performs model computations and parameter updates, and needs to manage training data and additional learning state. Generation also needs processing and memory, especially for large images, many requests or iterative denoising.

It is misleading to say that training is expensive but generation is free or instantaneous. Their relative costs depend on the model, hardware, settings and amount of use. A company may use an external service rather than own the training hardware, but still faces cost, capacity and service constraints.

For the studio, useful measurements include time to acceptable outputs, resource requirements and performance under realistic demand. Exact hardware and budget figures are not supplied in the case study.

16 | WHAT DOES A MODEL LEARN FROM A USER?

Ordinary generation usually leaves the deployed model’s parameters unchanged. Therefore, a model making a mistake and receiving a revised prompt does not necessarily learn a lasting correction.

Applications may retain prompts, accept feedback or later use collected data in a separate training process. Those are service and development decisions that need investigation; they should not be confused with the immediate generation calculation.

Visionary Studios should check how a proposed service handles confidential client material. Do not assume either that every request is used for training or that no request is stored.

17 | APPLY THE DISTINCTION TO THE STUDIO

Suppose our fictional explorer’s clothing changes across campaign images. The team could first investigate clearer guidance, reference inputs and generation settings. That changes how the existing model is used.

If the team instead adapts a model using a curated set of permitted character images and optimizer updates, that is a training activity. It introduces further data, evaluation and computing requirements.

Explain: Fine-tuning may help adapt an existing model to a specialised visual task because additional examples can change its learned parameters. However, it requires suitable data and evaluation, therefore Visionary Studios should compare its benefits and costs with using the pretrained system.

18 | TRACE A REQUEST FROM LEARNING TO OUTPUT

In your book, draw two clearly separated processes. In the training process, include examples, a prediction, loss, an optimizer update and saved parameters. In the generation process, include the loaded model, guidance, any random starting input and the output.

Circle the stage that changes learned parameters. Then explain why generating a second image is not automatically a second training run.

Reveal a possible explanation

Training uses examples and a learning objective to calculate updates to model parameters. Generation loads the trained model and uses request inputs to produce an output, usually without updating those parameters. Repeating generation can change the prompt or random starting input while using the same learned weights.

In diffusion, many denoising steps can take place within one generation request. Those repeated computations should not be confused with training updates.

Use the official 2027 booklet alongside these independent teaching notes. Numerical examples and the explorer campaign are classroom illustrations, not supplied company measurements.

CHECK YOUR UNDERSTANDING | TRAINING OR GENERATION?

Identify the stage described. Focus on whether the activity belongs to learning with parameter updates or using the trained system.