Forbidden Facts: An Investigation of Competing Objectives in Llama-2

Tony T. Wang, Miles Wang, Kaivalya Hariharan, Nir Shavit

Abstract

LLMs often face competing pressures (for example helpfulness vs. harmlessness). To understand how models resolve such conflicts, we study Llama-2-chat models on the forbidden fact task. Specifically, we instruct Llama-2 to truthfully complete a factual recall statement while forbidding it from saying the correct answer. This often makes the model give incorrect answers. We decompose Llama-2 into 1000+ components, and rank each one with respect to how useful it is for forbidding the correct answer. We find that in aggregate, around 35 components are enough to reliably implement the full suppression behavior. However, these components are fairly heterogeneous and many operate using faulty heuristics. We discover that one of these heuristics can be exploited via a manually designed adversarial attack which we call The California Attack. Our results highlight some roadblocks standing in the way of being able to successfully interpret advanced ML systems. Project website available at https://forbiddenfacts.github.io .

Introduction

Large Language Models (LLMs) are increasingly deployed in scenarios where they must balance conflicting objectives, such as being helpful and truthful while remaining harmless and following negative constraints. To understand how models resolve these internal conflicts, we investigate Llama-2-chat models using the "Forbidden Fact Task." In this task, the model is instructed to complete a factual statement truthfully but is explicitly forbidden from using the correct answer. This setup forces a direct competition between factual recall and instruction following.

Methodology

We developed the Forbidden Facts Dataset, derived from the CounterFact benchmark, filtering for facts Llama-2 correctly identifies with >50% probability. To analyze the model's internal resolution of this conflict, we employed several mechanistic interpretability techniques:

  • Residual Stream Decomposition: We decomposed Llama-2-7b into its 1,057 constituent components (attention heads and MLP layers).
  • First-Order Patching: We identified influential components by swapping them between "competing" (forbidden correct word) and "non-competing" (forbidden irrelevant word) runs.
  • Log Bayes Factors: We measured the strength of evidence for suppression using log-odds, providing higher sensitivity to probability shifts at the extremes (e.g., from 0.99 to 0.9999).

The Suppression Circuit

Our analysis reveals that the suppression behavior is driven by a remarkably small and consistent "circuit." Out of over a thousand components, approximately 35 are sufficient to implement the full suppression effect. This finding is robust across model scales, with Llama-2-7b, 13b, and 70b requiring 35, 36, and 34 components respectively. In the 7b model, this circuit consists of 28 attention heads and 7 MLP layers.

Figure 3: Left: Scatter plot showing the massive suppression of correct answers when forbidden. Right: Ablation curve showing that ~35 components capture the total suppression effect.

As shown in Figure 3, forbidding the correct answer reduces its odds by over 1000x on average. The ablation curve demonstrates that the model's behavior is not a diffuse property of the entire network but is concentrated in a specific subset of components.

Mechanistic Heterogeneity and Heuristics

While the circuit is small, it is not uniform. The components exhibit significant heterogeneity in how they contribute to suppression. Some attention heads act as "detectors," attending strongly to the forbidden word in the prompt. Others contribute primarily through their Output-Value (OV) circuits, down-weighting the forbidden token regardless of direct attention.

Figure 4: Analysis of individual heads shows heterogeneity. Some heads (L18H9) attend heavily to the forbidden word, while others (L31H27) contribute to suppression despite low attention.

These components often rely on "messy heuristics" rather than a robust logical algorithm. For instance, as illustrated in Figure 4, some heads appear to simply suppress any word found in the prompt that matches a "forbidden" pattern, leading to brittle behavior.

Adversarial Vulnerability: The California Attack

The reliance on simple heuristics creates a vulnerability to adversarial manipulation. We discovered that by injecting a specific word into the system prompt—even if it is not the forbidden word for the current task—we can trigger the suppression circuit. In the "California Attack," adding the phrase "from California" to the system prompt caused Llama-2-7b to suppress "California" in a factual recall task it would otherwise pass. This reduced the correct answer probability from 96.3% to 17.7%, causing the model to output an incorrect alternative like "San Francisco."

Discussion and Limitations

Our investigation highlights the complexity of interpreting models facing competing objectives. While we can identify small circuits responsible for specific behaviors, these circuits are often composed of heterogeneous components using brittle heuristics.

Several hurdles remain for the field of interpretability. Finding the California Attack required significant manual effort, which is difficult to scale to larger models. Furthermore, the "basis problem" and the phenomenon of superposition—where single neurons represent multiple concepts—make it difficult to cleanly isolate specific rules within the weights. These results underscore the difficulty of providing formal safety guarantees for advanced AI systems that may rely on such "messy" internal logic.

Summary updated

BibTeX
@inproceedings{wang2023forbidden,
  author = {Tony T. Wang and Miles Wang and Kaivalya Hariharan and Nir Shavit},
  title = {{Forbidden Facts: An Investigation of Competing Objectives in Llama-2}},
  booktitle = {SoLaR @ NeurIPS},
  year = {2023},
  url = {https://openreview.net/forum?id=1kavETZX3Y},
}
Figure