atlas

Research map / Architectures and efficiency / Attention and transformers

Understanding the Generalization of In-Context Learning in Transformers: An Empirical Study

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

Systematically studies how training-data coverage shapes in-context learning generalization across inter-problem, intra-problem, and intra-task dimensions, using function fitting with GPT-2/LLaMA-3 and tool-calling/translation experiments.

Problem

Understanding the boundaries of in-context learning generalization in transformers and how they depend on training data coverage, particularly under distribution shift.

Approach

A task-centric framework that decomposes training data into problems with nested tasks and tests three generalization types; finds transformers fail inter-problem generalization but succeed at intra-problem and intra-task generalization, and that training on more diverse mixed tasks improves ICL on unseen and even simple tasks.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Train on multi-API examples rather than only single-API examplesLLaMA-2-7B with multi-API ICL · ToolBench I2/I3accuracy: 26.3 -> 32.0Helped
Train on multi-API examples rather than only single-API examplesLLaMA-2-7B with single-API ICL · ToolBench I1accuracy: 29.8 -> 30.9Helped
Add in-context examples to mixed-language translationCFL_e2d · WMT14 mix2enBLEU: 37.02 -> 37.69Helped
Add in-context examples to English-to-German baseline translationBL_e2d · WMT14 en2deBLEU: 24.81 -> 25.78Helped
Add in-context examples to CFL translationCFL_e2d · WMT14 de2enBLEU: 24.36 -> 24.36No clear effect
Add a convex-combination pattern to trainingGPT-2-Standard function fitting · Convex combinations of base functionssquared error: 5.58e-2 -> 1.88e-3Helped
Increase product-combination training patterns from one to four (ablation)GPT-2-Standard function fitting · Product combinations, points 21-30squared error: 6.83e-3 -> 2.94e-3Helped
Increase compositional-combination training patterns from one to four (ablation)GPT-2-Standard function fitting · Compositional combinations, points 21-30squared error: 2.48e-2 -> 1.80e-2Helped
Train with a convex combination instead of an additional base functionGPT-2-Standard function fitting · Combination of sin(x) and cos(x)squared error: 1.86e-3 -> 3.13e-3No clear effect
Expose the pretrained model to function-composition data during finetuningLLaMA-3 8B · Function-fitting combinationsgeneralizationHelped
Train on mixed translation problems rather than only one directionQwen2-1.5B architecture · WMT14 mixed-language inputBLEU: 33.57 -> 37.69Helped
Train on mixed translation problems rather than only one directionQwen2-1.5B architecture · WMT14 en2deBLEU: 24.81 -> 21.83Hurt

Surprising findings

Limitations

Experimental setup

Datasets: ToolBench CC100 WMT14 WMT19 WizardLM_evol_instruct_70k

Benchmarks: ToolBench WMT14 de2en WMT19 WMT500

Metrics: squared error API-calling accuracy BLEU BERTScore LLM-as-a-judge score

Baselines: ToolLLaMA Baseline (single-task trained model)

Builds on: ToolLLaMA ReAct Qwen2

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