Transformers Can Learn Multiclass Classification In-Context: Isotropy Governs Generalization
Daehan Yoon, Chulhee Yun
NeurIPS page · OpenReview · Open on the map
Category: Interpretability & Model Adaptation › Transformer In-Context Learning · Type: theory · Keywords: in-context learning, multiclass classification, stable rank, anisotropic class centers, label imbalance, transformer generalization
Summary
The spectral data generation framework reveals that isotropy of class centers, measured by stable rank, governs in-context multiclass classification performance and provides near-optimal per-label sample complexity guarantees.
Explained to a 5-year-old
Transformers are computer programs that can read words and do tasks. One task is to look at a few examples and guess which group a new thing belongs to. Usually, people think of these examples as pictures or words. The researchers wanted to understand how well these programs work when the groups are not the same size. They found that when the groups are spread out evenly, the program makes fewer mistakes.
Explained to a 5-year-old, longer
Transformers are computer programs that can read words and do tasks. One task is to look at a few examples and guess which group a new thing belongs to. Usually, people think of these examples as pictures or words. The researchers wanted to understand how well these programs work when the groups are not the same size. They found that when the groups are spread out evenly, the program makes fewer mistakes. If one group has many examples and another has few, the program may get confused about the small group. They also discovered that the program becomes more robust when the groups are more evenly spread. The study used a special way to create data that lets them control how the groups look. They proved that a simple version of the program can learn with very few examples. They also tested their ideas on real computer programs and saw that the predictions matched. This helps designers make better programs for everyday problems. The findings are useful for anyone who wants to improve how computers learn from examples.
For a technical reader
The paper introduces a data-generation framework that creates class-center matrices with controlled anisotropy and imbalance. Using meta-learning theory, it shows that the stable rank of these centers determines how well a linear transformer can classify new examples in-context, achieving near-optimal sample efficiency. Empirically, the authors confirm that higher isotropy improves performance and that minority-class queries are more error-prone under imbalance, with robustness scaling with stable rank.
Problem
How does in-context learning generalize when class representations are anisotropic and labels are imbalanced?
Method
The approach introduces a spectral data generation framework that constructs class-center matrices with controllable singular spectra, enabling systematic study of anisotropy and label imbalance. It then analyses linear transformers from a meta-learning perspective, deriving theoretical guarantees on sample complexity and robustness. Empirical validation on transformers and pretrained LLMs confirms the theoretical predictions.
Results
The approach finds that higher isotropy (stable rank) leads to better ICL generalization, that linear transformers achieve near-optimal per-label sample complexity, and that label imbalance makes minority-class queries harder while robustness improves with stable rank. Empirical checks on transformers and pretrained LLMs confirm these theoretical trends.
Contributions
It provides a spectral data generation framework for studying anisotropic class centers and label imbalance, proves near-optimal sample complexity for multiclass in-context learning, and shows how stable rank governs generalization under imbalance. The work bridges theory and practice by validating predictions on real transformer models.
Research questions this paper is counted under
This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction