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.
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.
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."
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.
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."
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.
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.
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