Skip to content
FORGENO ADS GAMESUnlock all $8

Prompt Engineering & AI Automation · Unit 1 of 8

Unit 1: How models read prompts

What a model can and cannot see, tokens and the context window, why the same prompt gives different answers, and how system prompts and roles work.

Opens the first lesson of this unit in Prompt Engineering & AI Automation. Every lesson is open from the start.

Lesson 1: A prompt is all the model knows

Goal: Explain what a prompt is and apply the new-hire test to a request.

A prompt is everything you send a language model in one request: your instructions, any background, the material to work on and any examples. The model reads it and produces the most likely useful continuation. It cannot see your screen, your files, your earlier conversations (unless the app sends them again) or the picture in your head. If something matters and it is not in the prompt, the model has to guess.

Prompt engineering is the skill of writing, testing and improving those inputs so that a model does a job reliably, not just once. It is less about magic phrases and more like writing a clear brief for a capable new colleague who knows a lot about the world but nothing about your company, your customers or what you are trying to achieve today.

Worked example: the new-hire test

Your manager forwards a supplier contract with one line: "Summarize this for the team."

  1. A new hire would ask: which team? How long should it be? What do they need to decide? Is it for an email or a slide?
  2. A model has the same gaps, but instead of asking it usually guesses, and the guess is often a long, generic summary.
  3. Rewritten: "Summarize the supplier contract below for our five-person warehouse team. They need to know what changes for them on 1 March. Use at most 5 bullet points in plain language, and flag anything that needs a manager to decide."

If a smart new colleague would need to ask a question, put the answer in the prompt.

This course treats prompts as work products. You will write them with a structure, test them on realistic inputs, measure how often they are right, chain them into workflows with checks between the steps, and decide honestly when a task should not be automated at all. Those are the skills employers mean when they ask for "prompt engineering" or "AI automation" experience.

Prompt
Everything sent to a language model in one request: instructions, background, the material to work on and any examples.
Prompt engineering
Writing, testing and improving prompts so a model does a task reliably, not just once.
Large language model (LLM)
A very large model trained on huge amounts of text to predict the next piece of text. Chat assistants are built on LLMs.

Remember: The model only knows what is in the prompt. Apply the new-hire test before you press send.

Lesson 2: Tokens and the context window

Goal: Estimate token counts and keep long prompts focused.

Models read and write tokens: chunks of text that are often a whole common word, a piece of a longer word, a space or a punctuation mark. A useful rule of thumb for English is about four characters, or three-quarters of a word, per token. Other languages and computer code often need more tokens for the same meaning.

The context window is the maximum number of tokens a model can handle in one request, counting the prompt and the answer together. Anything outside it does not exist for the model. Modern context windows are large, often hundreds of thousands of tokens, but every token you send takes time and costs money.

Rough token counts for English text (words ÷ 0.75)
What you sendWordsAbout how many tokens
A one-line instruction15about 20
A one-page email thread600about 800
A 20-page contract8,000about 11,000
A 300-page book90,000about 120,000

Long is not the same as good. Research on long prompts has found that models can overlook details buried in the middle of a very long input, and long inputs make answers slower and more expensive. Good practice: include what the task needs and cut what it does not; put long material first and your actual instruction or question after it; and if the input is very long, repeat the one rule that matters most near the end.

Token
A chunk of text a model reads or writes: a word, part of a word, a space or a punctuation mark. In English, roughly three-quarters of a word.
Context window
The most tokens a model can handle in one request, counting the prompt and the answer together.

Remember: Words ÷ 0.75 ≈ tokens. Send what the task needs, long material first, the instruction after it.

Lesson 3: Same prompt, different answers

Goal: Choose a sensible temperature and test prompts for consistency.

Run the same prompt twice and you may get two different answers. At each step the model scores many possible next tokens and then samples one. A setting called temperature controls how adventurous that choice is: low temperature favors the most likely tokens, higher temperature lets less likely ones through. Through an API you can usually set it; in chat apps you usually cannot.

TaskSensible temperatureWhy
Pulling fields out of an invoiceLow (0 to 0.3)You want the same, most likely answer every time
Labeling support ticketsLowConsistency matters more than variety
Drafting a routine emailMediumNatural wording, a little variety
Brainstorming product namesHigherYou want many different ideas

This has two consequences for professional work. First, one good run proves very little: test each prompt several times, on several inputs. Second, even at temperature 0, outputs are not guaranteed to be identical between runs or after a provider updates its model, so anything a program depends on must be checked rather than assumed.

Worked example: measuring consistency

  1. A team asks a model to label 10 customer reviews as positive, negative or mixed, and runs the batch three times.
  2. At temperature 1.0 the three runs agree with each other on only 7 to 9 of the 10 labels.
  3. At temperature 0.2 all three runs agree on all 10.
  4. They keep 0.2 for labeling and use 0.9 only for the brainstorming step in the same workflow.

Pick the setting for each task, and measure consistency instead of assuming it.

Temperature
A setting that controls how random the model's choice of next token is. Low is predictable, high is varied.
Sampling
Choosing the next token from the model's scored options, which is why outputs can differ between runs.

Remember: Low temperature for extraction and labels, higher for ideas. Always test more than once.

Lesson 4: System prompts and roles

Goal: Use system prompts and role prompting correctly.

Most model APIs, and many apps, separate a conversation into messages with roles. The system prompt holds standing instructions for the whole conversation: who the assistant serves, what it should and should not do, its tone and format. User messages hold each request. Assistant messages are the model's earlier replies, sent back so it can follow the conversation.

system:    You help staff at Juniper Office Supply answer customer emails.
           Be friendly and brief. Never promise refunds; say a manager will review them.
user:      A customer says 40 printer cartridges arrived damaged. Draft a reply.
assistant: (the model writes the draft here)

Role prompting means telling the model who to act as: "You are an experienced accounts-payable clerk." It can focus the tone, vocabulary and priorities, which helps. It does not give the model knowledge it lacks, and it does not replace the facts, format and limits the task needs. A role plus a clear task beats a role alone every time.

When instructions conflict, models generally give the system prompt more weight than a single user message, but that is a tendency, not a guarantee. Keep standing rules in one place, avoid contradictions, and remember that text you paste in (an email, a web page, a document) can contain instructions of its own. Units 2 and 8 show how to defend against that.

System prompt
Standing instructions for a whole conversation, sent before the user's messages.
Role prompting
Telling the model who to act as, to shape its tone and focus.

Remember: Standing rules go in the system prompt. A role sets tone, not knowledge.

Practise it in Prompt Engineering & AI Automation

Each lesson ends with three questions that check you can use the idea, not just recognise it. Wrong answers explain why and come back in Review. The unit ends with a 6-question quiz; pass it with 80% or more to master the unit.

Every lesson is free: no ads, no lives and no paywall.