Course Content
What is Prompt Engineering?
Introduction to LLMs, tokens, and why prompt design matters
What is a Large Language Model?
A large language model (LLM) is a type of AI trained on enormous amounts of text — books, websites, code, articles — to predict the next word (or more precisely, the next token) in a sequence.
When you write a prompt and send it to an LLM like Claude or GPT-4, the model doesn’t “understand” your request the way a human does. Instead, it predicts the most likely continuation of your text, based on patterns learned during training. This prediction process is what generates the response.
This has a profound implication: the quality of the output depends almost entirely on the quality of the input (your prompt).
What Are Tokens?
LLMs don’t process text character-by-character or word-by-word. They process tokens — chunks of text that can be whole words, partial words, or punctuation.
Some examples:
"machine"→ 1 token"learning"→ 1 token"unbelievably"→ 3 tokens (un,belie,vably)"ChatGPT"→ 2 tokens
Why does this matter for prompting? Because:
- Cost: Most LLM APIs charge per token. Verbose prompts cost more.
- Context window: Models can only process a limited number of tokens at once. Knowing this helps you design prompts that fit within the limit.
- Output control: When you ask for a “200-word summary,” the model thinks in tokens, not words. The result may be longer or shorter than expected — ask for “3 sentences” instead.
Why Does Prompt Design Matter?
Consider this example. Both prompts go to the same model:
Prompt A:
Summarize this article.
Prompt B:
You are a research analyst preparing a briefing for a non-technical executive. Summarize the following article in exactly 3 bullet points. Each bullet should start with a verb and focus on the business impact, not the technical details.
The second prompt will produce a dramatically better result — not because the model is smarter, but because you’ve given it:
- A role (research analyst)
- An audience (non-technical executive)
- A format (3 bullets, verb-first)
- A focus (business impact, not technical details)
This is the core insight of prompt engineering: the model is capable, but it needs direction.
The Prompt-Output Relationship
Think of an LLM as an extraordinarily capable but extremely literal assistant. It will do exactly what you ask — no more, no less. If your instruction is vague, it will fill in the gaps with its best guess. Sometimes that guess is right. Often it isn’t.
Prompt engineering is the discipline of eliminating that ambiguity — writing instructions clear enough that the model’s “best guess” is always what you intended.
A Mental Model: The Completion Machine
Here’s a useful mental model: every LLM is a completion machine. It takes text as input and outputs the most likely continuation.
This means:
- If your prompt reads like the start of a terrible response, the model will likely complete it terribly.
- If your prompt reads like the start of an expert, well-structured response, the model will likely continue in that vein.
Try it: start a prompt with "The three most important considerations are:" and the model will naturally produce a numbered list. You didn’t ask for a list — you implied one.
What’s Next
In the next lesson, you’ll learn the four components of every effective prompt — instruction, context, examples, and output format — and how to use each one to control LLM behavior precisely.
