Lune

NeurIPS2023Top-tier venue

How does GPT-2 compute greater-than?: Interpreting mathematical abilities in a pre-trained language model

Michael Hanna, Ollie Liu, Alexandre Variengien

Abstract

Pre-trained language models can be surprisingly adept at tasks they were not explicitly trained on, but how they implement these capabilities is poorly understood. In this paper, we investigate the basic mathematical abilities often acquired by pre-trained language models. Concretely, we use mechanistic interpretability techniques to explain the (limited) mathematical abilities of GPT-2 small. As a case study, we examine its ability to take in sentences such as "The war lasted from the year 1732 to the year 17", and predict valid two-digit end years (years > 32). We first identify a circuit, a small subset of GPT-2 small's computational graph that computes this task's output. Then, we explain the role of each circuit component, showing that GPT-2 small's final multi-layer perceptrons boost the probability of end years greater than the start year. Finally, we find related tasks that activate our circuit. Our results suggest that GPT-2 small computes greater-than using a complex mechanism that activates across diverse contexts. Now at Conjecture.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

97 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Finding Transformer Circuits With Edge Pruning cites Investigating Gender Bias in Language Models Using Causal Mediation Analysis
  • Finding Transformer Circuits With Edge Pruning cites Towards Best Practices of Activation Patching in Language Models: Metrics and Methods
  • Finding Transformer Circuits With Edge Pruning cites Language Models are Few-Shot Learners
  • LLM Circuit Analyses Are Consistent Across Training and Scale cites Locating and Editing Factual Associations in GPT
  • LLM Circuit Analyses Are Consistent Across Training and Scale cites Towards Best Practices of Activation Patching in Language Models: Metrics and Methods
  • LLM Circuit Analyses Are Consistent Across Training and Scale cites Causal Abstractions of Neural Networks
  • Locating and Editing Factual Associations in GPT cites Investigating Gender Bias in Language Models Using Causal Mediation Analysis
  • Locating and Editing Factual Associations in GPT cites Language Models are Few-Shot Learners
  • Towards Best Practices of Activation Patching in Language Models: Metrics and Methods cites Locating and Editing Factual Associations in GPT
  • Towards Best Practices of Activation Patching in Language Models: Metrics and Methods cites Investigating Gender Bias in Language Models Using Causal Mediation Analysis
  • Towards Best Practices of Activation Patching in Language Models: Metrics and Methods cites Causal Abstractions of Neural Networks
  • Solving Quantitative Reasoning Problems with Language Models cites Language Models are Few-Shot Learners
  • Patchscopes: A Unifying Framework for Inspecting Hidden Representations of Language Models cites Locating and Editing Factual Associations in GPT
  • Patchscopes: A Unifying Framework for Inspecting Hidden Representations of Language Models cites Towards Best Practices of Activation Patching in Language Models: Metrics and Methods
  • Patchscopes: A Unifying Framework for Inspecting Hidden Representations of Language Models cites Causal Abstractions of Neural Networks
  • Unlocking the Capabilities of Thought: A Reasoning Boundary Framework to Quantify and Optimize Chain-of-Thought cites Language Models are Few-Shot Learners
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers97

  1. Towards Best Practices of Activation Patching in Language Models: Metrics and MethodsFred Zhang, Neel NandaICLR 2024 · 233 citations
  2. Patchscopes: A Unifying Framework for Inspecting Hidden Representations of Language ModelsAsma Ghandeharioun, Avi Caciularu, Adam Pearce, Lucas Dixon et al.ICML 2024 · 197 citations
  3. Unlocking the Capabilities of Thought: A Reasoning Boundary Framework to Quantify and Optimize Chain-of-ThoughtQiguang Chen, Libo Qin, Jiaqi Wang, Jingxuan Zhou et al.NeurIPS 2024 · 104 citations
  4. Finding Transformer Circuits With Edge PruningAdithya Bhaskar, Alexander Wettig, Dan Friedman, Danqi ChenNeurIPS 2024 · 72 citations
  5. LLM Circuit Analyses Are Consistent Across Training and ScaleCurt Tigges, Michael Hanna, Qinan Yu, Stella BidermanNeurIPS 2024 · 71 citations

Builds on18

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. Locating and Editing Factual Associations in GPTKevin Meng, David Bau, Alex Andonian, Yonatan BelinkovNeurIPS 2022 · 3,415 citations
  3. Solving Quantitative Reasoning Problems with Language ModelsAitor Lewkowycz, Anders Andreassen, David Dohan, Ethan Dyer et al.NeurIPS 2022 · 2,039 citations
  4. Investigating Gender Bias in Language Models Using Causal Mediation AnalysisJesse Vig, Sebastian Gehrmann, Yonatan Belinkov, Sharon Qian et al.NeurIPS 2020 · 851 citations
  5. Causal Abstractions of Neural NetworksAtticus Geiger, Hanson Lu, Thomas Icard, Christopher PottsNeurIPS 2021 · 516 citations

Related papers

  1. Towards Automated Circuit Discovery for Mechanistic InterpretabilityArthur Conmy, Augustine N. Mavor-Parker, Aengus Lynch, Stefan Heimersheim et al.NeurIPS 2023 · 861 citations
  2. Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 SmallKevin Ro Wang, Alexandre Variengien, Arthur Conmy, Buck Shlegeris et al.ICLR 2023 · 50 citations
  3. Towards Interpretable Sequence Continuation: Analyzing Shared Circuits in Large Language ModelsMichael Lan, Philip Torr, Fazl BarezEMNLP 2024 · 1 citation
  4. Successor Heads: Recurring, Interpretable Attention Heads In The WildRhys Gould, Euan Ong, George Ogden, Arthur ConmyICLR 2024 · 75 citations
  5. Extracting Interpretable Task-Specific Circuits from Large Language Models for Faster InferenceJorge García-Carrasco, Alejandro Maté, Juan TrujilloAAAI 2025 · 3 citations
Dusk over the sea between two cliffs drawn in fine vertical lines