Compressing Many-Shots in In-Context Learning
Not on the map. Why?
Abstract (arXiv)
Large Language Models (LLMs) have been shown to be able to learn different tasks without explicit finetuning when given many input-output examples / demonstrations through In-Context Learning (ICL). Increasing the number of examples, called ``shots'', improves downstream task performance but incurs higher memory and computational costs. In this work, we study an approach to improve the memory and computational efficiency of ICL inference by compressing the many-shot prompts. Given many shots comprising t tokens, our goal is to generate a m soft-token summary, where m < t. We first show that existing prompt compression methods are ineffective for many-shot compression, and simply using fewer shots as a baseline is surprisingly strong. To achieve effective compression, we find that: (a) a stronger compressor model with more trainable parameters is necessary, and (b) compressing many-shot representations at each transformer layer enables more fine-grained compression by providing each layer with its own compressed representation. Based on these insights, we propose MemCom, a layer-wise compression method. We systematically evaluate various compressor models and training approaches across different model sizes (2B and 7B), architectures (Gemma and Mistral), many-shot sequence lengths (3k-6k tokens), and compression ratios (3x to 8x). MemCom outperforms strong baselines across all compression ratios on multiple classification tasks with large label sets. Notably, while baseline performance degrades sharply at higher compression ratios, often by over 20-30%, MemCom maintains high accuracy with minimal degradation, typically dropping by less than 10%.
Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Builds on 18 of its 26 references that are in the map. First posted on arXiv 17 Oct 2025.
Builds on
18 of 26 references.
References · 18
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2021Training Verifiers to Solve Math Word Problemscited by 9,743
- 2017TriviaQA: A Large Scale Distantly Supervised Challenge Dataset for Reading Comprehensioncited by 2,895
- 2023Efficient Streaming Language Models with Attention Sinkscited by 2,115
- 2018Don't Give Me the Details, Just the Summary! Topic-Aware Convolutional Neural Networks for Extreme Summarizationcited by 1,308
- 2024SnapKV: LLM Knows What You are Looking for Before Generationcited by 848
- 2022A Survey on In-context Learningcited by 717
- 2020Efficient Intent Detection with Dual Sentence Encoderscited by 419
- 2023Learning to Compress Prompts with Gist Tokenscited by 379
- 2019An Evaluation Dataset for Intent Classification and Out-of-Scope Predictioncited by 378
- 2023Adapting Language Models to Compress Contextscited by 350
- 2019Benchmarking Natural Language Understanding Services for building Conversational Agentscited by 166
6 more
- 2024In-Context Learning with Long-Context Models: An In-Depth Explorationcited by 126
- 2020SPINN: Synergistic Progressive Inference of Neural Networks over Device and Cloudcited by 109
- 2023In-Context Learning with Many Demonstration Examplescited by 39
- 2021DynO: Dynamic Onloading of Deep Neural Networks from Cloud to Devicecited by 17
- 2023NetGPT: A Native-AI Network Architecture Beyond Provisioning Personalized Generative Servicescited by 13
- 2024Crayon: Customized On-Device LLM via Instant Adapter Blending and Edge-Server Hybrid Inferencecited by 7
Built on by
Citing papers per year: 2026: 1.
1 paper.
Similar, not cited
Close in wording, no citation either way
- 2024Many-Shot In-Context Learning
- 2026MILO: Efficient Many-shot In-Context Learning with Block-wise Low-rank Compression
- 2025Dynamic Compressing Prompts for Efficient Inference of Large Language Models
- 2025From Few to Many: Self-Improving Many-Shot Reasoners Through Iterative Optimization and Generation
- 2024Prompt Compression for Large Language Models: A Survey
- 2023Context Compression for Auto-regressive Transformers with Sentinel Tokens
- 2025From Compression to Expression: A Layerwise Analysis of In-Context Learning
- 2025A Survey of Token Compression for Efficient Multimodal Large Language Models