Overthinking the Truth: Understanding how Language Models Process False Demonstrations

Danny Halawi, Jean-Stanislas Denain, Jacob Steinhardt
7/18/2023
cs.LGcs.AIcs.CL

Official code: dannyallover/overthinking_the_truth (29 stars, last commit 2024-04-30).

Abstract

Modern language models can imitate complex patterns through few-shot learning, enabling them to complete challenging tasks without fine-tuning. However, imitation can also lead models to reproduce inaccuracies or harmful content if present in the context. We study harmful imitation through the lens of a model's internal representations, and identify two related phenomena: "overthinking" and "false induction heads". The first phenomenon, overthinking, appears when we decode predictions from intermediate layers, given correct vs. incorrect few-shot demonstrations. At early layers, both demonstrations induce similar model behavior, but the behavior diverges sharply at some "critical layer", after which the accuracy given incorrect demonstrations progressively decreases. The second phenomenon, false induction heads, are a possible mechanistic cause of overthinking: these are heads in late layers that attend to and copy false information from previous demonstrations, and whose ablation reduces overthinking. Beyond scientific understanding, our results suggest that studying intermediate model computations could be a promising avenue for understanding and guarding against harmful model behaviors.

View on arXivView PDF

Code Implementations(1)

295Shell, PythonJul 14, 20232 years ago

Similar Papers

Cite this paper

@article{halawi2023overthinking,
  title  = {Overthinking the Truth: Understanding how Language Models Process False Demonstrations},
  author = {Danny Halawi and Jean-Stanislas Denain and Jacob Steinhardt},
  year   = {2023},
  eprint = {2307.09476},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2307.09476v3},
  journal = {ICLR 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2307.09476.svg)](https://codeofpaper.com/paper/2307.09476)

Discussion