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%.
AdmTree: Compressing Lengthy Context with Adaptive Semantic Trees
Shenzhen International Graduate School, Tsinghua University(清华大学深圳国际研究生院);Peng Cheng Laboratory(鹏城实验室);University of Illinois Chicago(伊利诺伊大学芝加哥分校);Guangdong Laboratory of Artificial Intelligence and Digital Economy (SZ)(广东人工智能与数字经济实验室(深圳))
Dynamic Compressing Prompts for Efficient Inference of Large Language Models
School of Software Engineering, South China University of Technology(华南理工大学软件学院);Pazhou Lab(琶洲实验室);School of Future Technology, South China University of Technology(华南理工大学未来技术学院);Peng Cheng Laboratory(鹏城实验室);Hong Kong Polytechnic University(香港理工大学);Department of Computer Science and Technology, Chongqing University of Posts and Telecommunications(重庆邮电大学计算机科学与技术学院)
CHARM: A Multimodal Graph Foundation Model with Hierarchical Context Modeling for Zero-Shot Transfer
School of Computer Science and Technology, College of Intelligence and Computing, Tianjin University(天津大学智能与计算学部计算机科学与技术学院);Data Science Program, Columbian College of Arts and Sciences, The George Washington University(乔治华盛顿大学文理学院哥伦比亚艺术与科学学院数据科学项目)
Advancing Graph Few-Shot Learning via In-Context Learning
College of Computer Science and Technology, Jilin University(吉林大学计算机科学与技术学院);College of Software, Jilin University(吉林大学软件学院);Department of Computer Science and Technology, Yanbian University(延边大学计算机科学与技术系);Department of Information Engineering and Computer Science, University of Trento(特伦托大学信息工程与计算机科学系);School of Mathematical and Computer Sciences, Heriot-Watt University(赫瑞斯泰大学数学与计算机科学学院)
OPQ: Compressing Deep Neural Networks with One-shot Pruning-Quantization
Institute for Infocomm Research, Agency for Science, Technology and Research(新加坡科技研究局资讯通信研究院);College of Computer Science, Sichuan University(四川大学计算机学院);Nanyang Technological University(南洋理工大学)
Meta In-Context Learning Makes Large Language Models Better Zero and Few-Shot Relation Extractors
School of Computer Science and Engineering, Southeast University(东南大学计算机科学与工程学院);Beijing Institute of Computer Technology and Application(北京计算机技术及应用研究所)
Span-based Named Entity Recognition by Generating and Compressing Information
National Centre for Text Mining(国家文本挖掘中心);The University of Manchester(曼彻斯特大学);Toyota Technological Institute(丰田工业大学);Artificial Intelligence Research Center (AIRC)(人工智能研究中心(AIRC));National Institute of Advanced Industrial Science and Technology (AIST)(日本产业技术综合研究所(AIST));Alan Turing Institute(艾伦·图灵研究所)
Towards Foundation Models for Zero-Shot Time Series Anomaly Detection: Leveraging Synthetic Data and Relative Context Discrepancy
Department of Industrial Engineering, Tsinghua University, Beijing, China(清华大学工业工程系);Datadog AI Research, Paris, France. This work was completed prior to joining Datadog(Datadog AI 研究院);Lab, Huawei Technologies, ShenZhen, China(华为技术2012实验室)
Context-Transformer: Tackling Object Confusion for Few-Shot Detection
Shenzhen Institutes of Advanced Technology, Chinese Academy of Sciences(中国科学院深圳先进技术研究院);Huawei Noah’s Ark Lab(华为诺亚方舟实验室);Shenzhen Institute of Artificial Intelligence and Robotics for Society(深圳市人工智能与机器人研究院)