atlas

Research map / Large language models / Language, safety and interpretability

Understanding In-Context Learning in Transformers and LLMs by Learning to Learn Discrete Functions

ICLR 2024 · Large language models › Language, safety and interpretability · approach: Reasoning mechanisms and failure modes · 1 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.

Studies in-context learning of Boolean function classes by training sequence models from scratch (Transformers, LSTM, DSS, Hyena, RetNet), teaching-sequence prompts, and direct/frozen evaluation of GPT-2, GPT-4, GPT-3.5-Turbo and LLaMA-2-70B against nearest-neighbor baselines.

Problem

Understanding the limits of Transformers' in-context learning of algorithms, whether attention is necessary, whether models exploit teaching sequences, and whether pretrained LLMs implement learning algorithms in-context on discrete (Boolean) tasks.

Approach

Extends the meta-learning in-context framework to Boolean function classes with known learnability, where discrete inputs let pretrained LLMs be evaluated directly; shows attention-free models match Transformers on most tasks, Transformers can learn two algorithms for one task and select by prompt, and LLMs compete with nearest neighbor.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use a Transformer rather than chance-level predictionParity and Sparse Parity in-context learning · Parity-20accuracy: 50.6No clear effect
Use a Transformer rather than gradient-trained FFNParity-(10, 2) · Parity-(10, 2)accuracy: 100.0 -> 53.7Hurt
Provide a teaching sequenceTransformer in-context learning · Teach Conjunctions, Teach Disjunctions, Teach CNFs, Teach DNFs, and Teach Sparse ParitiesaccuracyHelped
Train on teaching-sequence examples instead of the vanilla distributionTransformer on Conjunctions · Conjunctions without teaching sequencesaccuracyHurt
Train on a mixture of teaching-sequence and vanilla examplesTransformer on Conjunctions · Conjunctions and Teach ConjunctionaccuracyHelped
Train with 10% of labels flippedSequence architectures on Conjunctions and Disjunctions · Conjunctions and DisjunctionsaccuracyNo clear effect
Evaluate on functions with expected literal count changed from n/3 to 2n/3Transformer trained on Conjunctions · Conjunctions with out-of-distribution functionsaccuracyNo clear effect
Evaluate on functions with extreme literal-distribution shiftsTransformer trained on Conjunctions · Conjunctions with out-of-distribution functionsaccuracyHurt
Train on 0-1 Threshold functions and evaluate on ConjunctionsTransformer · ConjunctionsaccuracyHelped
Use attention-free architectures instead of TransformersIn-context Boolean function learning · Most Boolean function tasksaccuracyNo clear effect
Use RetNet or DSS instead of Transformer0-1 Threshold learning · 0-1 Thresholdaccuracy: 85.3 -> 72.9; 85.3 -> 72.4Hurt
Use Hyena instead of TransformerNearest Neighbor task · Nearest Neighboraccuracy: 100.0 -> 85.5Hurt

Surprising findings

Limitations

Experimental setup

Datasets: Synthetic Boolean function classes (conjunctions, disjunctions, DNF/CNF, parities, threshold, majority, nearest neighbor Linear regression task from prior work

Benchmarks: Boolean function classes test-bed (conjunctions, disjunctions, sparse disjunctions, 3-CNF, 3-DNF, majority, 0-1 threshol

Metrics: accuracy on last prompt example

Baselines: Null classifier Averaging estimator Nearest neighbors Feedforward network GPT-3.5-Turbo Randomly initialized Transformer

Builds on: Garg et al. in-context learning framework of function classes induction heads

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