Table of Contents
Fetching ...

In-context Learning and Gradient Descent Revisited

Gilad Deutch, Nadav Magar, Tomer Bar Natan, Guy Dar

TL;DR

The paper re-evaluates the claim that in-context learning (ICL) implements gradient-descent-based finetuning in large transformers, identifying evaluation gaps and showing untrained models can achieve comparable similarity scores. It introduces Layer-Causal Gradient Descent (LCGD) to enforce layer causality and demonstrates that LCGD improves alignment with ICL on several metrics, though overall similarity remains modest. The authors argue for a weaker, more nuanced ICL-GD correspondence and discuss terminological confusions across related work, drawing connections to kernel regression and functional gradient methods. Overall, the work cautions against overinterpreting strong ICL-GD claims and provides a concrete, causality-respecting alternative that invites further exploration.

Abstract

In-context learning (ICL) has shown impressive results in few-shot learning tasks, yet its underlying mechanism is still not fully understood. A recent line of work suggests that ICL performs gradient descent (GD)-based optimization implicitly. While appealing, much of the research focuses on simplified settings, where the parameters of a shallow model are optimized. In this work, we revisit evidence for ICL-GD correspondence on realistic NLP tasks and models. We find gaps in evaluation, both in terms of problematic metrics and insufficient baselines. We show that surprisingly, even untrained models achieve comparable ICL-GD similarity scores despite not exhibiting ICL. Next, we explore a major discrepancy in the flow of information throughout the model between ICL and GD, which we term Layer Causality. We propose a simple GD-based optimization procedure that respects layer causality, and show it improves similarity scores significantly.

In-context Learning and Gradient Descent Revisited

TL;DR

The paper re-evaluates the claim that in-context learning (ICL) implements gradient-descent-based finetuning in large transformers, identifying evaluation gaps and showing untrained models can achieve comparable similarity scores. It introduces Layer-Causal Gradient Descent (LCGD) to enforce layer causality and demonstrates that LCGD improves alignment with ICL on several metrics, though overall similarity remains modest. The authors argue for a weaker, more nuanced ICL-GD correspondence and discuss terminological confusions across related work, drawing connections to kernel regression and functional gradient methods. Overall, the work cautions against overinterpreting strong ICL-GD claims and provides a concrete, causality-respecting alternative that invites further exploration.

Abstract

In-context learning (ICL) has shown impressive results in few-shot learning tasks, yet its underlying mechanism is still not fully understood. A recent line of work suggests that ICL performs gradient descent (GD)-based optimization implicitly. While appealing, much of the research focuses on simplified settings, where the parameters of a shallow model are optimized. In this work, we revisit evidence for ICL-GD correspondence on realistic NLP tasks and models. We find gaps in evaluation, both in terms of problematic metrics and insufficient baselines. We show that surprisingly, even untrained models achieve comparable ICL-GD similarity scores despite not exhibiting ICL. Next, we explore a major discrepancy in the flow of information throughout the model between ICL and GD, which we term Layer Causality. We propose a simple GD-based optimization procedure that respects layer causality, and show it improves similarity scores significantly.
Paper Structure (28 sections, 3 equations, 4 figures, 3 tables)

This paper contains 28 sections, 3 equations, 4 figures, 3 tables.

Figures (4)

  • Figure 1: Layer-causal GD: The output of each layer is projected to the label space and used as an intermediate prediction. We compute the prediction loss of each intermediate layer sequentially.
  • Figure 2: $\alpha$ averaged over all layers for each task. Computed for one seed per task.
  • Figure 3: Similarity computed per layer aggregated across tasks and seeds. Error bar is presented. Blue bars represent layer causal GD and orange is used for vanilla GD. Top: SimAOU of each layer's update vector. Bottom: $\text{SimAM}_\Delta$ of each layer's update vector.
  • Figure 4: Heatmap of $\ell_2$ norms of the gradients computed during finetuning on the Subj task. Note the different scales of magnitude. Horizontal Axis: Training demonstration index. Vertical Axis: Layer index in ascending order (from input to network output). Left: Vanilla GD. Right: LCGD (norm magnitude in logarithmic scale).