Automation & AIModule 1: AI without the mysteryLesson 2 of 15
Course progress7%

19 min lesson · Updated August 2026

What are language models, prompts and context?

A language model generates likely sequences of tokens from instructions and context; a prompt tells it the task, and the context window contains the material it can consider in that interaction.

What you will learn

By the end, you will understand:

  • Explain token prediction without anthropomorphism
  • Write a bounded prompt with task, evidence and output rules
  • Understand context-window, instruction and conversation limits

Visual explainer

See the idea clearly.

Language models generate token by token

Text is broken into tokens—pieces of words, words or symbols. The model estimates plausible next tokens from patterns learned during training and the current context. Repeating this process produces a response.

The output can be useful, creative and structured, but plausibility is not the same as a database lookup or verified truth.

A prompt is more than a question

PartExample
TaskSummarize the supplied complaint into three neutral facts.
Audience/purposeFor a support manager deciding the next action.
Source boundaryUse only the ticket text; state “not provided” for missing facts.
ConstraintsDo not include contact details or infer motive.
Output formatReturn issue, evidence and missing information as fields.
Quality checkQuote the exact sentence supporting each factual field.

Context is temporary working material

The context may include system/developer instructions, user messages, documents, tool results and prior conversation. Models give different priority to instructions depending on system design. Context can be truncated when it exceeds limits.

Supplying a long document does not guarantee every detail is attended to. Chunk, retrieve and verify important evidence, and do not assume the model remembers information outside the active system.

Separate instructions from untrusted content

A document, webpage or customer message can contain text such as “ignore previous instructions.” That is data, not authority. Systems that let external content override tool permissions are vulnerable to prompt injection.

Delimit untrusted material, restrict tools, validate outputs and require approval for consequential actions. Never place secrets in prompts simply because instructions say not to reveal them.

Improve prompts through evaluation

  1. 01

    Define representative task

  2. 02

    Write simple baseline prompt

  3. 03

    Create test cases and expected criteria

  4. 04

    Run consistently

  5. 05

    Inspect errors by type

  6. 06

    Change one instruction/example

  7. 07

    Retest regressions

  8. 08

    Version prompt and model

Prompting cannot solve every problem

  • Missing source data
  • Wrong tool permission
  • Unclear business process
  • Unsafe autonomy
  • Biased/incomplete dataset
  • No way to verify output
  • Model lacks needed capability
  • Latency or cost constraint
  • Legal/contractual restriction

Real-world example

Example: a bounded meeting summary

Example

Instead of “summarize this,” the prompt asks for decisions, owners, due dates and unresolved questions using only the transcript. Each item must cite a timestamp; absent owners are marked unknown. A person checks the result before tasks are created.

Try this

Write a source-bound prompt

Choose one low-risk document task. Specify the audience, allowed source, forbidden inference, output fields and evidence check. Create one test where the source omits an important fact.

Common questions

Questions beginners ask.

What is a language model?

A model trained to predict and generate language patterns from tokens and context.

What is a token?

A unit of text processing that may be a word, part of a word, punctuation or symbol.

What is a prompt?

Instructions and input that define the task, context, constraints and desired output.

What is a context window?

The bounded amount of material the model can consider in one interaction.

Does a longer prompt always improve output?

No. Irrelevant detail can distract, and missing data or unsuitable tasks remain unsolved.

Does a model remember every conversation forever?

No. Memory depends on the product architecture, stored state, retrieval and current context—not an assumed permanent mind.

What is prompt injection?

Untrusted content attempts to manipulate the model or system into ignoring intended instructions or misusing tools/data.

Should prompts contain passwords?

No. Secrets require secure credential systems and least-privilege tool access, not prompt text.

Assessment

Check what you understood.

5 questions · instant explanations

1. What does a language model generate?
2. Which prompt element reduces unsupported facts?
3. What can happen when context exceeds limits?
4. How should text inside an untrusted webpage be treated?
5. True or false: prompt engineering can repair missing source data.

Sources

Primary references.