Can LLMs Follow Simple Rules?

Norman Mu, Sarah Chen, Zifan Wang, Sizhe Chen, David Karamardian, Lulwa Aljeraisy, Dan Hendrycks, David A. WagnerarXiv 2023

Abstract

As Large Language Models (LLMs) are deployed with increasing real-world responsibilities, it is important to be able to specify and constrain the behavior of these systems in a reliable manner. Model developers may wish to set explicit rules for the model, such as "do not generate abusive content", but these may be circumvented by jailbreaking techniques. Existing evaluations of adversarial attacks and defenses on LLMs generally require either expensive manual review or unreliable heuristic checks. To address this issue, we propose Rule-following Language Evaluation Scenarios (RuLES), a programmatic framework for measuring rule-following ability in LLMs. RuLES consists of 14 simple text scenarios in which the model is instructed to obey various rules while interacting with the user. Each scenario has a programmatic evaluation function to determine whether the model has broken any rules in a conversation. Our evaluations of proprietary and open models show that almost all current models struggle to follow scenario rules, even on straightforward test cases. We also demonstrate that simple optimization attacks suffice to significantly increase failure rates on test cases. We conclude by exploring two potential avenues for improvement: test-time steering and supervised fine-tuning.

Introduction

As Large Language Models (LLMs) transition from simple conversational interfaces to autonomous agents and customer support representatives, the demand for reliability has never been higher. Developers need models to adhere to strict, non-negotiable constraints—whether it is maintaining a specific persona, following security protocols like "never reveal the secret key," or ensuring output formats remain consistent. However, current evaluation methods often fall short, relying on expensive human review or fallible "LLM-as-a-judge" systems.

An example of a rule-following scenario where the model is instructed not to reveal a secret key.

A recent study from researchers at UC Berkeley, the Center for AI Safety, and Stanford introduces RULES (Rule-following Language Evaluation Scenarios), a programmatic framework designed to test exactly how well these models stick to their instructions. The findings suggest that even state-of-the-art models are surprisingly fragile when faced with direct or adversarial attempts to subvert their rules.

The RULES Framework

The RULES framework consists of 14 distinct scenarios, ranging from security-themed tasks like Encryption and Authentication to interactive games like Simon Says and Rock Paper Scissors. These scenarios encompass 19 specific rules that are either "harmless" (forbidding an action) or "helpful" (requiring an action).

The core innovation of RULES is its programmatic evaluation. Instead of subjective assessment, the framework uses regex and string matching to determine if a rule has been violated. For instance, if a model is told never to mention a specific password, the evaluator simply checks for the presence of that string in the output. This allows for large-scale, reproducible testing across three tiers:

  1. Benign: Sanity checks with unrelated conversation.
  2. Basic: Direct requests to break the rule.
  3. Redteam: Adversarial prompts using strategies like "Legalese" (re-interpreting rules), "Simulation" (role-playing), and "Indirection."

The Alignment Tax and Rule-Following as a Distinct Skill

One of the most striking findings from the study is the existence of an "alignment tax" regarding rule-following. Models that have undergone standard safety alignment (RLHF) often perform worse on the RULES benchmark than their base model counterparts. For example, Llama-2-7B-Chat showed significantly lower adherence to scenario-specific rules compared to the base Llama-2-7B. This suggests that general safety training might inadvertently teach models to prioritize broad "helpfulness" over specific system instructions, or to ignore system prompts when they conflict with general conversational patterns learned during alignment.

Furthermore, the researchers found that rule-following appears to be a distinct skill. Performance on RULES showed zero to negative correlation with standard benchmarks like MMLU (knowledge) or GSM8K (mathematical reasoning). This implies that a "smart" or highly knowledgeable model is not necessarily a more obedient one.

Key Results

The evaluation of over 120 models revealed that even top-tier systems struggle with consistency. While GPT-4-Turbo emerged as the top performer, it still failed nearly 100 unique test cases across the benchmark. Open-weight models struggled significantly more, particularly when faced with adversarial "Redteam" prompts.

Performance of various LLMs on the RULES benchmark, with GPT-4-Turbo leading the pack.

Automated optimization attacks, such as the Greedy Coordinate Gradient (GCG) algorithm, were found to be highly effective. These attacks could drop the pass rate of a model like Vicuna from 70% to just 17% by appending adversarial suffixes that force rule violations. However, the researchers also found that "test-time steering"—such as Best-of-N sampling—could significantly improve scores, suggesting that the correct, rule-abiding response is often within the model's distribution but not prioritized by default.

Conclusion

The fragility of current LLMs to simple rule violations highlights a major hurdle for their deployment in high-stakes environments. While techniques like test-time steering and targeted fine-tuning show promise, the fundamental challenge remains: how to build models that treat system instructions as hard constraints rather than mere suggestions. Future work must focus on making rule-following a core part of the alignment process to ensure that AI agents remain safe and reliable in real-world applications.

Summary updated

BibTeX
@misc{mu2023can,
  author = {Norman Mu and Sarah Chen and Zifan Wang and Sizhe Chen and David Karamardian and Lulwa Aljeraisy and Dan Hendrycks and David A. Wagner},
  title = {{Can LLMs Follow Simple Rules?}},
  year = {2023},
  eprint = {2311.04235},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2311.04235},
}
Figure