{"course":{"slug":"ai-at-work","title":"AI at Work","url":"https://addaly.com/learn/ai-at-work","level":"beginner","track":"work"},"lesson":{"slug":"templates-merge-and-the-two-hundred-letters","title":"Two hundred letters, and only one generated paragraph","url":"https://addaly.com/learn/ai-at-work/templates-merge-and-the-two-hundred-letters","position":43,"of":73,"minutes":8,"answer":"Fixed human-written text plus mechanical merge fields plus at most one generated sentence turns two hundred documents to check into one document checked once and two hundred short paragraphs you can sample: with every outlier.","keyIdea":"Fixed human-written text plus mechanical merge fields plus at most one generated sentence turns two hundred documents to check into one document checked once and two hundred short paragraphs you can sample: with every outlier read and a search for unfilled placeholders run over the whole batch."},"body":{"format":"markdown","text":"## The job that looks like a hundred jobs\n\nTwo hundred renewal letters. Forty appraisal summaries. Sixty invoices with a covering note. Ninety school reports.\n\nThe tempting instruction is: write all two hundred. The result is two hundred documents to check, which is two hundred opportunities for a wrong figure to leave the building, and about as much work as writing them.\n\nThere is a much better architecture, and it is mostly forty-year-old technology.\n\n## Three layers, and only one is generated\n\n**Layer one: the fixed text.** The parts that are identical in every letter: the terms, the legal wording, the explanation of the process, the contact details. Written once, by a person, checked once, by a person. This is usually 70 to 90 per cent of the document.\n\n**Layer two: the merge fields.** Name, address, amount, date, account number. These come from your data, mechanically, with no model involved. A merge field is exact or it is empty; it does not approximate.\n\n**Layer three: at most one generated paragraph.** The part that depends on this recipient's situation: the sentence about why their premium changed, the comment on the pupil's progress, the note about their particular usage.\n\nNow count the checking. The risky legal text is identical across all two hundred and was checked once. The figures came from data and can be validated by arithmetic. What is left to read is two hundred short paragraphs, and you can sample them intelligently rather than reading every one.\n\n> Figure: Two hundred letters, three layers. Layers, top to bottom: Fixed text, written once and checked once (Terms, legal wording, the explanation of the process, contact details. Usually 70 to 90 per cent of the document, and the risky part.); Merge fields, mechanical, no model involved (Name, address, amount, date, account number. A merge field is exact or it is empty. It does not approximate.); At most one generated paragraph (The sentence that genuinely depends on this recipient. Twenty-five words, from named fields only, and the word BLANK when a field is missing so you can catch it.). Now count the checking: one document read properly, figures validated by arithmetic, and two hundred short paragraphs you sample rather than read: every outlier, twenty of the ordinary middle, and one search of the whole batch for unfilled placeholders.\n\n## Do not ask it to vary the wording\n\nSomebody always suggests: \"vary the phrasing so they don't look templated.\"\n\nResist it, for two reasons. It is the mechanism by which a factual difference creeps in between letters that were supposed to say the same thing, and when two recipients compare, which they do, you are explaining why one was told something slightly different. It is also mildly deceptive: the letters *are* templated, everybody knows it, and disguising it buys nothing.\n\nVariation should come from **the data**, because the data is what actually differs between recipients.\n\n## Checking a batch properly\n\nYou cannot read two hundred and you should not read twenty at random. Split it:\n\n- **Check every outlier.** Every record with an unusual field value: a negative amount, a zero, a very long name, a missing middle field, an address in a different country, a date outside the expected range. These are where merges break and where generated sentences go strange.\n- **Sample the ordinary middle.** Twenty is plenty if the outliers are all covered.\n- **Run a mechanical validation over the whole set** before anything prints. Search the output for `<`, `>`, `NOT FOUND`, `{{`, double spaces, and the word \"None\". A leftover `Dear <FirstName>` in one of two hundred letters is the classic, and it is entirely preventable by one search.\n\nAlso check the count. Two hundred records in, two hundred documents out. If it is 198, find the two before the post goes.\n\n## The free tools are the right tools\n\nMail merge is free, everywhere, and more reliable than anything generated:\n\n- **LibreOffice Writer** does full mail merge from a spreadsheet or database, to print, PDF or email, on any operating system.\n- **Microsoft Word** does the same if you have it.\n- A twenty-line **Python** script with a template string does it for anyone comfortable with that, and gives you the validation step for free.\n- For PDFs, **LibreOffice** exports directly, and `qpdf` merges and splits the results.\n\nThe model's job is to help you write layer one well, once, and to generate layer three, briefed tightly:\n\n> Write one sentence, maximum 25 words, explaining the change in this customer's premium, using only these fields: previous_premium, new_premium, main_reason_code. If main_reason_code is blank, write NOTHING and output the word BLANK so I can catch it. Do not speculate about causes.\n\nThat is a narrow, checkable task with an explicit failure signal. It is also the only part of two hundred letters that needed a model at all.\n\n## Where the batch goes afterwards\n\nOne last step people skip. Two hundred generated documents are two hundred records, and in most trades that means they have to be filed, retained for a period and findable if somebody complains about theirs.\n\nSo save the batch with the data that produced it: the spreadsheet of merge fields, the template version, the date, and the exact brief used for the generated paragraph. Six months later, when one recipient asks why their letter said what it said, that folder answers in thirty seconds. Without it you are regenerating from a model that may since have changed, which does not reproduce the original and is not an answer.\n\nExport to PDF rather than leaving the batch as editable documents, keep the source data alongside, and if your sector has a retention period, put the deletion date in the folder name."},"check":{"question":"Why is \"vary the wording between letters so they don't look templated\" a bad instruction, on grounds beyond taste?","options":[{"text":"It increases token cost across two hundred generations without improving the recipient's experience.","correct":false,"tempting":"Objects on price, when the cost is trivial and the real damage is to the content rather than the budget."},{"text":"Regenerated wording is where a factual difference creeps in between letters meant to say the same thing, which surfaces when two recipients compare and you must explain why they were told different things.","correct":true},{"text":"Varied wording defeats the mechanical validation search for unfilled placeholders.","correct":false,"tempting":"Names a check that still works (searching for angle brackets is unaffected by phrasing) rather than the risk that varying the text changes what it says."},{"text":"Recipients prefer a consistent house style, so variation damages the brand.","correct":false,"tempting":"Reduces a correctness problem to a presentation preference, which is exactly the framing that lets the instruction survive review."}]},"prev":{"slug":"pdfs-forms-and-the-stack-on-your-desk","title":"PDFs, scans and the black rectangle that hides nothing","url":"https://addaly.com/learn/ai-at-work/pdfs-forms-and-the-stack-on-your-desk"},"next":{"slug":"the-ai-checkbox-in-software-you-already-pay-for","title":"The AI feature that arrived in an update","url":"https://addaly.com/learn/ai-at-work/the-ai-checkbox-in-software-you-already-pay-for"},"authorship":"Founder and series editor: Dr Mustafa Mun. Written by AI models to a written standard. Source and assessment review continues. Academic review invited.","review":{"status":"Draft, open for academic review"},"cite":"Addaly (2026) 'Two hundred letters, and only one generated paragraph', in AI at Work. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/ai-at-work/templates-merge-and-the-two-hundred-letters (Accessed: 29 November 2026).","licence":{"name":"CC BY-NC-SA 4.0","url":"https://creativecommons.org/licenses/by-nc-sa/4.0/"},"reader":{"schema":1,"title":"Two hundred letters, and only one generated paragraph","courseTitle":"AI at Work","module":{"index":5,"slug":"the-tools-on-your-desk","title":"The tools already on your desk"},"answer":null,"keyIdea":"Fixed human-written text plus mechanical merge fields plus at most one generated sentence turns two hundred documents to check into one document checked once and two hundred short paragraphs you can sample: with every outlier read and a search for unfilled placeholders run over the whole batch.","hero":{"kind":"figure","figure":{"t":"figure","label":"Figure","figure":{"caption":"Now count the checking: one document read properly, figures validated by arithmetic, and two hundred short paragraphs you sample rather than read: every outlier, twenty of the ordinary middle, and one search of the whole batch for unfilled placeholders.","layers":[{"label":"Fixed text, written once and checked once","detail":"Terms, legal wording, the explanation of the process, contact details. Usually 70 to 90 per cent of the document, and the risky part."},{"label":"Merge fields, mechanical, no model involved","detail":"Name, address, amount, date, account number. A merge field is exact or it is empty. It does not approximate."},{"label":"At most one generated paragraph","detail":"The sentence that genuinely depends on this recipient. Twenty-five words, from named fields only, and the word BLANK when a field is missing so you can catch it."}],"title":"Two hundred letters, three layers","type":"stack"},"alt":"Figure: Two hundred letters, three layers. Layers, top to bottom: Fixed text, written once and checked once (Terms, legal wording, the explanation of the process, contact details. Usually 70 to 90 per cent of the document, and the risky part.); Merge fields, mechanical, no model involved (Name, address, amount, date, account number. A merge field is exact or it is empty. It does not approximate.); At most one generated paragraph (The sentence that genuinely depends on this recipient. Twenty-five words, from named fields only, and the word BLANK when a field is missing so you can catch it.). Now count the checking: one document read properly, figures validated by arithmetic, and two hundred short paragraphs you sample rather than read: every outlier, twenty of the ordinary middle, and one search of the whole batch for unfilled placeholders."}},"blocks":[{"t":"h2","id":"the-job-that-looks-like-a-hundred-jobs","runs":[{"text":"The job that looks like a hundred jobs"}]},{"t":"p","runs":[{"text":"Two hundred renewal letters. Forty appraisal summaries. Sixty invoices with a covering note. Ninety school reports."}]},{"t":"p","runs":[{"text":"The tempting instruction is: write all two hundred. The result is two hundred documents to check, which is two hundred opportunities for a wrong figure to leave the building, and about as much work as writing them."}]},{"t":"p","runs":[{"text":"There is a much better architecture, and it is mostly forty-year-old technology."}]},{"t":"h2","id":"three-layers-and-only-one-is-generated","runs":[{"text":"Three layers, and only one is generated"}]},{"t":"p","runs":[{"text":"Layer one: the fixed text.","b":true},{"text":" The parts that are identical in every letter: the terms, the legal wording, the explanation of the process, the contact details. Written once, by a person, checked once, by a person. This is usually 70 to 90 per cent of the document."}]},{"t":"p","runs":[{"text":"Layer two: the merge fields.","b":true},{"text":" Name, address, amount, date, account number. These come from your data, mechanically, with no model involved. A merge field is exact or it is empty; it does not approximate."}]},{"t":"p","runs":[{"text":"Layer three: at most one generated paragraph.","b":true},{"text":" The part that depends on this recipient’s situation: the sentence about why their premium changed, the comment on the pupil’s progress, the note about their particular usage."}]},{"t":"p","runs":[{"text":"Now count the checking. The risky legal text is identical across all two hundred and was checked once. The figures came from data and can be validated by arithmetic. What is left to read is two hundred short paragraphs, and you can sample them intelligently rather than reading every one."}]},{"t":"h2","id":"do-not-ask-it-to-vary-the-wording","runs":[{"text":"Do not ask it to vary the wording"}]},{"t":"p","runs":[{"text":"Somebody always suggests: “vary the phrasing so they don’t look templated.”"}]},{"t":"p","runs":[{"text":"Resist it, for two reasons. It is the mechanism by which a factual difference creeps in between letters that were supposed to say the same thing, and when two recipients compare, which they do, you are explaining why one was told something slightly different. It is also mildly deceptive: the letters "},{"text":"are","i":true},{"text":" templated, everybody knows it, and disguising it buys nothing."}]},{"t":"p","runs":[{"text":"Variation should come from "},{"text":"the data","b":true},{"text":", because the data is what actually differs between recipients."}]},{"t":"h2","id":"checking-a-batch-properly","runs":[{"text":"Checking a batch properly"}]},{"t":"p","runs":[{"text":"You cannot read two hundred and you should not read twenty at random. Split it:"}]},{"t":"ul","items":[[{"text":"Check every outlier.","b":true},{"text":" Every record with an unusual field value: a negative amount, a zero, a very long name, a missing middle field, an address in a different country, a date outside the expected range. These are where merges break and where generated sentences go strange."}],[{"text":"Sample the ordinary middle.","b":true},{"text":" Twenty is plenty if the outliers are all covered."}],[{"text":"Run a mechanical validation over the whole set","b":true},{"text":" before anything prints. Search the output for "},{"text":"<","code":true},{"text":", "},{"text":">","code":true},{"text":", "},{"text":"NOT FOUND","code":true},{"text":", "},{"text":"{{","code":true},{"text":", double spaces, and the word “None”. A leftover "},{"text":"Dear <FirstName>","code":true},{"text":" in one of two hundred letters is the classic, and it is entirely preventable by one search."}]]},{"t":"p","runs":[{"text":"Also check the count. Two hundred records in, two hundred documents out. If it is 198, find the two before the post goes."}]},{"t":"h2","id":"the-free-tools-are-the-right-tools","runs":[{"text":"The free tools are the right tools"}]},{"t":"p","runs":[{"text":"Mail merge is free, everywhere, and more reliable than anything generated:"}]},{"t":"ul","items":[[{"text":"LibreOffice Writer","b":true},{"text":" does full mail merge from a spreadsheet or database, to print, PDF or email, on any operating system."}],[{"text":"Microsoft Word","b":true},{"text":" does the same if you have it."}],[{"text":"A twenty-line "},{"text":"Python","b":true},{"text":" script with a template string does it for anyone comfortable with that, and gives you the validation step for free."}],[{"text":"For PDFs, "},{"text":"LibreOffice","b":true},{"text":" exports directly, and "},{"text":"qpdf","code":true},{"text":" merges and splits the results."}]]},{"t":"p","runs":[{"text":"The model’s job is to help you write layer one well, once, and to generate layer three, briefed tightly:"}]},{"t":"quote","runs":[{"text":"Write one sentence, maximum 25 words, explaining the change in this customer’s premium, using only these fields: previous_premium, new_premium, main_reason_code. If main_reason_code is blank, write NOTHING and output the word BLANK so I can catch it. Do not speculate about causes."}]},{"t":"p","runs":[{"text":"That is a narrow, checkable task with an explicit failure signal. It is also the only part of two hundred letters that needed a model at all."}]},{"t":"h2","id":"where-the-batch-goes-afterwards","runs":[{"text":"Where the batch goes afterwards"}]},{"t":"p","runs":[{"text":"One last step people skip. Two hundred generated documents are two hundred records, and in most trades that means they have to be filed, retained for a period and findable if somebody complains about theirs."}]},{"t":"p","runs":[{"text":"So save the batch with the data that produced it: the spreadsheet of merge fields, the template version, the date, and the exact brief used for the generated paragraph. Six months later, when one recipient asks why their letter said what it said, that folder answers in thirty seconds. Without it you are regenerating from a model that may since have changed, which does not reproduce the original and is not an answer."}]},{"t":"p","runs":[{"text":"Export to PDF rather than leaving the batch as editable documents, keep the source data alongside, and if your sector has a retention period, put the deletion date in the folder name."}]}],"check":{"question":[{"text":"Why is “vary the wording between letters so they don’t look templated” a bad instruction, on grounds beyond taste?"}],"options":[{"text":[{"text":"It increases token cost across two hundred generations without improving the recipient’s experience."}],"correct":false,"tempting":[{"text":"Objects on price, when the cost is trivial and the real damage is to the content rather than the budget."}]},{"text":[{"text":"Regenerated wording is where a factual difference creeps in between letters meant to say the same thing, which surfaces when two recipients compare and you must explain why they were told different things."}],"correct":true,"tempting":null},{"text":[{"text":"Varied wording defeats the mechanical validation search for unfilled placeholders."}],"correct":false,"tempting":[{"text":"Names a check that still works (searching for angle brackets is unaffected by phrasing) rather than the risk that varying the text changes what it says."}]},{"text":[{"text":"Recipients prefer a consistent house style, so variation damages the brand."}],"correct":false,"tempting":[{"text":"Reduces a correctness problem to a presentation preference, which is exactly the framing that lets the instruction survive review."}]}],"order":[0,3,1,2],"why":null},"prev":{"slug":"pdfs-forms-and-the-stack-on-your-desk","title":"PDFs, scans and the black rectangle that hides nothing","minutes":9},"next":{"slug":"the-ai-checkbox-in-software-you-already-pay-for","title":"The AI feature that arrived in an update","minutes":9}}}