Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Introduction to AI Engineering  ›  Lesson

Large Language Models

Large Language Model (LLM) 12 minA large language model generates text by repeatedly predicting a likely next token, so its output is plausible rather than guaranteed true.

Large Language Models

The first prototype of the Pedal Point assistant was impressive for ten minutes. Then a customer asked about helmet returns and it answered "60 days" with total confidence. The real policy is 30. Nothing was broken: the model was doing exactly what it is built to do. Knowing what that is will save you from trusting it in the wrong places.

The rule

An LLM predicts the next token, again and again.

A large language model (LLM) is a model trained on an enormous amount of text. Training teaches it one skill: given some text, estimate how likely each possible next piece is. Those pieces are tokens, usually a word or part of a word.

Generation is a loop:

  1. Read all the text so far.
  2. Score every possible next token by probability.
  3. Pick one, attach it, and go back to step 1.

Given "Your order has been", the model might rate "shipped" as very likely and "eaten" as nearly impossible. It picks, appends, and repeats until it produces a stop signal or hits a length limit.

This one loop explains most LLM behaviour:

  • Fluency. Having seen so much text, it writes smooth, well-structured language.
  • Hallucination. It produces what is plausible, not what is checked. When the true fact is missing, a likely-sounding one fills the gap.
  • Frozen knowledge. What it learned stops at the end of training. It knows nothing about orders placed today.
  • No memory between calls. Each request starts fresh. A chat "remembers" only because the app sends the earlier messages again.

The shortcut

For any fact in a model's answer, ask: "Was this in the text I sent?" If yes, the model could copy or reason from it. If no, it came from training patterns, and you should treat it as a guess.

"Has order 4417 shipped?"Step 1 of 4
  1. Check what the model received

    Only the customer's question. No order record was sent.

The trap is reading confidence as accuracy. A wrong answer and a right one sound exactly the same.

Drills

Answer fast — trust the rule.

quick drill

At each step of generation, what does an LLM work out?

quick drill

The assistant states a delivery date for an order it was never shown. What is the best description?

quick drill

A customer says "as I told you earlier" in a new message. How can the model know what was said earlier?

quick drill

Why can't a model trained last year tell a customer about a product launched last week?

Remember

  • An LLM predicts the next token, again and again.
  • Ask of every fact: was this in the text I sent?
  • Confident is not correct. Plausible is not proven.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainThe invented return window

A customer asked the Pedal Point assistant about the return window for helmets, and it confidently said 60 days. The real policy is 30 days and was never given to the model. Explain, in terms of how an LLM generates text, why this happened and what the app should do instead.