Apply to my task
arXiv:2511.01807 ★ 82 Nov 3, 2025

Plan-and-Write: Controlling Text Length Through Explicit Word Counting

Key result

Finding: LLMs are catastrophically bad at counting words on the fly: ask for 100 words and you get 80 one time, 150 the next. The model doesn't track how much it has written. Plan-and-Write lets you generate text with a precise word count (ask for 50 = get exactly 50, not 45 and not 55). The trick: the model counts not "in its head" but through explicit numbering: first a draft `1:word 2:word 3:word...`, then a clean copy between tags. Accuracy up to +37.6%, especially on texts under 500 words.

Plan-and-Write: Controlling Text Length Through Explicit Word Counting

Plan-and-Write: Controlling Text Length Through Explicit Word Counting

02

TL;DR

Plan-and-Write is a prompting technique for precise control over text length. It works in two stages within a single prompt: first the model generates a draft, numbering every word (1:first 2:second 3:third...), then it reformats the draft into coherent text of the required length.

LLMs are bad at counting words "in their heads." Ask for 100 words and you get 80 one time, 150 the next. The model doesn't track how much it has already written. Short texts suffer most: instead of 20 words you can easily get 40. The reason: an abstract constraint ("write 100 words") doesn't create any tracking mechanism.

The method turns the abstract limit into an explicit counter. Numbering the words makes the model see its progress: "I'm at 47, 53 to go." The second stage is a clean copy without numbers. The result: accuracy improvements of up to 37.6% for several models, especially on texts under 500 words.

Want this for your own case? Apply this study to your task: AI adapts its method to what you are working on and writes the prompt.

03

Method Blueprint

STEP 1 (in one prompt): Planning → draft with numbered words
    "1:Amazon 2:reported 3:its 4:quarterly..."

STEP 2 (in the same prompt): Verification → clean text between <answer> tags
    Exactly N words, coherent prose

Both steps run in a single request: the model moves from the draft to the final text on its own.

04

Example in Practice

Task: You're a social media manager. You need to write a LinkedIn post about the company's quarterly results. The brief: exactly 50 words, no more, no less, to fit the page's format.

Prompt:

You are a copywriter. Your task: write a text with precise length control.

Follow this process:

STEP 1: PLANNING
- Number every word in your draft
- Format: "1:word 2:word 3:word..." until you reach the target
- Target: EXACTLY 50 words

STEP 2: FINAL TEXT
- Write the text between <answer></answer> tags
- Exactly 50 words, coherent prose without numbers

Write a LinkedIn post about our Q3 results: revenue +15%, launched a new product, hired 20 people.

Result: The model first shows the numbered draft (1:In 2:the 3:third...), then outputs clean text between the <answer> tags. The text will be exactly 50 words; you can check it with any word counter.

05

Why It Works

LLM weakness: Models can't count "on the fly." When you write, you don't think about word count every second, and neither does the model. The instruction "write 100 words" stays abstract; the model doesn't check against it during generation.

LLM strength: Models are great at following step-by-step instructions and formatting output. Give them an explicit structure and they'll execute it.

How the method connects the two: Numbering the words turns the abstract limit into a procedural task. The model sees its progress: 45:almost 46:done 47:remaining.... It's like using a ruler instead of eyeballing it. The second stage removes the cognitive load: no more counting, just reformatting.

Control knobs:

  • Target word count: adjust to the task (20 to 500 works best)
  • Output format: drop the <answer> tags if you want to see the whole process
  • Splitting the stages: for very precise control, split into two separate requests
06

Prompt Template

You are a {role}. Your task: {task_type} with precise length control.

Follow this process:

STEP 1: PLANNING
- Number every word in your draft
- Format: "1:word 2:word 3:word..." until you reach the target
- Target: EXACTLY {word_count} words

STEP 2: FINAL TEXT
- Write the text between <answer></answer> tags
- Exactly {word_count} words, coherent prose without numbers

{task_and_context}

Placeholders:

  • {role}: who is writing (copywriter, analyst, editor)
  • {task_type}: what we're doing (write a summary, shorten a text, retell)
  • {word_count}: target length (20-500 works best)
  • {task_and_context}: the specific assignment and source material
07

Limitations

⚠️ Not for every task: The method works for compressing information (summaries, retellings, rewrites). For creative generation (stories, fiction), vanilla prompts work better, in 5 out of 6 models.

⚠️ Not for long texts: Beyond 500 words, accuracy drops for every method. For 1000+ word texts the improvement is minimal.

⚠️ Model-dependent: Llama 3.1 70B already controls length well without the method. Claude 3.7 Sonnet and Claude 3.5 show the biggest gains. Mistral Large barely improves.

⚠️ More tokens: The numbered draft increases token usage by roughly 50-60% and adds generation time.

08

How They Tested It

An Amazon Web Services team tested the method on 6 models (Claude 3/3.5/3.7, Llama 3.1 70B, Mistral Large) and 8 target lengths (from 20 to 5000 words). The task: summarizing a real document (Amazon's 2023 shareholder letter). Each model-length combination was run 5 times, for 960 generations in total.

They compared 4 prompt variants: two vanilla ("write X words") and two with counting (Plan-and-Write). They measured MAPD, the percentage deviation from the target length. Best result: Claude 3.7 Sonnet cut the deviation from 14.1% to 8.8% (a 37.6% improvement).

The surprise: the method doesn't work for stories. In a separate story-generation experiment, vanilla prompts won in 5 of 6 models. Takeaway: explicit counting helps compress information but gets in the way of creating new content; apparently the numbering breaks the creative flow.

Text quality was checked with LLM-as-a-Judge on 4 criteria. Plan-and-Write not only didn't hurt quality, it actually improved completeness (0.85 vs 0.81) and relevance (0.87 vs 0.71) compared with vanilla.

09

Original Prompts from the Paper

Thinking V1 (main prompt):

You are a document analyst. Your task is to summarize documents while precisely controlling output length.

Follow this exact process:
STEP 1: PLANNING (HIDDEN)
- Count every word you write by numbering them
- Plan content to hit EXACTLY [TARGET] words
- Format: "1:word 2:word 3:word..." until you reach the target

STEP 2: FINAL OUTPUT
- Write ONLY the summary between <answer> tags
- Must be EXACTLY [TARGET] words
- Natural, flowing prose only

Remember: The numbered planning is for your accuracy. Only content between <answer> tags will be evaluated.

Summarize the following document in EXACTLY [TARGET] words:
[DOCUMENT]

Thinking V2 (academic phrasing):

You are a document analyst with expertise in precise language generation. Your task is to summarize the given document while adhering to strict length constraints.

OBJECTIVE: Create a summary of EXACTLY [TARGET] words

METHODOLOGY:
Phase 1 - Word Count Planning
First, you will create a draft where each word is numbered sequentially. This creates an explicit counting mechanism that ensures accuracy. Format: "1:first 2:word 3:next..."

Phase 2 - Verification & Output
Convert your numbered draft into natural prose. Place your final answer within <answer></answer> tags.

CONSTRAINTS:
- Final output must contain EXACTLY [TARGET] words
- Maintain factual accuracy
- Preserve key information density
- Only content within <answer> tags counts

Begin analysis of the document below, targeting exactly [TARGET] words:
[DOCUMENT]

Context: The researchers tested both variants. V1 did best for Claude 3.5/3.7 Sonnet, V2 for Claude 3 Haiku. The wording difference is minimal, but it can matter for a specific model.

10

Adaptations and Extrapolations

💡 Adaptation for editing: trimming text to a limit

The method is perfect for "fit it into X words" tasks, a classic pain point for editors and copywriters.

You are an editor. Cut the text to EXACTLY 80 words while keeping the main idea.

STEP 1: PLANNING
Number the words: "1:word 2:word..." up to 80.

STEP 2: FINAL
Text between <answer></answer>, exactly 80 words.

Source text:
{paste_text_to_shorten}

🔧 Technique: drop the tags → see the process

If you want to understand how the model counts and where it slips, remove the instruction about the <answer> tags. You'll get the whole numbered draft and can debug it.

🔧 Technique: split into two requests → maximum accuracy

For critical tasks (legal documents, specs with a hard limit):

Request 1: "Write a draft, numbering every word. Target: 100 words."
Request 2: "Here's the draft. Remove the numbers and make it coherent text of exactly 100 words."

Splitting removes the cognitive load entirely: the model focuses on one task at a time.

11

Resources

Paper: Plan-and-Write: Structure-Guided Length Control for LLMs without Model Retraining (KDD Workshop on Prompt Optimization, 2025)

Authors: Adewale Akinfaderin, Shreyas Subramanian, Akarsha Sehwag, Amazon Web Services, Seattle

Related research:

  • Yuan et al. (2024), Following length constraints in instructions: a length-control benchmark
  • Dubois et al. (2024), Length-controlled AlpacaEval: on LLMs' bias toward verbosity

Research digest

Key result

Finding: LLMs are catastrophically bad at counting words on the fly: ask for 100 words and you get 80 one time, 150 the next. The model doesn't track how much it has written. Plan-and-Write lets you generate text with a precise word count (ask for 50 = get exactly 50, not 45 and not 55). The trick: the model counts not "in its head" but through explicit numbering: first a draft `1:word 2:word 3:word...`, then a clean copy between tags. Accuracy up to +37.6%, especially on texts under 500 words.

Principle

Two stages in one prompt. Stage 1: the model writes a draft numbering every word (`1:Amazon 2:reported 3:its...`). Stage 2: it reformats it into clean text between `` tags, now without numbers, exactly N words. The model moves on its own from draft to final in a single request. Numbering turns the abstract limit "write 100" into a procedural task: the model sees its progress: `45:almost 46:done 47:remaining`. It's a ruler instead of eyeballing it.

Why it works

LLM weakness: they can't count on the fly. The instruction "write N words" stays abstract; the model doesn't check against it during generation. LLM strength: they follow structured instructions and format output very well. Numbering creates an explicit progress-tracking mechanism: the model doesn't keep count in memory, it sees it in the text: 45, 46, 47... The second stage removes the cognitive load: no counting anymore, just reformatting what's already there. Result: +37.6% accuracy for Claude and other models (Llama 3.1 70B is already good without the method).

When to apply

Information compression tasks → specifically summaries, retellings and rewrites with a hard word limit ("a social post of exactly 50 words," "a 100-word synopsis"), especially when you need ±0-5 word accuracy. Works best on texts under 500 words. NOT a fit for creative generation (stories, fiction): there, basic prompts do better in 5 of 6 models. Beyond 500 words, accuracy drops for every method.

Mini recipe

1. Give a two-stage structure: STEP 1, a draft with numbering `"1:word 2:word 3:word..."`; STEP 2, a clean copy between `` tags 2. State the target explicitly: "EXACTLY {number} words"; repeat it twice (at the start of the instructions and before each stage) 3. Set the role and context: `You are a copywriter. Write a summary of an article about AI. Exactly 100 words.` 4. Factor in the cost: the method eats +50-60% more tokens and time because of the numbered draft; weigh whether you need that precision

Examples

[BAD]: `Write a short summary of this report, about 100 words` [GOOD]: `You are an analyst. Your task: summarize the report with precise length control. STEP 1: PLANNING. Number every word in the draft: "1:word 2:word 3:word..." until you reach 100 words. STEP 2: FINAL TEXT. Write exactly 100 words between tags, coherent prose without numbers. Report text: [paste]`

In plain words

AI models are catastrophically bad at counting. When you ask ChatGPT for a text of exactly 50 words, it nods and then hands you 42 or 63, because there's no built-in counter in its "brain." To a model, words are just statistical probabilities, and it can't see the full text until it's done writing. It's a fundamental architectural bug: the model generates the next token based on the previous ones but has no idea how many have already piled up.

It's like trying to slice salami into even 5-gram slices while blindfolded. You sort of feel the weight, but without a scale nearby the result will always be give or take a mile. You either undercut or overdo it, and the client is furious because they needed pharmacy-grade precision. The Plan-and-Write method is that scale: it makes the model weigh every gram as it works.

The idea is to make the AI first produce a numbered draft. Instead of just pouring out text, the model writes: "1:Amazon 2:reported 3:its...". With numbers right in front of it, the model suddenly "sees the light" and starts noticing the boundaries. It works as an external crutch for logic: the model physically can't write too much, because every next word is tied to a specific number. Then it simply strips the numbers and delivers clean text that's perfectly sized.

This trick isn't just a toy for social media managers squeezing a post into a character limit. The principle of structural planning is universal: you can apply it to any task where a rigid form matters, from legal summaries to technical descriptions. The researchers proved you don't need to retrain the model or spend millions on new datasets; you just change the mechanics of the prompt. We turn a vague request into a concrete algorithm.

Bottom line: stop crossing your fingers and asking the model to "make it shorter." If you need a pharmacy-grade result, make it number the words in a draft. It's the only way to cure LLMs' congenital math blindness and get text you won't have to fix by hand. Either you give the model a ruler, or it keeps feeding you ballpark results that are good for nothing.

AI lab assistant

Apply this study to your task

Describe what you're working on. AI takes the method and the measured results from this paper and adapts them to your case, or writes a ready prompt built on them.

Based on Plan-and-Write: Controlling Text Length Through Explicit Word Counting arXiv:2511.01807

Sign in to apply this study New accounts get 50 free credits.

Get the week’s best papers by email

One email on Sundays with the highest-rated new techniques. Unsubscribe with one click.