Distributional Associations vs In-Context Reasoning: A Study of Feed-forward and Attention Layers

Lei Chen, Joan Bruna, Alberto Bietti
6/5/2024
cs.LGcs.AIcs.CL

No official code found. Best implementation: leichen2018/ATTN_vs_MLP (4 stars, MIT, last commit 2025-02-27).

Abstract

Large language models have been successful at tasks involving basic forms of in-context reasoning, such as generating coherent language, as well as storing vast amounts of knowledge. At the core of the Transformer architecture behind such models are feed-forward and attention layers, which are often associated to knowledge and reasoning, respectively. In this paper, we study this distinction empirically and theoretically in a controlled synthetic setting where certain next-token predictions involve both distributional and in-context information. We find that feed-forward layers tend to learn simple distributional associations such as bigrams, while attention layers focus on in-context reasoning. Our theoretical analysis identifies the noise in the gradients as a key factor behind this discrepancy. Finally, we illustrate how similar disparities emerge in pre-trained models through ablations on the Pythia model family on simple reasoning tasks.

View on arXivView PDF

Code Implementations(1)

MIT

The official implementation of ''Distributional Associations vs In-Context Reasoning: A Study of Feed-forward and Attention Layers'' at ICLR 2025

40Shell, PythonFeb 27, 20251 years agoMIT

Similar Papers

Cite this paper

@article{chen2024distributional,
  title  = {Distributional Associations vs In-Context Reasoning: A Study of Feed-forward and Attention Layers},
  author = {Lei Chen and Joan Bruna and Alberto Bietti},
  year   = {2024},
  eprint = {2406.03068},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2406.03068v2}
}

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/2406.03068.svg)](https://codeofpaper.com/paper/2406.03068)

Discussion