Hidden Tail Risk in In-Context Learning under Context-Query Mixture Shift

Evaluation with a prompt's task frequencies can hide errors on rare tasks, even when their examples are present. We analyze this effect in a multi-task model with independent scalar parameters bounded by $B$. A normalized finite-feature attention head induces a low-rank response matrix; among all matrices of rank at most $r$, the minimum Bayes bias is $B^2\sum_{i>r}q_{(i)}$. A shift toward uniform query weights exposes this capacity floor without changing the optimal task allocation, whereas shifts that reorder tasks can also create selection regret. We connect this bias analysis to gradient flow in an unnormalized factorized model and derive the coupled query and key gradients for the normalized head. With task coverage and separated addresses, token-preserving softmax reaches the sampling rate $O(\sigma^2/k_+)$ above an explicit temperature threshold, where $k_+$ is the target count. Synthetic experiments examine these predictions, and a separate study evaluates six pretrained checkpoints on 107,520 prompts across 80 episode seeds. In the primary 2.8B pair, Mamba is more sensitive to target repetition. Its estimated matched-to-tail accuracy gap is 5.8 percentage points (95% CI: 2.93--8.71), compared with zero for Pythia. The 95% CI crosses the prespecified practical threshold of 3 percentage points, so smaller effects remain compatible with the data. Both prespecified tests pass. Smaller pairs fail the frequency-test accuracy requirements. These findings motivate frequency-resolved evaluation in this task family. Preprint with supporting source, analysis code and data. 40 pages, 12 figures, 5 tables. Not peer reviewed. Licensing: CC BY 4.0 for author-owned text, figures and data; MIT for author-owned Python code. Third-party rights and embedded font licenses are preserved; see LICENSING.txt.

Authors

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-10-16
DOI
https://doi.org/10.5281/zenodo.23422201
Primary Topic
Domain Adaptation and Few-Shot Learning
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
preprint

Hidden Tail Risk in In-Context Learning under Context-Query Mixture Shift

Ali Noori
Zenodo (CERN European Organization for Nuclear Research)
Domain Adaptation and Few-Shot Learning
preprint

Hidden Tail Risk in In-Context Learning under Context-Query Mixture Shift

Ali Noori
preprint en

Abstract

Evaluation with a prompt's task frequencies can hide errors on rare tasks, even when their examples are present. We analyze this effect in a multi-task model with independent scalar parameters bounded by $B$. A normalized finite-feature attention head induces a low-rank response matrix; among all matrices of rank at most $r$, the minimum Bayes bias is $B^2\sum_{i>r}q_{(i)}$. A shift toward uniform query weights exposes this capacity floor without changing the optimal task allocation, whereas shifts that reorder tasks can also create selection regret. We connect this bias analysis to gradient flow in an unnormalized factorized model and derive the coupled query and key gradients for the normalized head. With task coverage and separated addresses, token-preserving softmax reaches the sampling rate $O(\sigma^2/k_+)$ above an explicit temperature threshold, where $k_+$ is the target count. Synthetic experiments examine these predictions, and a separate study evaluates six pretrained checkpoints on 107,520 prompts across 80 episode seeds. In the primary 2.8B pair, Mamba is more sensitive to target repetition. Its estimated matched-to-tail accuracy gap is 5.8 percentage points (95% CI: 2.93--8.71), compared with zero for Pythia. The 95% CI crosses the prespecified practical threshold of 3 percentage points, so smaller effects remain compatible with the data. Both prespecified tests pass. Smaller pairs fail the frequency-test accuracy requirements. These findings motivate frequency-resolved evaluation in this task family. Preprint with supporting source, analysis code and data. 40 pages, 12 figures, 5 tables. Not peer reviewed. Licensing: CC BY 4.0 for author-owned text, figures and data; MIT for author-owned Python code. Third-party rights and embedded font licenses are preserved; see LICENSING.txt.

Zenodo (CERN European Organization for Nuclear Research)
Domain Adaptation and Few-Shot Learning
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.