atlas

Research map / Architectures and efficiency / Attention and transformers

In-Context Language Learning: Architectures and Algorithms

ICML 2024 · Architectures and efficiency › Attention and transformers · approach: Training dynamics of in-context learning · 3 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.

Introduces in-context language learning (ICLL) on random regular languages (RegBench), finds Transformers beat RNN/conv/SSM models, attributes this to higher-order n-gram heads, and shows hard-wired n-gram heads improve models on ICLL and SlimPajama perplexity.

Problem

Existing in-context learning model problems (linear regression, associative recall) are too simple to capture free-form generative ICL in LMs; it is unclear which neural sequence architectures can perform in-context learning of new formal languages and how.

Approach

Frame ICL as in-context language learning over random probabilistic finite automata, evaluate many sequence architectures, identify n-gram heads (higher-order induction heads) as the Transformer mechanism, and add static n-gram attention heads (NGH) to other architectures to improve both synthetic and natural language modeling.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Add NGH¹, NGH², and NGH³ to RetNet (ablation)RetNet · RegBench, N=2500TVD: 0.392 -> 0.217Helped
Add NGH¹, NGH², and NGH³ to RetNet (ablation)RetNet · RegBench, N=2500accuracy: 0.800 -> 0.94Helped
Add NGH¹, NGH², and NGH³ to GLA (ablation)GLA · RegBench, N=2500TVD: 0.624 -> 0.207Helped
Add NGH¹, NGH², and NGH³ to GLA (ablation)GLA · RegBench, N=2500accuracy: 0.526 -> 0.946Helped
Add NGH¹, NGH², and NGH³ to RetNet (ablation)RetNet · SlimPajama, 7B tokensperplexity: 16.55 -> 15.86Helped
Add three NGH¹ layers to GLA instead of NGH¹, NGH², and NGH³ (ablation)GLA · SlimPajama, 7B tokensperplexity: 15.65 -> 15.54; 15.24 with NGH¹,²,³Mixed
Add NGH¹, NGH², and NGH³ to GLA (ablation)GLA · SlimPajama, 7B tokensperplexity: 15.65 -> 15.24Helped
Add NGH¹, NGH², and NGH³ to Transformer (Llama) (ablation)Transformer (Llama) · SlimPajama, 7B tokensperplexity: 16.96 -> 15.82; +6.7%Helped

Surprising findings

Limitations

Experimental setup

Datasets: RegBench SlimPajama associative recall

Benchmarks: RegBench associative recall SlimPajama perplexity

Metrics: accuracy total variation distance perplexity probe relative error probe classification accuracy

Baselines: n-gram model with backoff Baum-Welch in-context HMM LSTM RWKV H3 Hyena Linear Transformer Mamba GLA S4

Builds on: induction heads S4 Mamba RetNet GLA

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