LyraLearn AI Learning Platform
Exams
← Module 2 Β· Large Language Models
🎧 Listen

How LLMs Work (Enough to Architect With)

You don't need to train models to architect with them, but you do need an accurate mental model of what they are. A large language model is a function that, given a sequence of text, predicts the next token β€” over and over β€” to produce a response. Everything else follows from that.

A sequence of tokens entering a model that predicts the next token by sampling from a probability bar chart of candidates.

Tokens, not words

Models read and write tokens, not characters or words. A token is roughly ΒΎ of a word. Three consequences matter to an architect:

Prediction, not retrieval

The model generates each token by sampling from a probability distribution over the vocabulary. It is predicting plausible continuations, not looking up facts. This is why:

Training vs context

A model's "knowledge" comes from two places:

The entire discipline of RAG (Module 6) exists to exploit that second lever: rather than hoping the model memorized your facts, you retrieve them and put them in the context.

The architect's takeaway

Treat the model as a powerful but unreliable text predictor with a fixed memory and a finite attention budget. Your job is to feed it the right context, constrain its output, and check its work β€” not to trust it.

🧠 Quiz yourself on this lesson →

Ask the AI Tutor

Grounded in the course lessons β€” it cites its sources and says when it doesn't know.