From Basic to Brilliant -- Understanding the Context Window in ChatGPT


Preview

  • The ingredients of any ChatGPT prompt
  • How to think about the context window
  • Technical details of the context window
  • How to make the most of the context window

Ingredients of a ChatGPT prompt

Great inputs → Great outputs. But you already knew that. The real question is "How do I make sure I'm giving great inputs?"

According to me, there are five basic ingredients of a good prompt:

  • Environment: Create a distraction-free zone
  • Objective: Clearly articulate the problem you're trying to solve
  • Context: Strategically decide which details to share and which to withhold
  • Output: Request the exact type of response you want
  • Follow-up: Ask for more and extract deeper insights

This comes straight from the AI Chat Cheat Sheet, a simple, free one-pager to help you make great prompts every time.

Today's discussion is all about context.


"A sophisticated autocomplete"

AI skeptics say a large language model is "nothing more than a sophisticated autocomplete".

AI skeptics are right! When you talk to ChatGPT, it does a bunch of complicated math in the background, but all it's really trying to do is answer: "in a conversation like this one, what would 'sound' reasonable to say next?"

ChatGPT may be "nothing more than a sophisticated autocomplete", but my dear reader, that does NOT imply that the outputs are not useful! I often find them quite useful indeed.

But here's the crux of the issue: The way ChatGPT decides what might "sound reasonable" to say next is all based on what it has read so far.

Imagine you overheard a conversation, and picked up snippets including the terms: Hogwarts, wizardry, Muggles, broomsticks, wand.

You'd have a pretty good idea the people were talking about Harry Potter, and you'd have a good idea what topics might be coming up next (Professor Snape's alignment, the Muggle Protection Act, whether non-humanoid magical creatures should be allowed to purchase wands, etc.)

ChatGPT is the machine equivalent of you, when you overhear that conversation. The more unique, domain-specific words it hears, the better it can guess "what would sound reasonable to say next".

💡Give ChatGPT more specific context, and your outputs go from generic to genius.


Technical details of the context window, explained

The first thing to understand is that there are two different technical 'limits' when you're using ChatGPT:

  • The message size limit is how much you can fit into a single message. The limit is 4,096 characters, about as long as a medium-length blog post or a detailed email.
  • The context window is how much ChatGPT can "remember" about your conversation so far. This limit is 8,000 tokens (roughly 8,000 words) for ChatGPT Plus users.

If you were reading out loud, 8,000 tokens or words might take you between 1 to 1.5 hours, depending on your reading speed. GPT-4's context is like remembering everything from a spoken conversation that lasted over an hour.

That's a LOT of context.

You will no doubt have noticed: the context window is significantly longer than the message size limit.

What do you do if you want to add more context than you can fit in a single message? Simple:

📝 (After your long message...) More context coming. Please do not do anything yet. Just reply "Got it!"


What you should put in the context window

Imagine a human who could remember an hour-long conversation word-for-word.

  • You'd bring them to every meeting
  • You'd delegate your most complex projects to them
  • You'd probably ask them to mediate arguments with your spouse (although that might backfire on you!)

Usually, it's helpful to think of ChatGPT as an intern -- an intern with a quirky-but-useful set of skills. This is one feature where it's more helpful to think of ChatGPT as a machine.

Using the context window effectively is more like using a machine to "brute force" something. Feed GPT-4 a mountain of relevant data and let it connect the dots.

Here are four examples to help you rethink the context window.

Update to the Board

Tired: Write an update to my Board of Directors. Use a formal tone.

Wired: Here is a list of all 12 Board members, their educational and career backgrounds, their pet projects, hot button issues, and pet peeves. I've also included our strategic priorities and status updates on all major projects this quarter. Please write an update to the Board, connecting our activities to our strategic priorities, and addressing Board members' pet projects and hot button issues.

New employee onboarding

Common: Create an onboarding guide for new people joining our marketing team.

Classy: Here's a compilation of our marketing team's profiles, details on past campaigns, feedback from team brainstorming sessions, tools and platforms the team frequently uses, a list of regular clients and partners, and the department's KPIs and objectives for the next quarter. With this understanding, produce an onboarding guide that ensures a seamless integration of new members into our team's dynamic and culture.

Speaker bio

Simplistic: I've been asked to speak at a conference. Can you help me write my bio?

Specific: Here is my CV, a list of articles I've written, and a current draft of my upcoming conference talk. Can you please craft a speaker bio for my talk? I want the reader to understand why I am uniquely qualified to comment on the subject of [x].

Software release announcement

Mundane: We are releasing version 2.1 this week, which includes an exciting new feature [x]. Can you please draft a release announcment?

Marvelous: Here are the development notes for v2.1, feedback and bug reports from beta testers, comparisons with the previous version, a list of features that were highly requested by users, and a note on our company's vision for future software development. Using this information, craft a compelling announcement that not only lists the new features but also tells a story of how v2.1 is a direct response to user needs and indicative of our commitment to excellence.


Bottom line

Because ChatGPT can keep a LOT of information in its "head" all at once, you can use that to your advantage. Give a lot of detailed context and you'll get more interesting results than if you just write a single sentence.

This might require you to unlearn a little bit, because while ChatGPT can read and remember a 25 page document, that's not how you should be writing emails to real people (Bottom line up front, a couple sentences of background, and a "let me know if you want to discuss").

Speaking of email, hit 'Reply' and tell me what you think. Anything you'd like me to write more about? I read every response.

Adam


Whenever you're ready, here are 2 ways I can help you:

[Individual] Coaching Call. Permanently level-up your AI skills with real-time feedback from an experienced practitioner (90 minutes)

[Team] Introduction to AI + Deep Work: Upgrade your team’s capabilities in a fast-paced, interactive environment (3 hours)

Adam Lorton

I help executives and their teams combine the power of AI with the principles of Deep Work to - Get unstuck - Move faster - Deliver excellent experiences for customers Subscribe for prompts, case studies, and stories in your inbox weekly!

Read more from Adam Lorton

GPT-4ohmygosh Howdy! Yesterday, along with 2.1 million other AI-heads, I tuned in to see OpenAI's latest product announcement. Here's the ultra-quick summary: The new model is called 'GPT-4o' where "o" stands for "omnimodel" It's free to the public It's still smart and faster than ever It has more expressive voices OpenAI is releasing a desktop app to go with it "A desktop app?" you ask. "Is that really news?" It's big news, and I'll tell you why 👇 (3 minute video) OpenAI announces GPT-4o If...

Teach you, I will So you've learned enough about AI tools to be dangerous, and now you want to pay it forward. You want to pass that knowledge on and help someone else. Commendable! (as my good friend ChatGPT would say) A Jedi teaches a young Padawan - Adam Lorton & Midjourney Not so fast. Have you ever been bruised, demotivated, or deflated by an abrasive, condescending teacher? Of course you have. We all have. (If we're being honest, most of us have BEEN the abrasive teacher at one point or...

Claude 3 has entered the chat Hello, my name is Claude - Adam Lorton & Midjourney Monday, Anthropic AI made an announcement many thought improbable: they'd shipped a model that outperforms GPT-4 (the model you get when you pay for ChatGPT Plus). GPT-4 has been the undisputed heavyweight champion of large language models (LLMs) for nearly a year. Anthropic @AnthropicAI Today, we're announcing Claude 3, our next generation of AI models. The three state-of-the-art models—Claude 3 Opus, Claude 3...