Module 1Lesson 1

What Are LLMs

A plain-English explanation of large language models and why they behave the way they do.

8 min read
3 quiz questions2 templates

A large language model, or LLM, is a neural network that works on tokens and generates text by predicting what token should come next. Most popular AI products still rely on this basic autoregressive loop: read the context, predict the next token, append it, and repeat until the answer is done.

That means an LLM is not a magic facts database and it is not thinking like a human expert. It is a probability engine that has learned patterns from a huge amount of text, code, and in many modern systems, images too. The reason prompting matters is simple: your prompt becomes the context the model uses to decide what comes next.

A useful mental model: an LLM is a very powerful pattern-completion machine. It can sound fluent and insightful because it has learned billions of language patterns, not because it has human-style understanding.

Under the hood, most modern LLMs are transformer-based models. They break your input into tokens, look across the full context window using attention, and estimate which continuation best fits the pattern so far.

  1. Tokenize the input: Your message is split into smaller pieces of text called tokens.
  2. Read the context: The model uses attention to weigh which earlier tokens matter most for the next step.
  3. Predict the next token: It assigns probabilities across many possible continuations and picks one.
  4. Repeat until complete: The newly generated token becomes part of the context for the next prediction.

Model vs Product

Model: A base language model that predicts tokens. Product: A chat app like ChatGPT, Claude, or Gemini that wraps the model with a UI, safety rules, system prompts, tools, memory, and sometimes retrieval from external data. Agent workflow: A larger system that may let the model search, call APIs, run code, or hand work between multiple steps.
This distinction matters. When an AI product browses the web, calls a calculator, or checks a document store, that capability often comes from the surrounding system, not from the raw language model alone.

Training usually happens in stages. First comes pretraining, where the model learns broad language patterns from enormous datasets. Then comes post-training, where the model is shaped into a useful assistant through instruction examples, preference data, safety tuning, and evaluations.

  • Pretraining teaches the model language patterns, world knowledge, style, and structure.
  • Instruction tuning teaches the model how to respond to prompts in an assistant-like format.
  • Preference and safety tuning push the model toward more helpful, reliable, and bounded behavior.
  • Tool use and retrieval are often added at the product level so the model can do more than pure text prediction.

Because the model is continuing a pattern, vague prompts produce broad and average answers. Specific prompts create a narrower path. Good prompting is really context design: you give the model the role, task, constraints, examples, and output shape that make the desired continuation obvious.

Vague prompt: "Tell me about customer support." Likely result: A generic overview because the model has too many possible directions. Better prompt: "You are advising a 5-person SaaS support team. Explain three ways AI can reduce first-response time without hurting customer trust. Give one operational risk for each idea and end with a simple rollout plan." Likely result: A much sharper answer because the role, audience, scope, and format are all constrained.

Try It Yourself

Take one broad question you ask AI often and rewrite it with four pieces of context: the role you want, the exact task, the desired output format, and one constraint. Notice how much easier it becomes for the model to stay on track.
Key insight: you are not just asking a question. You are building the setup the model will continue. Better setup usually beats clever wording.

Prompt Templates

Concept Explainer

Turns abstract AI ideas into practical prompt-writing insight.

Explain [CONCEPT] in plain English for a beginner. Use one concrete analogy, one example of how it shows up inside ChatGPT/Claude/Gemini-style products, and one reason this matters when writing prompts.

Model vs Product Analyzer

Helps you separate what the model does from what the application adds.

I am using [AI TOOL] for [TASK]. Break down which parts likely come from the language model itself versus the product around it. Cover: core model behavior, tool use, retrieval, memory, and safety rules. Then tell me how that should change the way I prompt.

Test Your Knowledge

Knowledge Check

1 / 3

Which description is most accurate for how an LLM produces text?

Key Takeaways

  • An LLM generates text by predicting the next token from the context it sees
  • Most modern LLMs are transformer-based systems that use attention across a context window
  • The raw model is different from the chat product, tools, memory, and retrieval layer around it
  • Pretraining gives broad language skill; post-training shapes assistant behavior and safety
  • Prompting works because you are designing the pattern the model is about to continue