Explorer
AI Foundation

How LLMs Learn: From an Untrained Model to an AI Assistant

Until now, we have only seen a model after it has already been trained. In the previous chapter, we followed text through a transformer and watched it predict the next token—but we left out how it learned to make useful predictions in the first place.

Let’s go back to the beginning and follow its journey through pre-training and post-training.

This time, we’ll start with an untrained model.

Finish this sentence in your head:

The sky is ______.

Maybe you thought of blue. Perhaps grey, clear, or dark.

But imagine our model chooses:

The sky is banana.

Why “banana”? We haven’t trained the model yet. We have built the machinery that produces predictions, but we haven’t adjusted it to capture useful language patterns.

In the previous chapter, somebody had already done that work.

Today, that somebody is you.

The program can run correctly before its language predictions become useful.

Now, let's explore the Pre-Training stage. You will discover how a model goes from poor predictions to learning useful language patterns—without writing a separate manual rule for every sentence.


1. You Can't Fix Every Sentence by Hand

The quickest fix seems obvious:

Whenever the input is "The sky is", return "blue".

That handles one example. Until someone types:

“At sunset, the sky is …”

Now orange might fit better. At night, perhaps dark.

Even our very first sentence has no single ending that is always correct. Its continuation depends on the context.

Writing manual if/else rules soon becomes an impossible, endless trap. We need a model that can learn patterns from examples, so it can handle new sentences even when the wording changes.

So let's look inside the model we built.

Among its calculations are millions or billions of adjustable numbers, such as:

0.42, -0.17, 0.83, 0.06

These adjustable numbers are called parameters. People often call them weights informally, although weights are one kind of parameter; biases and other learned values are parameters too.

Think of parameters like volume dials on a giant sound mixing board:

  • Poor dial settings can make the output unhelpful.

  • Better settings can improve the output.

This is only an analogy: a sound board adjusts an existing audio signal, while a neural network transforms numerical representations through many calculations.

In our transformer, these dials appear in learned parts of the network: embedding tables that map token IDs to vectors, attention projections that help combine information from accessible token positions, and feed-forward layers that transform those representations. Some operations, such as a causal mask or softmax, have no trainable parameters of their own.

A single prediction comes from many numbers working together, and the exact same numbers help process thousands of different sentences.

That gives us something we can change. But it also gives us a puzzle:

How do we know which numbers need to change, and which way to turn them?

First, we need an example to learn from.


2. Hide One Token: The Text Becomes a Lesson

Take this sentence from our training text:

"The sky is blue."

Show the model the beginning:

The sky is

Keep the next token unavailable to this prediction as the target:

blue

The target is simply what actually comes next in this specific training example. We haven't declared that every sky in the universe must be blue; we are just using this sentence as our lesson.

(For readability, we'll treat each displayed word and the final period as separate tokens. Real tokenizers divide text into units that may be whole words, word pieces, characters, bytes, or punctuation, then map those units to IDs. The displayed split is illustrative, not an exact GPT-2 tokenization.)

Now notice something brilliant: the sentence already contains its own answer key.

We can turn this single sentence into several practice questions:

Context Available to the Model

Next Token to Predict (Target)

"The"

sky

"The sky"

is

"The sky is"

blue

"The sky is blue"

.

Nobody needs to sit at a desk and manually label every next-token practice question. The training targets come directly from the text itself.

This approach is called Self-Supervised Learning.

It still takes human engineers to collect clean data, build the model, and manage the training run. The word "self-supervised" describes where the targets come from: the data itself. In this causal next-token task, a causal mask prevents each position from attending to future tokens. Training can calculate predictions for many positions in parallel without letting a position peek at its target.

We now have our test question and our hidden target. Let's see how badly our untrained model does.


3. The Mistake Is Bigger than the Word "Banana"

We feed the words "The sky is" into the model.

As we saw in earlier chapters, the text passes through the model architecture. For the GPT-2-style model we have been following:

  • Text is tokenized into IDs. A token embedding lookup gives each ID a vector; a learned position vector is added to it.

  • Those vectors pass through repeated Transformer Blocks. Each GPT-2 block has LayerNorm → Causal Self-Attention → Residual Add, followed by LayerNorm → Feed-Forward Network → Residual Add. The feed-forward network is inside each block.

  • A final LayerNorm comes after the last block, followed by a vocabulary projection that produces logits.

Other transformer architectures can use different position encodings or normalization arrangements. This particular flow describes GPT-2.

The input flows through the network from start to finish. This forward computation is called the forward pass.

At the end of the forward pass, the model scores possible next tokens. We can turn those scores into probabilities in two stages; selecting a token is a separate decoding step:

  1. Raw Scores (Logits): The vocabulary projection gives each token a raw numerical score called a logit. A higher logit produces a higher probability than a lower logit within the same distribution.

  2. Percentages (Softmax): A standard mathematical function called softmax converts logits into nonnegative probabilities that sum to 1, or 100% when expressed as percentages. Rounded displayed percentages may differ slightly from 100%. This normalization makes the scores usable as a probability distribution.

For our tiny imaginary vocabulary, suppose the model produces these percentages:

Possible Next Token

Model's Predicted Probability

banana

40%

green

30%

music

20%

blue (Target)

10%

(These are illustrative numbers for a four-token toy vocabulary. Real vocabulary sizes vary by model; GPT-2 uses 50,257 tokens, and some models use much larger vocabularies.)

If we ask the model for its top choice, it picks banana.

"The sky is banana."

It failed. But training does not just stamp a red "X" on the word banana and move on.

Instead, training looks directly at the percentage the model gave to the correct target token.

Here, the true target is blue, and our untrained model gave it a disappointing 10%.

Suppose another version of the model also predicted banana, but gave blue 30%. It still got the top answer wrong, but it assigned three times as much probability to the observed target. That lowers the loss for this example; it does not mean “three times closer to the truth.”

We need a score that can measure that gradual progress before the top answer changes.

That score is called the Loss.

For next-token prediction, we use a standard scoring method called Cross-Entropy Loss. It measures how poorly the model predicted the correct target token:

  • Giving the target a low probability produces a high loss (a big penalty).

  • Giving the target a high probability produces a low loss (a tiny penalty).

Probability Assigned to "blue"

Approximate Loss (Penalty Score)

What It Means

10% (Our illustrative untrained model)

2.30

High penalty — far from the target.

30%

1.20

Moderate penalty — moving in the right direction.

90% (Illustrative improved prediction)

0.11

Low penalty for this observed target.

(The mathematical formula is simply Loss = -ln(probability of target). You don't need to memorize the logarithm to follow the story — just remember that lower loss means better predictive fit to the evaluated targets, not necessarily greater factual accuracy.)

The loss gives us a numerical score: approximately 2.30.

A lower loss is the goal of training. But a score only tells us how badly we are doing. It doesn't tell us what to change.


4. A Bad Score Doesn't Come with Repair Instructions

Imagine an inspector hands you a penalty score of 2.30 and tells you: "Fix the machine."

Which parameter should you increase? Which should you decrease? And by how much?

With millions or billions of numbers inside the network, making random guesses would be completely hopeless. We need a way to know how nudging each individual number would affect the final loss score.

That direction is what Gradients give us.

For any specific parameter, its gradient answers one practical question:

"If we nudge this specific number slightly up or down, which way will the error move, and how strongly?"

To calculate these gradients, the computer uses a process called Backpropagation.

Backpropagation starts at the final loss score and works backward through all the mathematical layers that produced that error. It uses the calculus chain rule to calculate how small changes in earlier quantities would affect the loss.

It doesn't search the network for a "banana mistake". It calculates loss sensitivities for trainable parameters that influence this computation; some gradients can be zero.

And here is the crucial point:

Backpropagation calculates gradients; it does not update the model's parameters.

It is only an audit. It calculates the directions for adjustment. Now, we actually need to take a step.


5. This Is the Moment Something Actually Changes

Now enters the Optimizer: the tool that actually updates the parameters.

The most fundamental optimizer algorithm is called Gradient Descent.

Let's follow what happens to just one parameter:

Quantity

Example Value

Current Parameter Value

0.40

Calculated Gradient

+0.60

Learning Rate (Step Size)

0.10

What does that gradient of +0.60 tell us?

  • The gradient is positive (+).

  • A positive gradient means: "Locally, a tiny increase in this number would increase the loss, with the other parameters held fixed."

  • Therefore, to make the error go DOWN, gradient descent moves the number in the opposite direction!

The Learning Rate controls the size of the step we take:

JAVASCRIPT

New Parameter = Old Parameter - (Learning Rate × Gradient)

              = 0.40 - (0.10 × 0.60)

              = 0.40 - 0.06

              = 0.34

A number inside our model has just changed from 0.40 to 0.34.

On its own, a change of 0.06 looks tiny. But when we run the model again, this new value participates in the calculations that use that parameter. Its future predictions can now be different; the size and direction of the effect depend on the rest of the network and the input. This isolated arithmetic example does not determine the earlier toy probabilities.

This is what learning actually means:

A neural network learns by adjusting its parameters using feedback from a training objective, so its future predictions can improve.

Why the Learning Rate Matters

The learning rate controls update size and can affect the speed and stability of learning:

  • Too large: Updates can overshoot, increase the loss, or destabilize training.

  • Too small: Updates may make progress unnecessarily slow.

  • Just right: Updates can support effective progress, although loss need not decrease at every step.

Many language models use optimizers such as AdamW. It tracks moving averages of gradients and squared gradients to scale updates for different parameters, and applies decoupled weight decay as an additional regularization term. Basic gradient descent also produces different update sizes when parameters have different gradients.

So, did that one single update fix the word "banana"?

We can't tell from the numbers alone. We have to test the model again.


6. Run It Again: Look for Progress

We pass "The sky is" through the updated model and calculate fresh probabilities.

Perhaps blue becomes slightly more likely. Perhaps it still isn't the top choice yet. A single update does not guarantee that the top word immediately flips, and training loss does not drop smoothly on every single step.

But we now have a complete, repeatable engine:

  1. Predict: run the text forward through the model.

  2. Measure: calculate loss against the target tokens.

  3. Trace: use backpropagation to calculate gradients.

  4. Adjust: let the optimizer update the parameters.

  5. Repeat: continue across training examples.

We continue feeding the model varied text: descriptions of daytimes, sunsets, starry nights, fruit, science, stories, and conversations.

Across many suitable examples, the model learns that different contexts call for different continuations. Improving those predictions means tuning the numbers to capture spelling, grammar, relationships, and context.

Keep in mind: the objective simply rewards predicting text from the dataset. It does not independently verify whether that text is true in the real world. Better next-token prediction does not guarantee factual accuracy.

Suppose suitable training eventually leads our model to assign a high probability to blue for our familiar example. Other surrounding context can still make a different continuation more likely.

You feel relieved. It finally got the familiar example right!

Before celebrating, change the question.


7. Take Away the Sentence It Practiced

Try a sentence you deliberately kept out of training:

"On a cloudless afternoon, the sky looks …"

Now we are asking something much deeper: Can the model use what it learned when the exact wording is unfamiliar?

That ability is called Generalization.

A model can do exceptionally well on the sentences it practiced during training, yet fail completely when given new sentences. A large training-versus-unseen performance gap can indicate Overfitting: the model has fitted details of its training data that do not transfer well. Overfitting can involve memorization, but it is not limited to memorizing exact sentences; poor new-example performance can also have other causes.

Predicting blue after one familiar sentence doesn't prove the AI has generalized. And getting one new sentence right doesn't prove it either.

To catch overfitting, developers commonly hold back a separate collection of text called the Validation Set. The AI never adjusts its numbers on this validation text; it helps monitor performance on held-out examples and guide choices such as when to stop training. Because those choices use validation results, a separate test set is preferable for the final assessment.

If training loss keeps going down while validation loss starts climbing, that is a warning sign of overfitting. It is a reason to investigate, not proof that the model is simply “memorizing rather than understanding.”

Our challenge has grown: we don't just want to fix one embarrassing answer. We want the internal changes to remain useful across brand-new sentences.


8. How One Experiment Becomes Large-Scale Training

Following one sentence made the mechanics clear. But training a real language model requires repeating this process across very large datasets, usually measured in tokens, potentially billions or trillions for large models.

Here is how engineers scale the loop up:

  • Batches: Instead of updating the dials after every single sentence, we process groups of examples called batches (for example, 512 sequences at once). Losses or gradients are typically aggregated across relevant examples and token positions. This can reduce sampling noise and improve hardware efficiency; it does not automatically resolve contradictory training data.

  • Training Step: Commonly, one optimizer update. With gradient accumulation, several smaller batches can contribute gradients before that update.

  • Epoch: One complete pass through an entire training dataset. Training runs may instead be described by token budgets and steps. How many times data is reused depends on the model and data mixture; there is no universal one-or-two-epoch rule.

  • Distributed Training: Very large models may need multiple devices to hold parameters, gradients, optimizer state, and intermediate activations. Memory requirements depend on precision and training method. Work can be divided across GPUs or other accelerators by splitting the data, the model, or both; the required device count varies.

The engineering scale is vast. But underneath all that machinery, the core rhythm remains identical: predict, measure the loss, calculate gradients, and update the parameters.


9. Tomorrow, You Correct the AI: Does It Learn Again?

Training finishes. The engineers save the learned parameters to disk and launch the model for users to chat with.

This everyday stage is called Inference.

During ordinary inference, the model runs only the forward pass. It uses its trained numbers to generate text. It does not run backpropagation, and it does not update its parameters after every message you send.

Suppose you tell a trained assistant model:

"In my fantasy story, the sky is purple."

Then you ask:

"What color is the sky in my story?"

It may answer: "purple".

Did it update its parameters?

No. Its response changed because the conversation context changed — not because that sentence rewrote its internal numbers.

Think of the active conversation context as notes placed beside the model while it answers. Those notes can affect its predictions while its parameters remain unchanged—an effect often called in-context learning.

The context window is limited, but ending a chat does not automatically delete the conversation or erase every form of application memory. Saved chat history and product memory are separate from parameter updates. Also, 175 billion is the size of the largest original GPT-3 model, not a universal size for chat assistants.


10. The Big Picture of Pre-Training

Now return to the model we started with on Day Zero.

It had working calculations and terrible predictions. We didn't fix it by writing an endless list of manual rules.

We gave it examples, measured its errors with a loss score, calculated gradients through backpropagation, and used an optimizer to nudge its parameters downhill step by step.

The word "banana" was only the visible mistake on the screen. The actual learning happened in the numbers underneath.

And that leaves us with the ultimate question:

Is pre-training the whole story?

Not even close.


11. What Happens Post-Training? (From Autocompleter to Assistant)

So far, we have followed next-token pre-training. The forward pass, loss, backpropagation, and optimizer mechanics are also used in many forms of fine-tuning; they are not exclusive to pre-training.

When pre-training finishes, what you have created is called a Base Model (such as raw GPT-3 Base or Llama 3 Base).

A base model is a pretrained model before assistant-specific post-training. In our causal language-model example, it has learned next-token prediction from a large collection of text, which may include books, articles, code, and websites. It can acquire grammar, information, coding patterns, and useful associations, but its capabilities and reliability depend on its training.

But next-token pre-training alone does not make a model a reliable assistant.

If you open a raw base model and type:

"Can you write a poem about rain?"

It might not write you a poem! Instead, it might simply autocomplete your prompt with more questions from a forum:

"Can you write a poem about rain? Help with 8th grade English homework. Posted 2 days ago by User42..."

Why? A base model is trained to continue text, not specifically to handle every prompt as an assistant request. A continuation resembling forum text can fit that objective. Some base models can already follow certain instructions; the example is one possible failure, not a claim that they cannot understand requests at all.

To transform a raw base model into a polite, helpful, and safe assistant like ChatGPT or Claude, models go through Post-Training.

Post-training can combine several methods. A common route uses supervised fine-tuning followed by preference-based training; some pipelines add reasoning-focused reinforcement learning. The exact order and combination vary:

Stage

Training signal

Aim

Pre-training

Next-token targets from large text datasets

Build broad language capabilities; produce a base model

Supervised fine-tuning (SFT)

Examples of desired responses to prompts

Improve instruction following and conversation behavior

Preference-based post-training

Preferred versus less-preferred responses, through RLHF or DPO

Improve alignment with selected preferences

Optional reasoning-focused RL

Rewards such as verified math answers or passing code tests

Improve reasoning-task performance

The model can continue text. How does it become an assistant?

Let’s return to the model we have been training.

We started with an unhelpful continuation:

The sky is … banana.

Then we discovered how training works: make predictions, calculate loss, calculate gradients, and update the parameters.

Repeat that process across enough suitable text, and the model can learn patterns that help it produce more useful continuations.

This broad initial training is called pre-training. The resulting model is commonly called a base model.

But now imagine asking it something different:

Explain gravity to a 10-year-old.

We want more than a plausible continuation. We want an explanation that answers the request, uses simple language, and suits the reader.

A base model may already do some of this. However, learning to continue text does not automatically make it a reliable assistant.

So our next question is:

How can we train it toward the kind of response we want?

That is where post-training begins: further training that builds on the base model.

Let’s follow one possible route. Different models use different combinations of methods, so this is an example rather than a universal recipe.

First, show it what a useful answer looks like

Imagine you are helping someone learn to explain a difficult topic.

You could say, “Explain it better.”

But that leaves them guessing what better means.

Instead, you show an example:

Request: Explain gravity to a 10-year-old.

Example response: Gravity is an attraction between objects. Earth’s gravity pulls you toward the ground. When you jump, that pull brings you back down.

The response demonstrates several things at once. It answers the question, keeps the language simple, and uses a familiar experience.

Engineers can collect many examples like this: requests paired with responses that demonstrate the desired behavior. Training on those examples is called Supervised Fine-Tuning, or SFT. When the examples focus on following instructions, it is also commonly called instruction tuning.

But what actually happens inside the model?

It still predicts tokens.

The request becomes part of the context. The example response supplies the tokens the training system wants the model to predict.

At the beginning of the response, it predicts the first response token. At later positions, it predicts the next token using the request and the earlier response tokens. The causal mask still prevents it from seeing the token it is supposed to predict.

The training system calculates loss on those predictions—often focusing on the assistant’s response tokens. Backpropagation calculates gradients, and the optimizer updates the trainable parameters.

So the machinery we discovered earlier still applies. We have changed the examples we practice on, shaping the continuations toward useful answers to requests.

Across many varied demonstrations, the aim is for that behavior to transfer to requests the model has not seen before.

Next, compare answers that are both possible

Demonstrations give us a useful starting point. But sometimes there is more than one reasonable way to answer a question.

Let’s ask about gravity again.

Suppose the model produces these two invented responses:

Response A: Gravity is an attraction between objects. Earth pulls you toward the ground, which is why you come back down after jumping.

Response B: Gravity is a fundamental interaction associated with spacetime curvature and the distribution of mass and energy.

For a young reader, we would probably prefer A. Response B uses language that makes the explanation harder to follow.

Notice what we are providing now.

We are not writing a single example answer. We are comparing two answers to the same request.

That comparison provides a different training signal:

For this request, prefer A over B.

Many such comparisons form a preference dataset. Human reviewers can provide them; automated systems can also contribute feedback.

There are different ways to use these preferences. Two important approaches are RLHF and DPO.

Let’s separate them carefully.

One route: learn a scoring system, then train with its scores

Imagine collecting thousands of comparisons like our gravity example.

Instead of asking a person to review every new answer during the next training stage, we could train a separate model to estimate which responses reviewers would prefer.

This is called a reward model.

In a typical reward-model-based RLHF pipeline—short for Reinforcement Learning from Human Feedback—the language model generates responses, the reward model scores them, and a reinforcement-learning algorithm uses those scores to guide parameter updates. Training usually includes a constraint or penalty that discourages excessive drift from a reference model.

The reward score is feedback for training. It is not a certificate that an answer is correct.

A scoring system can have blind spots. If it rewards confident, polished wording too strongly, a response could score well while still containing a mistake.

Another route: train directly from the comparisons

Now imagine keeping our preference pairs:

Request → preferred response A → less-preferred response B

Could we use those comparisons without first training a separate reward model?

Direct Preference Optimization, or DPO, provides this route. It uses a preference objective to update the language model directly from preferred and less-preferred responses, relative to a reference model. It does not require the conventional separate reward-model-and-reinforcement-learning loop.

For our gravity example, both routes use the preference for A, but they turn it into training feedback differently:

Route

How the comparison becomes training feedback

Typical reward-model-based RLHF

Learn a reward model from comparisons, then use its scores during reinforcement learning.

DPO

Use a preference loss to train the language model directly from response pairs.

Both aim to shape behavior toward the selected preferences. Neither guarantees that every future answer will be helpful, truthful, or safe.

What if we can check whether the result works?

Our gravity explanation involved a judgment: which response suits the reader better?

Now consider a different request:

What is 17 × 24?

We can calculate the answer:

17 × 24 = 408.

Or suppose we ask the model to write a function that sorts a list.

We can run the generated code against tests and see whether it produces the expected results.

These tasks offer another kind of feedback: a result we can check.

Some reasoning-focused training uses reinforcement learning with rewards based on checkable outcomes, such as correct mathematical answers or code that passes tests. DeepSeek-R1 is one example of research using this approach.

The basic idea is to let the model produce candidate solutions, evaluate their results, and use that feedback to guide training.

However, a successful result does not prove that every intermediate step was correct. Passing a few code tests does not prove that the code handles every possible input, either.

The feedback is only as informative as the checks we use.

Bring the whole journey together

We can now see how our original training story connects to assistant behavior.

During pre-training, the model practices predicting tokens across broad data.

During SFT, it practices on examples that demonstrate desired responses.

During preference training, comparisons help shape which responses it favors.

Some training routes also use checkable outcomes to improve performance on particular tasks.

The training signals differ, but each method can change trainable parameters. Afterward, we still need to evaluate the model on examples beyond those used to train it.

These methods can be combined, repeated, or arranged differently. Reasoning abilities can also develop through methods other than reinforcement learning.

And once training is complete, ordinary chatting uses those learned parameters to generate responses. New context can influence the answer without becoming an immediate weight update.

Our story began with a model that could run the calculations but had not yet learned useful patterns.

Now we understand how training can shape those patterns—and why producing a convincing answer still does not guarantee a correct one.

That leaves us with the question for our next episode:

When an AI gives us an answer, how do we decide whether to trust it?


Your One-Minute Snapshot

Concept

What to remember

Parameters

Adjustable numbers that shape the model’s calculations. Weights are one type of parameter.

Training target

The observed next token in a training example. It need not be the only valid continuation.

Self-supervised learning

The data supplies its own targets; next-token training is one example.

Causal mask

Blocks future-token access while allowing many prediction positions to train in parallel.

Forward pass

Runs the model’s computations to produce predictions.

Logits and softmax

Logits are raw scores; softmax converts them into probabilities that sum to one.

Loss

Measures how well predictions match the training objective. Lower loss is not proof of truth.

Gradients

Describe the local sensitivity of loss to changes in parameters.

Backpropagation

Calculates gradients; it does not update parameters itself.

Optimizer

Uses gradients and its update rules to change trainable parameters.

Learning rate

Helps control update size. In basic gradient descent, it multiplies the gradient.

Training loop

Forward pass → loss → gradients → parameter update → repeat. Loss can fluctuate.

Generalization

Learned patterns transfer to held-out examples.

Overfitting

Training performance improves in ways that do not transfer well. It is broader than exact memorization.

Validation and testing

Validation guides choices; a separate test set helps assess the final model.

Batch

A group of examples processed during training. Several microbatches may contribute to one update.

Training step and epoch

A step commonly means one optimizer update; an epoch is one pass through a fixed dataset.

Distributed training

Multiple devices coordinate the work, dividing data, model computations, or both.

Inference and context

Ordinary inference uses unchanged parameters. Context can change the response without updating weights.

Base model

A pretrained model before assistant-specific post-training.

SFT

Trains on desired responses while still predicting tokens.

RLHF

Uses human-feedback-derived rewards; a common route trains a reward model, then uses reinforcement learning.

DPO

Trains directly from preference pairs without the conventional separate reward-model-and-RL loop.

Outcome-based reasoning training

Checkable results can provide rewards, but do not establish that every step or case is correct.

Post-training

Further training that shapes behavior or task performance. Methods and order vary.

Learning changes the model’s parameters. Context changes the information available for a response. Evaluation checks how well the resulting behavior works.

Sources:

  1. Hugging Face — Causal language modeling

  2. OpenAI — Original GPT-2 model implementation

  3. GPT-2 configuration — Vocabulary size

  4. PyTorch — Automatic differentiation

  5. PyTorch — AdamW

  6. PyTorch — Optimizing model parameters

  7. OpenAI — Memory in ChatGPT

  8. Ouyang et al. — Training language models to follow instructions with human feedback

  9. Rafailov et al. — Direct Preference Optimization

  10. DeepSeek-AI — DeepSeek-R1 technical report

Finished this lesson?

Mark this chapter complete to update your learning streak and unlock the next lesson.