In-Context Learning as Rate–Distortion Optimization
Jiayu Zhang, Changbang Li, Canran Xiao
Abstract
In-context learning (ICL) is a practical way to adapt large models, yet under strict context limits, it remains unclear how to spend scarce tokens without being misled by noisy, redundant, or conflicting demonstrations. We address this gap by targeting token-budgeted context construction: how to select and compress demonstrations so the prompt carries maximal task-relevant signal with minimal predictive distortion. We propose RDCO, a deterministic, training-free optimizer that scores demonstrations by marginal task information per token, penalizes redundancy and prefix-conditioned conflicts, and finally compacts the selected context under a bounded predictive-divergence constraint to control drift. Across a 10-dataset ICL suite spanning classification and structured generation, RDCO achieves the best average performance (63.26 Acc. on classification and 60.26 EM on generation), improving over the strongest classification and generation baselines by 2.20 and 2.26 points, respectively, and improving the 10-task overall average by 4.94 points under the same budget. Our results suggest that viewing prompts as finite-capacity messages yields a principled and effective path to more reliable and token-efficient ICL.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
Lineage
- A Survey on In-context Learning cites The Learnability of In-Context Learning
- A Survey on In-context Learning cites Compositional Exemplars for In-context Learning
- A Survey on In-context Learning cites Calibrate Before Use: Improving Few-shot Performance of Language Models
Builds on21
- Calibrate Before Use: Improving Few-shot Performance of Language ModelsZihao Zhao, Eric Wallace, Shi Feng, Dan Klein et al.ICML 2021 · 1,843 citations
- Learning to Compress Prompts with Gist TokensJesse Mu, Xiang Li, Noah D. GoodmanNeurIPS 2023 · 488 citations
- A Survey on In-context LearningQingxiu Dong, Lei Li, Damai Dai, Ce Zheng et al.EMNLP 2024 · 479 citations
- The Learnability of In-Context LearningNoam Wies, Yoav Levine, Amnon ShashuaNeurIPS 2023 · 207 citations
- Compositional Exemplars for In-context LearningJiacheng Ye, Zhiyong Wu, Jiangtao Feng, Tao Yu et al.ICML 2023 · 188 citations
Related papers
- Enhancing Multimodal In-Context Learning for Image Classification through Coreset OptimizationHuiyi Chen, Jiawei Peng, Kaihua Tang, Xin Geng et al.ACM MM 2025
- Data Curation Alone Can Stabilize In-context LearningTing-Yun Chang, Robin JiaACL 2023 · 11 citations
- Demonstration Selection for In-Context Learning via Reinforcement LearningXubin Wang, Jianfei Wu, Yichen Yuan, Deyu Cai et al.ICML 2025
- Evolving Prompts In-Context: An Open-ended, Self-replicating PerspectiveJianyu Wang, Zhiqiang Hu, Lidong BingICML 2025
- GistScore: Learning Better Representations for In-Context Example Selection with Gist BottlenecksShivanshu Gupta, Clemens Rosenbaum, Ethan R. ElenbergICML 2024 · 10 citations
