From the book

How do you give ChatGPT the right context?

· By Robert Scales · 4 min read

Short answer

Give ChatGPT context in order of impact: first the purpose of the answer, then who it is for, then the facts and limits only you know, then any source material, and only after that format and tone. Leave out details that would not change the answer.

Most advice about context says "add more." That is half right. A model like ChatGPT builds its answer from whatever is in the conversation, so missing information gets filled with the most typical guess. But not every detail pulls the same weight. Some change the answer completely; others change a word or two. When your time is limited, it helps to know which to write first.

A Beginner's Guide to ChatGPT devotes a chapter to what it calls training your model: setting up the conversation with background, goals and expectations before asking for output. The ranking below builds on that idea and puts the kinds of context in the order they usually matter.

Context, ranked by impact

  1. Purpose: what the answer is for. "A notice to recruit volunteers" and "a notice to thank volunteers" use the same facts and need completely different text. If you write only one line of context, make it this one.
  2. Audience: who will read or use it. Retirees who garden, teenage volunteers, a city councillor. The audience sets vocabulary, length and what needs explaining.
  3. Your facts and limits. Dates, numbers, names, budget, what is not possible. These are the details the model cannot guess, and the ones it will invent if you leave a gap.
  4. Source material. If the answer should be based on a document, an email or your notes, paste the relevant part. OpenAI's prompting guide suggests putting instructions first and separating the material with markers such as triple quotes or ###, so the model can tell what to read from what to do.
  5. Format. A bulleted list, a 120-word paragraph, a table with three columns. OpenAI's guide recommends precise targets over vague ones: "three to five sentences" rather than "fairly short."
  6. Tone and style. Friendly, formal, plain-spoken. Useful, but it rarely rescues an answer that got the purpose wrong.
  7. Role. "Act as an experienced volunteer coordinator" can sharpen the angle, especially combined with the items above. On its own, it is the weakest of the seven.

A worked example: a community garden notice

Here is a request from someone who coordinates a community garden.

Before:

Prompt
Write a notice about the garden cleanup.

ChatGPT will produce something pleasant and generic, with a placeholder date, a vague call to "join us," and perhaps a reminder to bring gloves. You would rewrite most of it.

After, with context in ranked order:

Prompt
Purpose: get at least 15 volunteers to sign up for our fall garden cleanup.
Audience: members of our community garden, mostly retirees and young families; some read English as a second language.
Facts and limits: Saturday October 21, 9 a.m. to noon, rain date October 28. We supply rakes, bags and coffee. People should bring gloves. Sign up by replying to this email by October 18. Children are welcome with an adult. No power tools.
Format: under 120 words, short sentences, the date and time in the first line, ending with how to sign up.
Tone: warm and simple.

Every line answers a question the model would otherwise guess at. The purpose tells it to write a call to action, not an announcement. The audience note produces short, plain sentences. The facts remove placeholders, and "no power tools" heads off a question before anyone asks it.

Try it: Take a request you made to ChatGPT this week that gave you a so-so answer. Rewrite it with labeled lines for purpose, audience, and facts and limits, and nothing else. Compare the two answers before you add format or tone.

Context you repeat every time

Some context never changes: your job, your region, your preferred style. Since July, ChatGPT has offered custom instructions, a setting where you answer two questions once, what ChatGPT should know about you and how you would like it to respond, and it takes them into account in every new conversation. OpenAI's own example is a teacher who no longer has to say in each chat that they teach third-grade science. Use it for stable background, then keep each prompt for the task at hand. OpenAI notes that during the beta the model can sometimes overlook these instructions, so restate anything critical in the prompt itself.

Which background details matter most?

The ones that would change the answer if they were different. That is a quick test you can run on any detail before you type it: if the garden cleanup were in May instead of October, would the notice change? Yes, so the date matters. If the garden were founded in 2009, would it change? Probably not, so leave it out.

By that test, three kinds of background almost always matter. First, constraints: budget, deadlines, rules, what is off the table. They narrow the possible answers more than anything else. Second, specific facts the model cannot know: names, figures, local details, the exact wording of a policy. Without them it fills the gaps with plausible inventions. Third, what you have already tried or decided: "we tried a flyer last year and only five people came" saves you from getting the flyer idea back.

The book also warns about the opposite problem. A prompt packed with stray details and competing instructions can pull the answer off course. Context works best when every sentence earns its place, and the test above is a simple way to make sure it does.

Sources

  1. A Beginner's Guide to ChatGPT — Holistic Hybrid, April 18, 2023
  2. Best practices for prompt engineering with OpenAI API — OpenAI Help Center
  3. Custom instructions for ChatGPT — OpenAI, July 20, 2023

Get the free Guide to Artificial Intelligence

Sign up for the weekly newsletter and receive the free guide: what changed in AI this week, one lesson, one prompt to try. Unsubscribe in one click.

How we handle your address

Back to top

Display

Your choices are saved in this browser only. No data is sent.

Text size
100%
Colours
Reading
More settings
Accessibility statement