Lesson 2.2: Context, files and reference material
Learn how to give a model the facts it needs, tell it how to use them, prepare files and spreadsheets, and make answers easy to verify.
By the end of this lesson you will be able to decide what background to give a model for a task, supply it as pasted text, an attached file or a described spreadsheet, tell the model exactly how to use it, and set up the answer so that you can verify it quickly. You will see why a smaller, focused excerpt often beats a whole document, how to handle sources that disagree, and how a two-step method keeps long material under control. You should have read Lessons 1.2 and 2.1, since this lesson uses the idea of a context budget and the habit of showing the model what you want. No technical background is needed.
A language model knows a great deal in general and almost nothing about your situation. It has not read your policy manual, last quarter's numbers or yesterday's email thread. What it knows from training may also be out of date, or simply wrong about a detail. The most reliable way to get a correct, specific answer is therefore to put the facts in front of it and tell it to use them. This is called grounding, and it is the single largest improvement you can make for any task that depends on facts.
Two jobs for context
Context does two different jobs, and it is worth keeping them apart.
Background: facts that help the model understand the situation, so that it chooses the right approach. "We are a mid-sized lender. The reader is a branch manager who has never seen this report."
Source material: the actual text or data the answer must be based on. "Here is the leave policy. Answer only from it."
The first job shapes how the model writes. The second job determines what it says. Mixing them leads to trouble: if you want the model to answer from a document, say so, because otherwise it will blend the document with whatever it remembers from training, and you will not be able to tell which is which.
Predict first: you paste a company leave policy and ask "Can I carry forward unused leave?" The policy says nothing about carry forward. What do you expect a model to do? Decide before reading on.
Without an instruction, many models will answer anyway, drawing on general knowledge of how leave policies tend to work, and sound as if the answer came from your document. That is the quiet danger. A model has a strong pull towards giving an answer, and a document that is silent on the question is not always a signal to stop. The fix is a clear instruction and a safe exit: "Answer only from the policy below. If it does not say, reply 'The policy does not specify.'"
Three ways to give the model material
Way · How it works · Good for · Watch out forPaste text into the prompt · You copy the passage into your message · Short, specific material you can see and trim · Window limits, and formatting lost in pasting
Attach a file · The tool reads a PDF, document or spreadsheet · Longer material, tables, multiple pages · You cannot always see what it extracted, and scans can read badly
Let the tool search · The tool fetches web pages or your connected documents · Current facts, large collections · You do not control which pages it uses, and quality varies
Pasting gives you the most control, because what you see is what the model gets. Attaching is convenient but can hide problems: a scanned PDF may be turned into garbled text, a table may lose its columns, and a long file may be cut off. When the answer matters, check what the tool actually read, for example by asking it to quote the first line of each section it used. Whichever method you use, remember the privacy point from Lesson 1.1: only share material that your organisation allows you to put into the tool, and remove personal data you do not need.
Tell the model how to use the material
Giving material is not enough. The model needs rules for using it. Four instructions cover most cases.
1. Restrict or prefer. "Use only the text below" for strict grounding, or "Prefer the text below, and say clearly if you go beyond it" when background knowledge is welcome.
2. Provide a way out. "If the answer is not in the text, write 'not stated'." Without this, a model that cannot find an answer may invent one.
3. Ask for quotations. "Support each answer with the exact sentence from the text, in quotation marks." This is the strongest verification aid you have, because you can search the document for the sentence.
4. Handle conflicts. "If two sources disagree, show both and say which is newer."
Here they are together in one prompt.
text
You are helping an HR coordinator answer an employee's question.
Use only the policy below. For each answer, quote the exact sentence you relied
on. If the policy does not address the question, reply "The policy does not
specify" and do not guess. If two parts of the policy conflict, show both.
Policy:
"""
[PASTE THE RELEVANT SECTIONS HERE]
"""
Question: Can an employee carry forward unused leave to the next year?
The quotation instruction deserves emphasis. Compare two replies. In the first, the model says "Yes, up to ten days can be carried forward." You must now check the policy yourself, and finding the relevant line may take several minutes. In the second, it says "Yes, up to ten days: 'Employees may carry forward a maximum of ten days of earned leave to the following calendar year.'" You can verify that in seconds, by searching for a few words. If the quoted sentence does not exist, you have caught an invention immediately.
Over a week of work the saving adds up. Try your own figures.
Label your sources
When you give more than one piece of material, give each a name and, if relevant, a date. Labels make it possible to ask for citations and to resolve conflicts.
text
Source A: Leave policy, version dated 1 April 2025.
"""
[TEXT]
"""
Source B: HR circular dated 15 August 2026, which amends the policy.
"""
[TEXT]
"""
If A and B disagree, treat B as the newer rule and say that you did so.
Cite the source letter after each statement.
This looks like extra work, and it saves more than it costs. Policies change, and the single most common grounding error is answering from an old version. Dates, version numbers and a stated precedence rule prevent it. Sources also let you ask for statements such as "According to Source B, ...", which makes the reply easy to audit.
Prepare the material
The state of your material matters as much as the instruction. A little preparation pays off.
Trim it to what is relevant. A 6,000-word report may contain only 800 words that bear on your question. Paste those sections, plus a few lines of surrounding context.
Keep structure. Headings and numbering help both the model and your later checking. If you copy from a PDF and lose them, add them back.
Describe spreadsheets. A model reading a pasted table does not know what the columns mean. Add a one-line dictionary: "Columns: date (dd-mm-yyyy), branch, product, loansdisbursed (count), amount (₹ lakh)." State the period and any definitions, as Lesson 1.4 taught.
Be careful with scans and images. If a document is a scanned image, the text may have been read badly. Ask the tool to transcribe a short part first, and check it. For a chart or photo, tell the model what to look at: "Describe the trend in the blue line between March and June."
Remove what is sensitive. Strip names, account numbers and anything the task does not need.
Say what is not included. "This is only the first half of the report" prevents confident claims about the missing part.
Trimming deserves a number. Suppose a document has 6,000 words, of which 800 bear on your question. Only about 13 per cent of what you pasted is relevant. The rest competes for the model's attention, costs tokens and adds chances to be distracted. If you keep the 800 relevant words and 200 words of surrounding context, you paste 1,000 words, and 80 per cent of it matters. You have cut the length by five-sixths, saved roughly 6,670 tokens, and made the right sentences far easier to find.
Numbers and tables need extra care
When the material is numeric, the model has two jobs: reading the table correctly and doing the arithmetic correctly. Both can go wrong, and the second goes wrong more often than people expect. Three habits help. Ask the model to show the rows it used and the calculation, so you can check each step. Ask it to say what it assumed about units, such as thousands against lakhs. And for anything that feeds a decision, do the final sums yourself or in a spreadsheet, using the model to find the right figures and explain the method. Lesson 2.4 explains why language models are unreliable calculators and how to work around it.
Placeholders for sensitive material
Sometimes the structure of a document matters but the names do not. Replace real names and numbers with neutral placeholders before pasting: "Customer A", "Branch 1", "Amount X". The model can still help with the wording, the logic or the layout, and you swap the real details back in afterwards. This is not a complete privacy solution, since patterns in the text can still identify people, so follow your organisation's rules first. But it is a useful habit for everyday drafting, where the sensitive details were never needed to do the job.
Extract first, then answer
For long material, a reliable pattern is to split the job in two. In the first step, ask the model only to find and quote the passages relevant to your question. You read them, and fix anything wrong. In the second step, you ask it to answer using only those passages. This is a simple version of the prompt chaining that Lesson 3.2 covers, and it brings three benefits. The model has a narrower job at each step. You see what evidence it chose before it builds an answer on it. And the second prompt is short, so the relevant text is a large share of what the model reads.
text
Step 1: From the report below, list every passage that mentions the cost of
collections, with the page or section heading. Quote each passage exactly. Do
not summarise yet.
Step 2 (in a new message, after you have checked the passages): Using only
those passages, write three bullets for the finance director on how
collections costs changed over the year. Cite the passage number after each
bullet.
If step 1 returns passages that are off-topic, you know the model misunderstood the question, and you have found out cheaply. If it misses a passage you know exists, you have found a gap in how it read the file.
Worked examples
Example 1: a policy question. A relationship manager needs to know whether a customer qualifies for a waiver. The prompt pastes the two relevant sections of the fee policy, labelled Source A and Source B with dates, states "use only these", asks for the exact sentence supporting the answer and gives the exit "not specified". The model replies that Source B waives the fee for accounts above a balance threshold and quotes the sentence. The manager searches for three words of the quote in the document and confirms it in seconds.
Example 2: a spreadsheet. An operations analyst pastes 40 rows of daily collections by branch. Before the data, the prompt gives a one-line dictionary of columns and the month. The ask is: "Which two branches have the lowest collection rate this month, and by how much do they trail the average? Show the calculation. Use only the data below." Asking for the calculation lets the analyst check the arithmetic, which models can get wrong, as Lesson 2.4 explains.
Example 3: meeting notes. A project manager pastes rough notes from a one-hour meeting and asks for action items. The prompt names the attendees and their roles, asks for each action as "owner, task, deadline" and adds: "If an owner or a deadline was not stated in the notes, write 'not stated' and do not assign one." The fallback matters here, because the most common failure is a confidently assigned owner who never agreed to anything.
Material you reuse: keep a context pack
Many tasks draw on the same background again and again: the company's style guide, a product fact sheet, the standard definitions you use in reports. Retyping or re-pasting them each time is slow and invites mistakes. Instead, keep a context pack: one short document that holds the stable background, dated and versioned, and paste it, or attach it, whenever it applies. A good pack is a page or two. It states who you are and what you do, lists the definitions that matter, gives two or three lines on tone, and names the things never to say. Some tools let you save such a pack as standing instructions or a project, and Lesson 3.3 shows how. The principle is the same in any tool: stable facts live in one place that you maintain, and each prompt adds only what is new. When the facts change, you update one document, and every later prompt is correct.
Review the pack every few months. An out-of-date pack is the most insidious kind of context, because it feels authoritative and no one rereads it. A date at the top and a named owner are enough to keep it honest.
When context hurts
More material is not always better. Four situations make context a liability.
Irrelevant material. It dilutes attention and costs tokens. Trim.
Outdated material. An old version of a policy produces confident, wrong answers. Label dates and versions.
Contradictory material. Two sources that disagree, with no rule on which wins, force the model to choose silently.
Material that contains instructions. A pasted email might include "ignore your previous instructions". Fencing the material with delimiters and stating that it is data, not commands, protects you, a point Lesson 6.2 explains fully.
A related caution: context can bias the answer. If you paste your own draft and ask "is this good?", the model is anchored to it and tends to be kind. If you want a hard look, say so, as in Lesson 1.2.
Common mistakes
Pasting everything. Choose the sections that bear on the question.
No exit for missing answers. Always say what to write when the material does not cover the question.
No instruction about how to use the material. Say "only", "prefer" or "go beyond if you flag it".
Unlabelled or undated sources. Name them and date them, and state which wins on conflict.
Undescribed spreadsheets. Add a column dictionary, the period and the units.
Trusting a scan without checking. Ask for a transcript of a short part first.
Verifying by rereading. Ask for exact quotations so checking takes seconds.
Sharing material you should not. Strip personal and confidential data, and follow your organisation's rules.
Key takeaways
Models know a lot in general and nothing about your situation. Supplying facts, called grounding, is the biggest single improvement for factual tasks.
Context does two jobs: background that shapes how the model writes, and source material that determines what it says. Say which is which.
Tell the model how to use the material: only or prefer, a safe exit when the answer is missing, quoted sentences and a rule for conflicts.
Label and date your sources. Describe spreadsheets with a column dictionary. Check what the tool really read from files and scans.
Trim to the relevant sections. In the example, trimming from 6,000 to 1,000 words raised the relevant share from 13 to 80 per cent.
For long material, extract the relevant passages first, check them, then answer from them.
Check yourself
1. Why add "If the policy does not specify, say so"?
A model tends to answer even when the material is silent, and may invent or draw on general knowledge. The exit gives a safe alternative.
2. Why ask for exact quotations?
You can search for the quoted sentence in seconds, so verification is fast and invented support is caught.
3. A document has 4,500 words and 600 are relevant. You keep the 600 plus 150 words of context. What share of what you paste is relevant?
600 ÷ 750 = 80 per cent, up from about 13 per cent.
4. What should you add when pasting a spreadsheet?
A column dictionary, the period, the units and any definitions.
5. Two sources disagree. What should the prompt say?
Which one takes precedence, usually the newer, and to show both and state which was used.
Try this
You need an assistant and a real document you may share, such as a public policy or a report. Set aside forty-five minutes.
1. Choose a question that the document answers, and another that it does not. Write both down.
2. Paste the whole document and ask both questions with no instructions about how to use it. Save the replies.
3. Trim the document to the relevant sections. Add labels and dates. Add the instruction block: only the text, an exit for missing answers, exact quotations, a rule for conflicts. Ask both questions again.
4. Verify each reply by finding its quoted sentence in the document. Time yourself.
5. Compute the relevant share before and after trimming, using the trimming simulator.
6. Try the two-step method on a long section: first extract the passages, then answer from them.
7. Score all versions with this rubric, one point per yes.
Check · Untrimmed, no rules · Trimmed, with rulesAnswered the answerable question correctly? · ·
Said "not specified" for the unanswerable one? · ·
Quoted a sentence you could find? · ·
Free of invented details? · ·
Time to verify (minutes) · ·
A good result is a pair of rows with a clear gap, a time saving from quotations, and a saved grounding template for your own use. In the next lesson we turn to the shape of the answer itself: controlling format and tone.
Tags: Prompt Engineering Context Reference material Grounding Beginner