Learn how to give models the right context for better results. Understand context windows, when to ground vs. rely on knowledge, and how to package inputs with delimiters. Includes scaffolds, acceptance criteria, a mini lab, and troubleshooting tips.
Most beginners assume the model “knows everything.” It doesn’t. It has patterns learned from training (its latent knowledge) and a short-term memory for your current conversation (the context window). You get the best results when you ground the model—feed it the exact text, data, or examples you want it to use—then ask a clear, scoped task on top of that.
In this guide, you’ll learn what a context window is in plain language, how to choose between latent knowledge and grounding, and how to package context so the model doesn’t confuse “task” with “data.” We’ll use simple delimiters, add acceptance criteria, and practice on a messy paragraph. By the end, you’ll have a reusable prompt scaffold you can copy-paste for summaries, Q&A, or notes.
Key terms (one-liners): Context window: the short-term memory of the model; only text inside it can be used right now. Latent knowledge: what the model “knows” from training as statistical patterns, not a live database. Grounding: giving the model real passages, notes, or data to rely on for this task. Delimiters: clear start/end markers that separate sections like """ ... """ or <context> ... </context>. Acceptance criteria: explicit checks of what “good” looks like (e.g., bullet count, audience, length).
Think of the model as a chef. Its latent knowledge is a huge, fuzzy pantry of recipes. Your context is the bag of ingredients you bring to the counter. The context window is the counter space: only ingredients on the counter can be used right now. Delimiters are bento boxes that keep ingredients separate so flavors don’t mix.
💡 Insight: If it’s not on the counter (in the prompt), the chef may “invent” a flavor from memory. Grounding keeps it honest.
When you ground, you’re saying: “Use only these ingredients; assemble them this way; serve it like this.”
Latent knowledge is great for generic know-how (“What is a haiku?”). It fails on specifics (“What did the 2024 report say on page 6?”) or when accuracy matters. Grounding wins when you have the source text, need citations, or must reflect the exact wording.
Quick chooser (scan and decide):
Use latent knowledge for evergreen facts, style help, brainstorming, and general explanations.
Use grounding for document summaries, meeting notes, product specs, support answers, and anything that must match a source.
If precision matters, prefer grounding; if breadth matters, latent is fine.
If the data is new or private, you must ground—it won’t be in training.
If you need traceability, add citations and “only answer from context” rules.
Most failures happen because the model blends your instructions with the source text. Fix this with structured sections and delimiters. You can use triple quotes, code fences, or simple XML-style tags—pick one style and stick to it.
A reliable shape looks like this:
System: (policy, tone, safety, grounding rules) User: Context: """ ...your source text or notes... """ Task: ...what you want done... Constraints: ...acceptance criteria (format, length, audience, do/don't)... Output format: ...how the answer must look...
💡 Insight: Place Context before Task so the model reads facts first, then the job. Keep each section short and unambiguous.
Vague: “Summarize the following article.”
Precise:
System: You must rely only on the provided context. If information is missing, say "Not in context." User: Context: """ <full article text> """ Task: Write a summary for busy teachers. Constraints: - 5 bullets, ≤15 words each. - Extractive tone: prefer wording and numbers from the context. - No outside knowledge; include 1 direct quote if present. Output format: - Bulleted list only.
The precise version tells the model what to use (context), what to do (task), how it will be judged (constraints), and how to shape the output (format).
We’ll construct a prompt that’s robust yet beginner-friendly.
Collect the source. Paste the exact passage you want used. If it’s long, pick the relevant section.
Box the context. Wrap it in """ or <context>...</context> and label it clearly.
State the task. Use one sentence (“Summarize for busy teachers”).
Add acceptance criteria. Word count, bullets, audience, must/forbidden items, and “only from context.”
Fix the output shape. Ask for bullets, JSON, or a small template to avoid meandering.
⚠️ Pitfall: If you forget “only answer from the context,” the model may blend in guesses. Add a refusal rule: “If not in context, say ‘Not in context.’”
A. Starter system prompt (reusable) Use this once at the start of a chat or at the top of your prompt.
System: You are a careful assistant. Use only the provided context for facts. If a required fact is missing, answer "Not in context." Prefer extractive phrasing (quote or paraphrase minimally) and include citations if requested.
B. Grounded Summary scaffold
User: Context: """ {{SOURCE_TEXT}} """ Task: Summarize for {{AUDIENCE}}. Constraints: - {{N}} bullets, each ≤ {{MAX_WORDS}} words. - Use only facts from Context; do not speculate. - Include 1 short direct quote if present. - End with a one-line takeaway. Output format: - Bulleted list, then a final line starting with "Takeaway:"
C. Grounded Q&A scaffold
User: Context: """ {{SOURCE_TEXT}} """ Task: Answer the question strictly from the Context. Question: {{QUESTION}} Constraints: - If the answer is not present, say "Not in context." - Quote the exact sentence supporting the answer. Output format (JSON): {"answer": "<short answer>", "supporting_quote": "<exact sentence>"}
D. Compression when context is long (first pass) Ask the model to produce an extractive note set to fit your window.
User: Context: """ {{LONG_SOURCE}} """ Task: Create an extractive outline covering entities, numbers, and claims only. Constraints: - Use exact phrases where possible. - Keep ≤ {{TOKEN_BUDGET}} tokens. - Preserve section headings if present. Output format: Heading + 3–7 bullets per section.
💡 Insight: “Extractive” means stick to the source’s wording. This reduces drift and hallucination.
Grounding isn’t magic; it’s disciplined packaging. When things go wrong, look for one of a few common causes and fix them at the source.
The model ignores context. Strengthen your system rule and constraints: “Use only the Context. If missing, say ‘Not in context.’ Do not use outside knowledge.” Place Context before Task.
Task and data get mixed. Your delimiters are weak or inconsistent. Switch to a single, loud pattern (e.g., XML-style tags) and label sections.
Output is too long/short. Your acceptance criteria are vague. Add hard limits: “≤15 words each” or “exactly 5 bullets.”
Conflicting instructions. If your system prompt says one thing and your task another, the model may pick either. Make the system policy the source of truth and remove duplicates.
Context overflow. The context window is finite. Compress first (extractive outline), then run the task on the compressed notes. If the model complains or truncates, you exceeded the window.
⚠️ Pitfall: Don’t paste a whole book. The model reads top-to-bottom; the most relevant chunk should be closest to the task.
Given messy paragraph (copy this):
Teachers around here are really pressed for time—like, meetings all week, grading at night, the whole deal. The pilot last spring showed 12% better assignment completion when reminders were sent Fridays before 3pm, but apparently the note has to be short (nobody reads long emails). Also, we tried Wednesday and it flopped; folks said it got buried. The principal wants next steps focused on “quick wins” and to keep jargon out. "Short note. Friday before 3," someone said.
Naive prompt (what not to do): “Summarize the following.”
Improved grounded prompt with delimiters + acceptance criteria:
System: Use only the provided context. If details are missing, say "Not in context." User: Context: """ Teachers around here are really pressed for time—like, meetings all week, grading at night, the whole deal. The pilot last spring showed 12% better assignment completion when reminders were sent Fridays before 3pm, but apparently the note has to be short (nobody reads long emails). Also, we tried Wednesday and it flopped; folks said it got buried. The principal wants next steps focused on “quick wins” and to keep jargon out. "Short note. Friday before 3," someone said. """ Task: Summarize for busy teachers. Constraints: - 5 bullets, ≤15 words each. - Use only the Context; extractive tone. - Include one short direct quote if present. - Finish with a one-line “Takeaway”. Output format: - 5 bullets + "Takeaway: ..."
Expected output (example):
Teachers are time-pressed with meetings and evening grading.
Friday pre-3pm reminders improved completion by 12% in the pilot.
Messages must be short; long emails are ignored.
Wednesday reminders underperformed; messages got buried.
Principal wants quick wins and plain language, “no jargon.”
Takeaway: Send short reminders Friday before 3pm for quick, measurable wins.
💡 Insight: Notice how the bullets use numbers and quotes from the source. That’s extractive grounding.
A context window is the model’s reading buffer. It can only “see” a limited number of tokens (chunks of words and punctuation) at once. If your prompt plus the model’s in-progress answer exceed that limit, earlier text gets dropped or the model refuses. The fix is to shorten or compress inputs, or work in stages: compress → ask.
You don’t need exact token math as a beginner. Just assume space is scarce. Prefer relevant passages, summaries, and outlines. Keep Context concise and Constraints strict.
A support agent needs to answer from the knowledge base, not guess. They wrap the relevant article in """ and demand JSON: {"answer": "...","quote":"..."} with a refusal rule. A student wants a citation-faithful summary of a paper; they ask for bullets with line quotes. In both cases, grounding turns mushy answers into auditable ones.
Scenario | Sectioning to Use | Output Shape |
Summaries for an audience | Context / Task / Constraints | Bullets with limits |
Q&A from a doc | Context / Question / Constraints | JSON with quote |
Notes compression | Context / Task | Outline per section |
Decision memo | Context / Task / Criteria | Headings + numbered points |
Keep it boring and predictable. Predictability beats cleverness.
Grounded “Summarize for X” (most common):
System: Be strictly grounded. If not in Context, say "Not in context." User: Context: """ {{PASTE_SOURCE}} """ Task: Summarize for {{AUDIENCE}}. Constraints: - {{N}} bullets, ≤ {{MAX_WORDS}} words each. - Extractive phrasing; include concrete numbers/quotes. - No outside knowledge. Output format: Bulleted list only.
Grounded “Answer with citation”:
System: Use only the Context. Refuse to guess. User: Context: """ {{PASTE_SOURCE}} """ Question: {{YOUR_QUESTION}} Constraints: - Provide 1–2 sentence answer. - Include the supporting quote. Output format: Answer: <text> Quote: "<exact sentence>"
Grounding is the craft of telling the model what to read and how to use it. The context window is just the model’s short-term memory; only what you put there counts. Delimiters keep your Context apart from your Task, and acceptance criteria define success so the model can hit the target. When accuracy and traceability matter, don’t rely on the model’s latent knowledge—bring the text, box it, and rule it.
You’ve seen how a vague “Summarize this” turns into a dependable, audience-aware output once we add structure and constraints. The trade-off is a little extra setup and occasional compression when texts are long, but the payoff is consistency and trust. Common pitfalls—blended sections, ignored context, overflow—are solved with stronger sectioning, refusal rules, and staged compression.
Next steps:
Take one of your real documents and run the Grounded Summary scaffold; compare to your usual prompt.
Try the Grounded Q&A scaffold with a question you care about; check the quote.
Build a small “prompt library” with your favorite Constraints for two audiences you serve often.
You now have a simple, repeatable method to keep the model anchored. Keep the ingredients on the counter, and it will cook exactly what you asked for.
Follow guided learning paths from beginner to advanced. Master prompt engineering step by step.
Explore PathsReady to Master More? Explore our comprehensive guides and take your prompt engineering skills to the next level.