Apply to my task
arXiv:2512.17920 ★ 92 Dec 2, 2025

The U-Curve of Constraint Compliance: Why Medium-Length Prompts Are the Worst Option

Key result

The paradox: Medium-length prompts (~27 words) are the worst option for constraint compliance. Models follow limits great with extremely short prompts ("Explain X in 35 words") and with full ones (~135 words with examples), but fall apart in the middle. 70 of 72 experiments (97%) showed a U-shaped curve. The finding helps you get better compliance with length constraints (tested only on a 35-word limit; character and structure limits are our extrapolation) by choosing the right prompt length. The paper's explanation (a hypothesis) is a conflict between RLHF signals. At medium length a zone of uncertainty appears: the model sees enough context to trigger the reflex "give a helpful, detailed answer," but not enough to realize the constraint is critical. The "helpfulness" signal overpowers the "follow the limit" signal — the model writes more than the 35 words asked for. With a short or full prompt the signal becomes unambiguous again — compliance scores of about 8/10 (vs 6.5/10 in the middle).

01

TL;DR

Models are worst at following constraints with medium-length prompts (~27 words of context). The CDCT study found a U-shaped curve: models follow a fixed "exactly 35 words" limit best with extremely short prompts (~2 words of context) and with full prompts (~135 words with examples and context), and do worst in the middle. 70 of 72 experiments (97%) showed this pattern, and the three judge models agreed almost perfectly on the compliance scores (κ = 0.90).

The paper's explanation (a hypothesis backed by one ablation, not a proven mechanism) is a signal conflict from RLHF training. Models were taught to be "helpful" and give detailed answers. With a short prompt ("Explain X in Y words") it's unambiguous — give a brief answer. With a full prompt (examples, context, explicit instructions) it's also unambiguous — follow every instruction. But at medium length a zone of uncertainty appears: is there enough context? Maybe I should give more information to be "helpful"? The model picks helpfulness over the constraint — and writes a longer answer than the 35 words asked for.

An experimental check supported this: when phrases encouraging "comprehensive," "detailed" and "helpful" answers were removed from the system prompts in the medium-length setting, constraint compliance rose by 598% on average (median 525%), and 71 of 72 tests improved. 79% of trials (57 of 72) then achieved perfect compliance. Semantic accuracy (whether the content is correct) was not significantly correlated with constraint compliance (r=0.19, p=0.08) — a model can know the answer and still break the format.

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.

02

Why It Works

LLMs are trained on conflicting goals. (The paper offers this explanation as a hypothesis; the step-by-step reasoning below is our reading of it.) RLHF training teaches models to be "helpful" — to give detailed, exhaustive answers. At the same time, models are taught to follow instructions. Most of the time these goals line up. But when you give a constraint (say, "exactly 35 words"), a contradiction arises: helpfulness wants more words, the instruction wants fewer.

Short prompts are unambiguous. "Explain recursion in 35 words" — no context, no examples, just the constraint. The model sees one clear signal: brevity. The "helpfulness" signal doesn't fire because the request itself is minimalist. Context and constraint are aligned.

Full prompts are unambiguous too. 135+ words with detailed context, examples and explicit instructions ("exactly 35 words, no more") create signal redundancy. The constraint is repeated explicitly and implicitly through the structure of the request. The model sees: the person spent 135 words writing this — so every requirement matters. Explicitness overpowers the RLHF heuristics.

Medium prompts are ambiguous. ~27 words of context is neither here nor there. Enough words to establish the topic and trigger the RLHF reflex "give a full answer," but not enough to make the importance of the constraint explicit. The model sees the topic (say, "Impressionism") and thinks: "this is a complex topic, I should explain it in detail" — the RLHF signal wins. The constraint drowns in the "helpfulness" noise.

Reasoning models are more robust. O3, GPT-5 and O4-Mini showed 27.5% better constraint compliance than the six "efficient" models (the paper ties this figure to the medium length; averaged over all lengths the scores were 8.2 vs 7.3 out of 10). A plausible reason is that they reason explicitly before answering, which adds an extra checking step: "what exactly is required?" The efficient group (including Claude Sonnet 4, Claude Opus 4.1 and Gemini 2.5 Flash) dipped lower at medium length, to about 6/10.

Control knobs (the paper advises avoiding the 20-35 word range, stating constraints explicitly and redundantly, and preferring reasoning models; the specific wordings below are our suggestions and were not tested):

  • Prompt length: If you set a constraint, go to the extremes. Either ultra-short (the paper suggests under ~10 words) or full (over ~60 words: context, examples, explicit statement of the requirement).

  • How explicit the constraint is: In full prompts, repeat the constraint several times in different wordings ("exactly 35 words," "no more than 35," "strictly 35") and highlight it structurally (caps, indentation).

  • Removing helpfulness signals: If the constraint is critical, add to the prompt: "Don't aim for a complete description. The priority is staying within the limit, not being informative." This is our user-side analogue of the paper's ablation (which removed helpfulness wording from the system prompt); its effect was not measured.

  • Choice of model: For tasks with hard constraints (formats, limits, structures), use reasoning models (tested in the paper: O3, GPT-5, O4-Mini) — they ignored the constraint less often. The efficient models scored lower on constraints, especially at medium prompt length.

03

Example

Our illustration — the paper tested only a 35-word limit on explanations of 8 concepts, not character limits or marketing copy.

Task: You're making cards for an Instagram account about startups. Each card explains a business term. The designer set a limit: exactly 280 characters (two lines in the layout). The model keeps producing 400-500 characters, breaking the layout.

❌ A medium-length prompt (the problem zone):

Explain the term "unit economics" for a card on an Instagram account about startups. 
The audience is first-time founders. Keep it simple and clear.
Limit: exactly 280 characters.

Result: The model sees "first-time founders" → the RLHF signal "be helpful, explain in detail" fires → it is likely to run long, e.g. 450 characters with examples.

✅ An ultra-short prompt (works):

Unit economics. 280 characters. Startup account.

Result: No context → no RLHF triggers → the model sees mainly the constraint → it should land much closer to 280 characters.

✅ A full prompt (works):

Card for the Instagram account @startup_cards

TERM: Unit economics

AUDIENCE: First-time founders, pre-seed entrepreneurs

CARD FORMAT:
- Headline: the term
- Body: the explanation
- BODY LIMIT: **exactly 280 characters** (two lines of 140×2 in the Figma layout)

THE CONSTRAINT IS CRITICAL: The design system doesn't support line wrapping. 
More than 280 characters = the card breaks visually.

Do **NOT** add examples if they don't fit in 280.  
Do **NOT** aim for completeness — the priority is staying within the limit.

Explain "unit economics" in **strictly 280 characters**.

Result: Signal redundancy + explicitly canceling RLHF helpfulness + repeating the constraint → the model sticks to the limit.

What to expect:
The output should be much closer to 280 characters, but not guaranteed to be exact (the paper's best settings scored about 8/10 on compliance, not 10/10). If you need perfect precision, add: "First output a draft, then cut it to exactly 280 and show the character count."

04

Prompt Template

Option 1: Ultra-short (for simple tasks)

{term/concept}. {number} words/characters. {context in one word}.

Example: "Blockchain. 50 words. For grandma."


Option 2: Full (for complex tasks or critical constraints)

TASK: {task description}

CONTEXT: {target audience, format, goal}

CONSTRAINT: **{number} words/characters**  
⚠️ This is critical: {why compliance matters}

PRIORITIES:
1. Staying within the limit — above everything
2. {second priority}
3. {third priority}

Do **NOT** aim for completeness or detail.  
Do **NOT** add examples if they don't fit.

Complete the task in **strictly {number} words/characters**.

What to fill in: - {task description} — the specific goal (a card, a post, a product description) - {target audience} — who reads it - {number} — the exact limit - {why it matters} — the technical reason (layout, API limit, platform format) - {priorities} — what matters more: accuracy, simplicity, completeness

⚠️ Avoid medium-length prompts (~20-35 words) with constraints. The paper suggests either very short (under ~10 words) or detailed (over ~60 words), with the requirement stated explicitly.

05

Limitations

⚠️ Word count only: The study only tested one constraint — "exactly 35 words" — on 8 factual concepts, scored by LLM judges rather than humans. Other types of constraints (JSON format, element order, style) may behave differently — the U-curve isn't guaranteed.

⚠️ Not perfect at the extremes either: Even at the right prompt length, models aren't perfect. Ultra-short and full prompts got an average compliance score of about 8/10 from the judges (8.1 and 8.0), not 10/10. For absolute precision you need a post-processor (a truncation script) or an iterative approach ("generate → check the length → adjust").

⚠️ Reasoning models cost more: O3, GPT-5 and O4-Mini follow constraints better (+27.5%), but they're slower and pricier. For bulk generation (hundreds of cards) it may be cheaper to use efficient models with full prompts — our suggestion; the paper did not test whether that closes the gap.

⚠️ It's not about understanding: The study found that semantic accuracy (whether the content is correct) was not significantly correlated with constraint compliance (r=0.19, p=0.08). A model can know the answer perfectly and still break the format. The paper's explanation is how RLHF signals get prioritized, not missing knowledge. Don't think "the model doesn't understand the task" — think "the constraint signal isn't strong enough."

06

How They Tested It

An independent researcher from San Francisco tested 9 top models (O3, GPT-5, O4-Mini, GPT-4.5, Claude Sonnet 4, Claude Opus 4.1, Gemini 2.5 Flash, Llama, DeepSeek) on 8 concepts from different fields — from logic (modus ponens) to art (Impressionism). For each concept they created 5 versions of the prompt — from extremely compressed (~2 words) through ~13, ~27 and ~69 words to full (~135 words with examples); the shorter versions were rewritten by GPT-5.1. In every version the constraint was the same: explain it in exactly 35 words.

Why exactly 5 compression levels? The logic, as we read it: if models just "do badly with short prompts," we'd see linear degradation. But if there's a conflict zone, we'd see a dip at a specific length. And that's what was confirmed.

Scoring by an LLM jury. Three judge models (Claude Opus 4.1-2, GPT-5.1, DeepSeek-v3.1) independently scored each answer on two scales: constraint compliance (CC) and semantic accuracy (SA). Why three judges? To remove the bias of any single model. The result: judge agreement on CC was κ=0.90 (near-perfect), on SA κ=0.25 (low). That's a finding in itself: constraint compliance is an objective metric that doesn't depend on interpretation. Semantics is subjective.

The key finding: 70 of 72 experiments (97.2%) showed a U-shaped curve. Models did great at the edges (2 words and 135 words of context) but failed at ~27 words. Average CC score at the extremes: 8.1/10 and 8.0/10. In the middle: 6.5/10. These are judge scores on a 0-10 scale, not the share of answers that broke the limit.

Why does the paper call it universal? The pattern showed up across all model families — from reasoning (O3) to efficient (Gemini Flash) — in 70 of 72 experiments (the two exceptions aren't identified). Reasoning models showed 27.5% better compliance (p<0.001) and smaller dips in the middle, while efficient models dropped to about 6/10. The author reads this as a property of RLHF training rather than of one architecture — an interpretation, not something the study isolated.

Testing the cause experimentally. The author reran all 72 tests at the medium length (~27 words), removing phrases that encouraged "comprehensive," "helpful" and "detailed" answers from the system prompts and keeping the "exactly 35 words" constraint. The result: constraint compliance rose by 598% on average (median 525%), 71 of 72 tests improved, and 79% of tests (57 of 72) reached perfect compliance. This supports the view that the problem isn't "lack of understanding" or missing knowledge. The problem is that the RLHF signal "be helpful" outweighs the instruction at medium prompt length.

The surprise: Formal sciences (logic, math) showed almost no change in SA when context was added (delta -0.01). In other words, for explaining recursion or a derivative, extra context didn't help — models know this out of the box. Applied fields (philosophy, art, psychology) showed a delta of +0.14 — context helped them more. That suggests how much context helps the content differs by domain (only 2-3 concepts per domain were tested), while the U-curve of constraint compliance showed up across domains.

07

Adaptations and Extrapolations

🔧 Technique: Explicitly suppressing RLHF signals

If the constraint is critical (an API format, a platform limit, a legal template), add this at the start of the prompt:

MODE: Format compliance
⚠️ Do NOT optimize the answer for "helpfulness" or "informativeness"
⚠️ Priority: following the constraints exactly, not completeness of content

This explicitly cancels the RLHF heuristic "more information = better." The study saw a 598% average improvement from removing helpfulness wording from the system prompt; this is our attempt at a similar effect through a user instruction when you can't edit the system prompt. The paper did not test adding such an instruction.


🔧 Technique: Two-step generation for perfect precision

If you need absolute precision (exactly N words, no more, no less):

Step 1: Write a draft answer on the topic "{topic}". 
Don't worry about the constraint yet — just explain the concept.

Step 2: Now cut the draft down to **exactly {N} words**.  
Output three versions:
- Version A: exactly {N} words, priority — accuracy
- Version B: exactly {N} words, priority — simple language  
- Version C: exactly {N} words, priority — memorability

Show a word count for each version in the format [N words].

Why it works: Separating the phases removes the cognitive conflict. In step 1 the model "thinks about meaning" without RLHF pressure to fit the format. In step 2 the task becomes pure optimization — the model already has the material and just needs to trim it to the limit. Three versions give you room to choose — you can pick the best fit.


🔧 Technique: Anchoring with examples (few-shot for constraints)

For complex formats (not just word count but structure + limits), give 2-3 examples that make compliance explicit:

TASK: Describe a startup as an elevator pitch

FORMAT: 
- Problem: 1 sentence, max 15 words
- Solution: 1 sentence, max 15 words  
- Market: 1 sentence, max 10 words

✅ CORRECT EXAMPLE:
Problem: Small businesses lose 30% of revenue to inefficient logistics. [9 words]  
Solution: We automate delivery routes with AI, saving time and money. [10 words]
Market: 2M SMBs in the US, a $4B market. [9 words]

❌ INCORRECT EXAMPLE (breaks the limits):  
Problem: Small and medium-sized businesses across the US struggle with inefficient logistics, which leads to losing a significant share of revenue because of delays and extra costs. [26 words — over the limit!]

Now describe the startup "{name}":

Few-shot examples create a reference point. The model sees not an abstract rule ("max 15 words") but a concrete sample of correct and incorrect execution. That strengthens the constraint signal, especially in the "danger zone" of medium prompt length.


🔧 Combining with Chain-of-Thought for reasoning models

Reasoning models (in the paper: O3, GPT-5, O4-Mini) showed 27.5% better constraint compliance. Our untested suggestion: amplify the effect with explicit CoT for checking:

{your task with a constraint}

Before the final answer:
1. Draft the answer in your head
2. Check: is the {N}-word constraint met?
3. If not, adjust it
4. Output the final version tagged [{N} words]

The mechanics: Reasoning models generate "hidden thoughts" before answering. An explicit instruction to include a constraint check in the chain of reasoning makes constraint compliance part of the thinking process rather than post-processing. That shifts the focus from the RLHF autopilot to a deliberate check.

08

Resources

  • Separating Constraint Compliance from Semantic Accuracy: A Novel Benchmark for Evaluating Instruction-Following Under Compression — the original study, December 2025
  • Compression-Decay Comprehension Test (CDCT) — a benchmark for evaluating constraint compliance under compression
  • Author: Rahul Baxi, independent researcher, San Francisco
  • Related work: LLMLingua (Jiang et al., 2023) — prompt compression methods; FollowBench and IFEval — instruction-following benchmarks
  • Methodology: three judge models (Claude Opus 4.1-2, GPT-5.1, DeepSeek-v3.1) with κ=0.90 agreement on constraint compliance

Research digest

Key result

The paradox: Medium-length prompts (~27 words) are the worst option for constraint compliance. Models follow limits great with extremely short prompts ("Explain X in 35 words") and with full ones (~135 words with examples), but fall apart in the middle. 70 of 72 experiments (97%) showed a U-shaped curve. The finding helps you get better compliance with length constraints (tested only on a 35-word limit; character and structure limits are our extrapolation) by choosing the right prompt length. The paper's explanation (a hypothesis) is a conflict between RLHF signals. At medium length a zone of uncertainty appears: the model sees enough context to trigger the reflex "give a helpful, detailed answer," but not enough to realize the constraint is critical. The "helpfulness" signal overpowers the "follow the limit" signal — the model writes more than the 35 words asked for. With a short or full prompt the signal becomes unambiguous again — compliance scores of about 8/10 (vs 6.5/10 in the middle).

Principle

Short prompt (~2 words in the study; the paper suggests under ~10) — just the constraint, no context. "Recursion. 35 words." The model sees one clear signal: brevity. The RLHF reflex "be helpful" doesn't fire — there's nothing to be "helpful" about in a minimalist request. Medium prompt (20-35 words) — a bit of context + the constraint. "Explain recursion for beginner programmers in simple language. Limit: 35 words." The model sees "for beginners" → thinks "I need to explain in detail" → the RLHF autopilot overpowers the constraint. This is the zone of maximum violations. Full prompt (~135 words in the study; the paper suggests over ~60) — in the paper: full context, examples and explicit formatting instructions. Repeating the constraint in different wordings and adding an override ("Do NOT aim for completeness") are our additions. The paper's hypothesis: explicit, repeated constraint statements make the requirement stand out.

Why it works

RLHF training teaches models two conflicting goals: be "helpful" (detailed answers) AND follow instructions. Most of the time they line up. But a constraint like "exactly 35 words" creates a contradiction. The key insight: a medium prompt length activates both signals at once, but neither strongly enough. The context says "this is an important topic, explain it well" (RLHF), the constraint says "be brief" (instruction). The paper's hypothesis: in this zone the model is unsure which to prioritize, and the RLHF "be helpful" pattern tends to win. Experimental confirmation: removing phrases encouraging "comprehensive," "detailed" and "helpful" answers from the system prompts (at medium length) improved constraint compliance by 598% on average (median 525%; 71 of 72 tests improved). Wild — 79% of trials reached perfect compliance just by removing the "helpfulness" triggers. Reasoning models (O3, GPT-5, O4-Mini) scored 27.5% higher on compliance — possibly because they reason before answering, which adds a checking step: "what exactly is required?" The efficient models (e.g. Claude Sonnet 4, Gemini 2.5 Flash) dipped lower at medium length. Important: semantic accuracy (whether the content is correct) was not significantly correlated with constraint compliance (r=0.19, p=0.08). A model can know the answer and still break the format — it's not about understanding, it's about how signals get prioritized.

When to apply

Tasks with hard length constraints (the study tested word limits only) → social media cards with character limits, product descriptions that must fit a layout, API requests with constraints → especially when the model keeps ignoring limits and breaking the format. Possibly also for structural constraints (JSON with fixed fields, XML markup, email templates with length limits per block) — our extrapolation; the paper didn't test these. NOT suitable for tasks where completeness matters and there are no hard limits (analytical reports, research texts, explanations of complex concepts where length is secondary).

Mini recipe

1. Diagnose the problem: If the model keeps breaking the constraint, check the prompt length. 20-35 words of context? You've landed in the problem zone. 2. Pick a strategy by how critical it is: - The constraint isn't critical (small misses are fine) → use an ultra-short prompt: `{topic}. {number} words. {context in one word}.` Example: `Blockchain. 50 words. For a high schooler.` - The constraint is critical (layout, API, format) → use a full prompt with signal redundancy 3. Structure a full prompt like this: - TASK block: describe what you need - CONSTRAINT block: highlight it visually (caps, repetition) — `exactly 280 characters`, `strictly 35 words`, `no more than 50` - PRIORITIES block: explicitly state `1. Staying within the limit — above everything` - Cancel the RLHF signal: add `Do NOT aim for completeness. Do NOT add examples if they don't fit.` 4. For reasoning models: If you have a reasoning model (the paper tested O3, GPT-5, O4-Mini), use it for critical constraints (27.5% higher compliance in the study). For bulk generation, compensate for regular models' weakness with full prompts. 5. Add a check: For absolute precision, use a two-step approach: `Generate the text. Check the length. If it's over {limit}, cut it to exactly {limit}. Show the final count.`

Examples

Our illustration, not from the paper (it tested a 35-word limit, not characters). [BAD]: `Write a description of a Python course for an Instagram card. The audience is beginner developers. Make it clear and motivating. Limit: 280 characters.` The problem: a 32-word prompt — right in the problem zone. "Beginner" + "clear and motivating" trigger the RLHF signal "give a detailed, helpful answer." The model is likely to run long and break the layout. --- [GOOD — option 1, ultra-short]: `Python course. 280 characters. For beginners.` Result: No context → no RLHF triggers → the model sees only the constraint → it should land much closer to 280 characters. --- [GOOD — option 2, full]: `TASK: Description for a course card on the Instagram account @dev_courses COURSE: Python Fundamentals for Beginners CARD FORMAT: - Headline: course name - Description: exactly 280 characters (two lines of 140 in the layout) - CTA button THE CONSTRAINT IS CRITICAL: The design system doesn't support text wrapping. More than 280 characters = the card breaks visually and the text gets cut off. PRIORITIES: 1. Staying within 280 characters — above everything 2. Clarity for beginners 3. Motivation to act Do NOT add sample projects if they don't fit. Do NOT try to list every course topic. Priority: fit in 280 characters, not informativeness. Write the description in strictly 280 characters.` Result: Signal redundancy + an explicit RLHF override + the constraint repeated in three places → the model should stick to the limit more closely (not measured for this prompt).

In plain words

In Plain Words: 2512.17920

In Plain Words

Separating Constraint Compliance from Semantic Accuracy: A Novel Benchmark for Evaluating Instruction-Following Under Compression

Models botch instructions not because they're dumb, but because they're torn between two urges: being helpful and being obedient. The CDCT study uncovered a strange anomaly — a U-shaped curve of performance. A model follows constraints best if the prompt is very short or, at the other extreme, spelled out in exhaustive detail. But in the "happy medium" around 27 words, the AI is most likely to blow right past your limits.

It's like asking a teenager to take out the trash. If you just yell "Trash!", they'll go do it. If you give a five-minute lecture on hygiene, the environment and the garbage pickup schedule, they'll probably cave and do it too. But give them a medium-length instruction with a couple of extra details and they'll hear nothing but noise and keep playing video games. In 70 of 72 experiments (97%) the scores followed this pattern: compliance with the limit dropped when the context was "not too much, not too little."

The core problem is that RLHF training (when humans teach the model to answer "well") makes models chatty and thorough. When you ask it to explain photosynthesis in exactly 35 words, a fight breaks out inside the algorithm. Helpfulness yells: "We need to talk about chlorophyll!", while the instruction whispers: "Count the words." On medium-length prompts "helpfulness" wins, and the model dumps a wall of text on you, breaking your layout or limits just because it wants to look smart.

A caveat: the study tested only one kind of limit — "exactly 35 words" when explaining 8 concepts — on 9 models. Whether the same dip shows up for a 280-character post for X or a summary without the letter "A" wasn't tested; the author expects the idea to carry over, but that's a guess. Still, if your prompt with a hard limit looks like an ordinary medium-length sentence, it's worth suspecting that the medium length is part of the problem.

Bottom line: if you need a model to follow the rules strictly, either be as terse as possible or bury it in redundant context and examples. The middle option is the riskiest. Either "Trash!" or a half-hour lecture — otherwise you may get 500 characters where you asked for 200 and end up redoing it all by hand. Models handle Spartan orders and detailed manuals better than something in between.

ArXiv ID: 2512.17920 | Generated: 2026-01-02 17:00 | Nova Research

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 The U-Curve of Constraint Compliance: Why Medium-Length Prompts Are the Worst Option arXiv:2512.17920

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