Retrieval without Restraint: Why Language Models Break Rules They Remember
Abstract
Prompt-level instructions are the main way users give language models preferences, safety boundaries, and content rules. Yet a model can remember a constraint and still violate it during generation, revealing a gap between constraint retrieval and enforcement. Across five model families and model scales from 0.5B to 32B parameters, we find that models can avoid prohibited content by choosing alternative generation trajectories, but prompting does not reliably override prohibited continuations when they become locally preferred. Mechanistic analyses show that constraint information remains accessible at the prohibited-token decision, while the rule can enhance the prohibited token's logit or suppress it without changing the argmax. Source-specific mid-layer patching improves compliance more with constraint-bearing activations than with an unrelated source, even when the source rule contains no banned words. These results support a routing-failure account: accessible constraint information does not reliably translate into effective control of token selection. Explicit string-level banning eliminates the tested shellfish keyword violations, but the resulting recommendations can still violate the underlying allergy rule. Reliable enforcement therefore requires both control of prohibited surface forms and verification of the generated content.