Focused Large Language Models are Stable Many-Shot Learners
Authors:
Preprint
Abstract
In-Context Learning (ICL) enables large language models (LLMs) to achieve rapid task adaptation by learning from demonstrations. With the increase in available context length of LLMs, recent experiments have shown that the performance of ICL does not necessarily scale well in many-shot (demonstration) settings. We theoretically and experimentally confirm that the reason lies in more demonstrations dispersing the model attention from the query, hindering its understanding of key content. Inspired by how humans learn from examples, we propose a training-free method FocusICL, which conducts triviality filtering to avoid attention being diverted by unimportant contents at token-level and operates hierarchical attention to further ensure sufficient attention towards current query at demonstration-level. We also design an efficient hyperparameter searching strategy for FocusICL based on model perplexity of demonstrations. Comprehensive experiments validate that FocusICL achieves an average performance improvement of 5.2% over vanilla ICL and scales well with many-shot demonstrations.Keywords
All Related Versions
This publication has 11 references indexed in Scilit:
- Unraveling the Mechanics of Learning-Based Demonstration Selection for In-Context Learning2025
- In-Context Learning with Long-Context Models: An In-Depth Exploration2025
- BatchEval: Towards Human-like Text Evaluation2024
- Heterogeneous-Branch Collaborative Learning for Dialogue GenerationProceedings of the AAAI Conference on Artificial Intelligence, 2023
- Towards Diverse, Relevant and Coherent Open-Domain Dialogue Generation via Hybrid Latent VariablesProceedings of the AAAI Conference on Artificial Intelligence, 2023
- Why Can GPT Learn In-Context? Language Models Secretly Perform Gradient Descent as Meta-Optimizers2023
- Diversifying Neural Dialogue Generation via Negative Distillation2022
- Learning To Retrieve Prompts for In-Context Learning2022
- Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity2022
- PIQA: Reasoning about Physical Commonsense in Natural LanguageProceedings of the AAAI Conference on Artificial Intelligence, 2020