Can Input Attributions Explain Inductive Reasoning in In-Context Learning?

Mengyu Ye, Tatsuki Kuribayashi, Goro Kobayashi, Jun Suzuki

Abstract

In-Context Learning (ICL) allows Large Language Models (LLMs) to adapt to new tasks via few-shot prompting. However, the internal mechanism of how models "learn" specific rules from examples remains opaque. This study evaluates whether traditional Input Attribution (IA) methods—such as gradients and token erasure—can effectively track the inductive reasoning process. By introducing a synthetic benchmark of ambiguous tasks where a single "aha" example disambiguates the intended rule, we demonstrate that while IA methods can identify influential examples, simpler gradient-based methods often outperform complex ones, and interpretability tends to decrease as model scale increases.

Introduction

Large Language Models (LLMs) exhibit a remarkable ability to perform In-Context Learning (ICL), solving novel tasks based on a few examples provided in the prompt. A fundamental question in understanding ICL is whether the model relies on all examples equally or if specific "aha" moments—triggered by key pieces of information—drive the reasoning process. Input Attribution (IA) methods, originally developed for smaller architectures, offer a potential lens into this process by quantifying the influence of specific input tokens on model outputs.

The Disambiguation Benchmark

To test the efficacy of IA methods in tracking inductive reasoning, we developed a synthetic benchmark consisting of six tasks designed to mimic psycholinguistic tests. Each task features a prompt where most examples are ambiguous, supporting multiple potential rules. Crucially, exactly one "aha" example is included to disambiguate the rule.

Conceptual diagram of the "aha" example within a prompt and the expected attribution score.

The tasks include:

  • LINEAR-OR-DISTINCT (LD): Choosing between a positional rule or a uniqueness rule.
  • ADD-OR-MULTIPLY (AM): Determining if a transformation adds a fixed number of tokens or doubles them.
  • Linguistic Rules (VO, TA, PT): Identifying rules based on syntax (e.g., verb tense) or formatting (e.g., title case).
  • ASSOCIATIVE-RECALL (AR): A baseline task involving key-value pair memorization.

Methodology

We evaluated four representative IA methods across several open-weight models, including Llama-2, Gemma-2, and Mistral-7B:

  1. Input Erasure (IE): Measuring confidence drop upon removing an example.
  2. Gradient Norm (GN): Assessing output sensitivity to input changes.
  3. Input × Gradient (I×G): Weighting embeddings by their gradients.
  4. Integrated Gradients (IG): A path-integral approach to handle gradient saturation.

To enhance precision, we employed contrastive explanations, analyzing why a model preferred the correct rule over a plausible alternative.

Results and Discussion

Our findings indicate that IA methods can indeed capture inductive reasoning by assigning high importance to the disambiguating "aha" example.

IA scores (Top-1 and Top-2) across six tasks for various LLMs and attribution methods.

Key observations include:

  • Simplicity vs. Complexity: Basic Gradient Norm (GN) frequently outperformed more sophisticated methods like Integrated Gradients (IG). In synthetic tasks with random characters, embedding norms (utilized by IG and I×G) may introduce noise rather than clarity.
  • The Scaling Interpretability Gap: Interestingly, larger models (e.g., Gemma-2-27B) often proved harder to interpret than their smaller counterparts. While larger models are more capable of solving the tasks, their gradient signals appear more diffused or noisy.
  • Method Performance: Input Erasure (IE) emerged as the most robust method, particularly in tasks like ADD-OR-MULTIPLY, where it achieved over 90% accuracy in identifying the critical example.
  • Many-shot Robustness: Gradient-based methods maintained stable performance even as context length increased to 100 examples, whereas self-explanation methods ("Self-Answer") failed as prompts grew longer.

Conclusion

While traditional IA methods provide a viable path for explaining inductive reasoning in LLMs, their effectiveness varies significantly with model scale and method complexity. The observed "interpretability gap" in larger models suggests a need for new attribution techniques tailored to massive transformer architectures. Future work should aim to bridge these input-output associations with mechanistic interpretability to uncover the specific neural circuits responsible for "aha" moments in in-context learning.

Summary updated

BibTeX
@inproceedings{ye2025can,
  author = {Mengyu Ye and Tatsuki Kuribayashi and Goro Kobayashi and Jun Suzuki},
  title = {{Can Input Attributions Explain Inductive Reasoning in In-Context Learning?}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure