atlas

Research map / Architectures and efficiency / Attention and transformers

On Understanding Attention-Based In-Context Learning for Categorical Data

ICML 2025 · Architectures and efficiency › Attention and transformers · approach: Theory of self-attention dynamics · 0 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Extends functional gradient-descent views of in-context learning to categorical outcomes, proposing a self-attention plus cross-attention block that exactly implements multi-step GD inference for softmax likelihoods, evaluated on synthetic data, ImageNet in-context classification, and TinyStories language generation.

Problem

Existing functional-GD interpretations of Transformer in-context learning assume real-valued outputs with Gaussian likelihoods, whereas language involves categorical (discrete token) outcomes; it is unclear how attention can implement GD for categorical observations.

Approach

Shows that the categorical cross-entropy GD update requires the nonlinear expectation over class embeddings, which can be computed by a softmax cross-attention layer over learned embedding vectors; each attention block pairs a self-attention layer (kernel update of the latent function plus erasure head) with this cross-attention layer, so multi-step GD is exact.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
add a second attention block (GD step)GD attention model · Synthetic categorical dataTop-1 predictive accuracyHelped
add attention blocks beyond oneGD attention model · Synthetic categorical datanegative log-likelihoodHelped
use linear attention instead of nonlinear attentionGD attention model · Synthetic categorical datapredictive accuracyHurt
use exponential attentionGD attention model · Synthetic categorical datapredictive accuracyHurt
increase the GD attention model from one to two or three blocksGD attention model · ImageNet in-context classificationTop-1 predictive accuracyHelped
use one GD self-attention layer instead of linear probingGD attention model · ImageNet in-context classificationTop-1 predictive accuracyHurt
add a feedforward network above the GD attention output (ablation)Softmax GD language model · Tiny Stories and Children Stories generationGPT-4o scoreHelped
use the GD model instead of the comparable TransformerSingle-layer language model · Tiny Stories and Children Stories generationGPT-4o scoreHurt
use a single self-attention layerGD attention model · Synthetic categorical dataTop-1 predictive accuracyNo clear effect

Surprising findings

Limitations

Experimental setup

Datasets: Synthetic categorical GD data ImageNet TinyStories Children Stories

Benchmarks: ImageNet in-context classification (synthetic-to-ImageNet test classes) TinyStories and Children Stories story continuation

Metrics: top-1 accuracy negative log-likelihood GPT-4o quality score out of 10

Baselines: Trained TF Linear probing Single-layer Transformer

Builds on: Transformers learn in-context by gradient descent Linear attention as in-context regression Trained Transformer (TF) vs GD transformer comparison

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy