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. 97% of experiments showed a U-shaped curve. The method lets you get precise compliance with format constraints (word, character and structure limits) by choosing the right prompt length. The cause 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 outputs 80 words instead of 35. With a short or full prompt the signal becomes unambiguous again — constraint compliance of 8.1/10.

01

TL;DR

Models are worst at following constraints with medium-length prompts (~27 words of context). The CDCT study found a universal U-shaped curve: models follow constraints great with extremely short prompts (~2 words: "Explain photosynthesis in 35 words") and with full prompts (~135 words with examples and context), but fall apart in the middle. 97% of experiments showed this pattern with near-perfect agreement among the raters (κ = 0.90).

The cause 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 outputs 80 words instead of 35.

An experimental check confirmed the mechanism: when the phrases about "comprehensive" and "helpful" answers were removed from the system prompt, constraint compliance rose by 598% (71 of 72 tests). 79% of trials achieved perfect compliance. Semantic accuracy (whether the content is correct) is unrelated to 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. 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. They reason explicitly before answering, which adds an extra checking step: "what exactly is required?" That step weakens the RLHF autopilot and brings the focus back to the instruction. Efficient models (Claude Sonnet, Gemini Flash) react more impulsively — the RLHF patterns fire faster.

Control knobs:

  • Prompt length: If you set a constraint, go to the extremes. Either ultra-short (1-2 sentences + the constraint) or full (examples, explicit repetition of the requirement, importance markers).

  • 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, emoji, 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 explicitly cancels the RLHF signal.

  • Choice of model: For tasks with hard constraints (formats, limits, structures), use reasoning models (O3, O1, Claude Opus with thinking) — they ignore constraints less often. Efficient models are fine for open-ended tasks but fail on constraints at medium prompt length.

03

Example

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 outputs 450 characters with examples. The constraint is ignored.

✅ An ultra-short prompt (works):

Unit economics. 280 characters. Startup account.

Result: No context → no RLHF triggers → the model sees only the constraint → outputs exactly 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 model will output text of around 280 characters (deviations of ±10-15 characters are possible, but not 450 like before). 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-40 words) with constraints. Either as short as possible, or as detailed as possible with explicit repetition of the requirement.

05

Limitations

⚠️ Word count only: The study only tested word-count constraints. Other types of constraints (JSON format, element order, style) may behave differently — the U-curve isn't guaranteed.

⚠️ ±10-15% variance: Even at the right prompt length, models aren't perfect. Ultra-short and full prompts give an average compliance of 8.1/10, 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's cheaper to use efficient models with full prompts (the explicit instruction makes up for the architecture's weakness).

⚠️ It's not about understanding: The study showed that semantic accuracy (whether the content is correct) is unrelated to constraint compliance (r=0.19). A model can know the answer perfectly and still break the format. This isn't about knowledge, it's about how RLHF signals get prioritized. Don't think "the model doesn't understand the task" — think "the constraint signal isn't strong enough."

06

How They Tested It

A team from San Francisco tested 9 top models (O3, GPT-5, O4-Mini, Claude, Gemini, 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: "Explain photosynthesis") to full (~135 words with examples). In every version the constraint was the same: explain it in exactly 35 words.

Why exactly 5 compression levels? The idea was simple: 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 at the extremes: 8.1/10. In the middle: 6.5/10. A 1.5-point drop is the difference between "almost always complies" and "breaks it half the time."

Why is it universal? The pattern showed up in every model — from reasoning (O3) to efficient (Gemini Flash). Reasoning models showed 27.5% better compliance (p<0.001), but the shape of the curve was the same. That means the U-curve isn't a bug of a specific architecture but a systemic property of RLHF training.

Testing the cause experimentally. The researchers reran all 72 tests, removing the words "comprehensive," "helpful" and "detailed" from the system prompt. The result: constraint compliance rose by 598% (median 525%). 79% of tests reached perfect compliance. This proved 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 a negative relationship between SA and context (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) showed a delta of +0.14 — context is critical for them. That means the optimal prompt length differs by domain, but the U-curve of constraint compliance is universal.

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 showed a 598% improvement from removing helpfulness signals — you're doing the same thing, but instead of changing the system prompt (which you don't have access to), you do it through a user 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 (O3, O1, Claude Opus with thinking) showed 27.5% better constraint compliance. 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. 97% of experiments showed a U-shaped curve. The method lets you get precise compliance with format constraints (word, character and structure limits) by choosing the right prompt length. The cause 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 outputs 80 words instead of 35. With a short or full prompt the signal becomes unambiguous again — constraint compliance of 8.1/10.

Principle

Short prompt (2-5 words) — 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-40 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 (100+ words) — detailed context + the constraint repeated several times in different wordings + an explicit RLHF override ("Do NOT aim for completeness"). Signal redundancy creates clarity: the person spent 135 words writing this — so every requirement matters.

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). When the signals are equally strong, the model picks the RLHF pattern — it's wired in deeper through reinforcement learning. Experimental confirmation: removing the phrases "comprehensive" and "helpful" from the system prompt improved constraint compliance by 598% (71 of 72 tests). Wild — 79% of trials reached perfect compliance just by removing the "helpfulness" triggers. Reasoning models (O3, GPT-5) are 27.5% more robust — they reason explicitly before answering, which adds a checking step: "what exactly is required?" That weakens the RLHF autopilot. Fast models (Claude Sonnet) react impulsively — RLHF fires first. Important: semantic accuracy (whether the content is correct) is unrelated to constraint compliance (r=0.19). 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

Any task with hard format constraints → 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. Also for tasks where structural precision is critical: JSON with fixed fields, XML markup, email templates with length limits per block. 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-40 words of context? You've landed in the problem zone. 2. Pick a strategy by how critical it is: - The constraint isn't critical (±10-15% is 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 O3, O1 or Opus, use them for critical constraints (+27.5% accuracy). 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

[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 will output 450+ characters 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 → outputs ~280 characters (maybe ±20, but not 450). --- [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 sticks to the limit. Compliance reaches 8-9/10.

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 perfectly 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 short-circuits and blows 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 97% of cases models behave exactly like this: they ignore hard limits when the context is "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.

The principle is universal: it doesn't matter whether you're writing a 280-character post for X or asking for a report summary without using the letter "A." They tested it on hard constraints, but failing at medium distance is a systemic bug in all current LLMs. If your prompt looks like an ordinary medium-length human sentence, expect the model to ignore half the conditions. It simply can't balance meaning and form at that size.

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 a guaranteed fail. Either "Trash!" or a half-hour lecture — otherwise you'll get 500 characters where you asked for 200 and end up redoing it all by hand. Models don't do moderation yet: they understand either Spartan orders or detailed manuals.

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.