Is In-Context Learning Sufficient for Instruction Following in LLMs?

Hao Zhao, Maksym Andriushchenko, Francesco Croce, Nicolas Flammarion
2/12/2026

No official code found. Best implementation: tml-epfl/icl-alignment (34 stars, Apache-2.0, last commit 2025-01-23).

Abstract

In-context learning (ICL) allows LLMs to learn from examples without changing their weights: this is a particularly promising capability for long-context LLMs that can potentially learn from many examples. Recently, Lin et al. (2024) proposed URIAL, a method using only three in-context examples to align base LLMs, achieving non-trivial instruction following performance. In this work, we show that, while effective, ICL alignment with URIAL still underperforms compared to instruction fine-tuning on the established benchmark MT-Bench, especially with more capable base LLMs. We then uncover the most relevant elements for successful in-context alignment, finding the crucial role of the decoding parameters. Based on these insights, we show that the approach of URIAL can indeed be improved by adding high-quality, potentially carefully selected via greedy search, demonstrations in context, getting closer to the performance of instruct models. Finally, we provide the first, to our knowledge, systematic comparison of ICL and instruction fine-tuning (IFT) for instruction following in the low data regime, where ICL can be a viable alternative to IFT. Overall, our work advances the understanding of ICL as an alignment technique and its relationship to IFT. We provide our code at https://github.com/tml-epfl/icl-alignment.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

Is In-Context Learning Sufficient for Instruction Following in LLMs? [ICLR 2025]

343Shell, PythonMay 29, 20241 years agoApache-2.0
alignmentin-context-learninginstruction-following

Similar Papers

Cite this paper

@article{zhao2026incontext,
  title  = {Is In-Context Learning Sufficient for Instruction Following in LLMs?},
  author = {Hao Zhao and Maksym Andriushchenko and Francesco Croce and Nicolas Flammarion},
  year   = {2026},
  eprint = {2405.19874},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2405.19874},
  journal = {ICLR 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2405.19874.svg)](https://codeofpaper.com/paper/2405.19874)

Discussion