Skip to content

Articles

Perspectives on prompting, architecture, and building things that work — from the Jerry Framework team.

Structured Negation in LLM Constraint Enforcement

Does "NEVER do X" work better than "Always do Y"? PROJ-014 spent six research phases and a controlled A/B test finding out. The short answer: it depends entirely on how you write the NEVER.

The core finding: NPT-013 structured negation -- a constraint format that pairs a prohibition with its consequence and a constructive alternative -- achieves 100% compliance across all tested conditions. Positive-only framing achieves 92.2%. The difference is statistically significant (McNemar exact p=0.016, n=270 matched pairs across three Claude models).

The format that works:

NEVER {action} -- Consequence: {cascading impact}. Instead: {actionable alternative}.

The format that does not:

Don't do X.

Standalone blunt prohibitions -- "NEVER do X" with nothing else -- are the worst formulation available. Worse than positive-only framing, worse than any structured alternative. Peer-reviewed evidence from AAAI 2026 and EMNLP 2024 is unambiguous on this. When you add consequence documentation and a constructive alternative, the picture reverses: structured negation never underperforms positive-only framing and demonstrably prevents violations on the constraint types where compliance is hardest.

This article covers what the research found, the taxonomy it produced, and how to apply the findings.

Why Structured Prompting Works

Alright, this trips up everybody, so don't feel singled out. What I'm about to walk you through applies to every major LLM on the market. Claude, GPT, Gemini, Llama, whatever ships next Tuesday. This isn't a Jerry thing. It's a "how these models actually work under the hood" thing.

Your instinct was right. Asking an LLM to apply industry frameworks to a repo is a reasonable ask. The gap isn't in what you asked for. It's in how much you told it about what good looks like.

Think of it like big-mountain skiing. Shane McConkey, if you don't know him, was a legendary freeskier who'd show up to competitions in costume and still take the whole thing seriously enough to win. The guy looked completely unhinged on the mountain. He wasn't. Every wild thing he did was backed by obsessive preparation. The performance was the surface. The preparation was the foundation.

Same applies here. Three levels of prompting, three levels of output quality.