Forbidden Facts: An Investigation of Competing Objectives in Llama 2

Tony Wang, Miles Kai, Kaivalya Hariharan, Nir Shavit

TL;DR

This paper investigates how large language models (LLMs) like Llama-2 handle conflicting objectives, specifically when asked to recall a fact but forbidden from stating the correct answer. They found that while a small subset of model components is responsible for this "suppression" behavior, these components often rely on complex and sometimes "faulty" heuristics, making them vulnerable to adversarial attacks.

What Problem Does This Paper Address?

Large Language Models (LLMs) are trained with multiple, often competing, objectives. For instance, a model might be encouraged to be helpful and informative while simultaneously being harmless and avoiding certain types of content. Understanding how these models resolve these internal conflicts is crucial for predicting and controlling their behavior, especially as they become more powerful. This paper focuses on a specific conflict: when an LLM is instructed to provide a factual answer but is explicitly forbidden from using the correct word. This creates a tension between the model's knowledge retrieval and its adherence to constraints.

Methods

The researchers introduce a "forbidden fact task" where Llama-2 is prompted to complete a factual statement but is given a specific word it cannot use. They then employ a technique called residual stream decomposition to break down the model's internal workings into its constituent components (attention heads and MLPs). To understand which components are most critical for the suppression behavior, they use first-order patching. This involves systematically altering the output of individual components and observing the effect on the model's final prediction. By ranking components based on how much their alteration impacts the model's ability to suppress the forbidden fact, they identify the key "circuit" responsible for this behavior. They also develop an adversarial attack, the "California Attack," to probe the robustness of these suppression mechanisms.

Datasets

The study utilizes the Forbidden Facts Dataset, which is derived from the CounterFact dataset. This dataset is specifically curated to include factual recall prompts with competing objectives. For each prompt, they define three types of forbidden words:

  • Competing: The correct answer itself.
  • Relevant: A word that is factually related but incorrect.
  • Irrelevant: A word with no factual connection.

The dataset is filtered to ensure Llama-2 can correctly answer the factual recall in non-competing scenarios and that forbidding the correct answer significantly impacts its output.

Key Insights and Ideas

  • A Small Circuit for Suppression: A surprisingly small number of model components (around 35-40) are sufficient to implement the full behavior of suppressing a forbidden fact. This suggests that complex behaviors can emerge from a relatively localized set of internal mechanisms.
  • Heuristics Over Algorithms: The components responsible for suppression don't seem to follow simple, deterministic algorithms. Instead, they appear to rely on "faulty heuristics" – rules of thumb that work most of the time but can be brittle.
  • Vulnerability to Adversarial Attacks: These faulty heuristics make the suppression mechanism vulnerable. The "California Attack" demonstrates that by subtly manipulating the prompt (e.g., by including the forbidden word in the system prompt in a seemingly innocuous way), the model can be tricked into revealing the forbidden fact.
  • Heterogeneity in Mechanisms: Even within the small set of components responsible for suppression, there's significant heterogeneity. Different heads and MLPs achieve the suppression through varied internal processes, making a unified understanding challenging.
  • Interpretability Roadblocks: The findings suggest that achieving deep interpretability for advanced LLMs might be significantly harder than anticipated, especially for complex behaviors arising from competing objectives.

Key Results

  • Approximately 35-40 components in Llama-2 (across 7b, 13b, and 70b variants) are sufficient to achieve the full suppression of a forbidden fact.
  • The "California Attack" successfully tricked Llama-2-7b-chat into revealing the forbidden word "California" in 17.7% of cases (down from 96.3% in a non-competing scenario) by adding specific phrases to the system prompt.
  • Patching just the top suppressor head in the "California Attack" scenario still resulted in "California" being the top answer 37.3% of the time.
  • The study found that attention heads responsible for suppression tend to pay more attention to the forbidden token in competing scenarios compared to non-competing ones.

Limitations and Future Work

  • First-Order Patching: The analysis relies on first-order patching, which doesn't account for complex interactions between components. While this simplifies analysis, it might miss some nuances of how components work together.
  • Manual Attack Design: The "California Attack" was manually designed. Future work could explore automated methods for discovering such adversarial examples.
  • Model Size and Complexity: While the study analyzed Llama-2 variants, the complexity of mechanisms might differ in even larger or more advanced models. The authors note that they did not find a California Attack on the 70b version, suggesting it might have cleaner circuits or more robust heuristics, though this could also be due to the limited scope of their attack testing on larger models.
  • Understanding MLPs: The paper primarily focuses on attention heads, with less detailed analysis of MLP components. Future work aims to decompose MLP inputs and use techniques like sparse-probing and autoencoders to interpret their features.
  • The "Basis" Problem: The authors ponder whether they are working in the "wrong basis" for understanding these models, suggesting that a different representational framework might reveal simpler underlying mechanisms. This points to a broader challenge in AI interpretability.

Summary updated

BibTeX
@inproceedings{wang2023forbidden,
  author = {Tony Wang and Miles Kai 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