Proceedings

In-context Learning Demonstration Generation with Text Distillation

Download BibTeX Cite

Proceedings of the Thirty-Fourth International Joint Conference on Artificial Intelligence. Main Track. Pages 6433-6441.

https://doi.org/10.24963/ijcai.2025/716

Abstract

In-context learning (ICL), a paradigm derived from large language models (LLMs), holds significant promise but is notably sensitive to the choice of input demonstrations. While numerous methodologies have been developed to select the optimal demonstrations from existing datasets, our work alternatively proposes to generate representative demonstrations through a Distillation-based Demonstration Generation (DDG) framework.

Specifically, our approach aims to generate demonstrations that encapsulate the essential attributes of the target dataset. Rather than optimizing these demonstrations directly, we design a generative model and try to refine it by minimizing the discrepancies between the calculative models trained on generated demonstrations and the original datasets respectively. Additionally, we leverage a teacher-student framework to stabilize the training process and improve the quality of the synthesized samples. Extensive experiments conducted across ten prevalent text datasets demonstrate that our DDG method substantially outperforms existing state-of-the-art methodologies. Our code will be available at https://github.com/wwyq1/DDG.

  1. [Abbasi et al., 2020] Sajjad Abbasi, Mohsen Hajabdollahi, Nader Karimi, and Shadrokh Samavi. Modeling teacher- student techniques in deep neural networks for knowledge distillation. In MVIP, 2020.
  2. [Basu et al., 2021] Sourya Basu, Govardana Sachitanandam Ramachandran, Nitish Shirish Keskar, and Lav R. Varsh- ney. Mirostat: A neural text decoding algorithm that di- rectly controls perplexity. In ICLR, 2021.
  3. [Chen et al., 2023] Yanda Chen, Chen Zhao, Zhou Yu, Kath- leen McKeown, and He He. On the relation between sen- sitivity and accuracy in in-context learning. In EMNLP, 2023.
  4. [Cui et al., 2023] Justin Cui, Ruochen Wang, Si Si, and Cho- Jui Hsieh. Scaling up dataset distillation to imagenet-1k with constant memory. In ICML, 2023.
  5. [Dhamala et al., 2023] Jwala Dhamala, Varun Kumar, Rahul Gupta, Kai-Wei Chang, and Aram Galstyan. An analysis of the effects of decoding algorithms on fairness in open- ended language generation. In IEEE Spoken Language Technology Workshop (SLT), pages 655-662, 2023.
  6. [Dong et al., 2024] Qingxiu Dong, Lei Li, Damai Dai, Ce Zheng, Jingyuan Ma, Rui Li, Heming Xia, Jingjing Xu, Zhiyong Wu, Baobao Chang, Xu Sun, Lei Li, and Zhifang Sui. A survey on in-context learning. In EMNLP, 2024.
  7. [Hiraoka et al., 2020] Tatsuya Hiraoka, Sho Takase, Kei Uchiumi, Atsushi Keyaki, and Naoaki Okazaki. Optimiz- ing word segmentation for downstream task. In EMNLP, 2020.
  8. [Jiang et al., 2023] Zhongtao Jiang, Yuanzhe Zhang, Cao Liu, Jun Zhao, and Kang Liu. Generative calibration for in-context learning. In EMNLP, 2023.
  9. [Kaplan et al., 2020] Jared Kaplan, Sam McCandlish, Tom Henighan, Tom B Brown, Benjamin Chess, Rewon Child, Scott Gray, Alec Radford, Jeffrey Wu, and Dario Amodei. Scaling laws for neural language models. arXiv preprint arXiv:2001.08361, 2020.
  10. [Keskar et al., 2019] Nitish Shirish Keskar, Bryan McCann, Lav R. Varshney, Caiming Xiong, and Richard Socher. Ctrl: A conditional transformer language model for con- trollable generation. arXiv preprint arXiv:1909.05858, 2019.
  11. [Li and Qiu, 2023] Xiaonan Li and Xipeng Qiu. Finding support examples for in-context learning. In EMNLP, 2023.
  12. [Li et al., 2023] Xiaonan Li, Kai Lv, Hang Yan, Tianyang Lin, Wei Zhu, Yuan Ni, Guotong Xie, Xiaoling Wang, and Xipeng Qiu. Unified demonstration retriever for in-context learning. In ACL, 2023.
  13. [Li et al., 2024] Yichuan Li, Xiyao Ma, Sixing Lu, Kyumin Lee, Xiaohu Liu, and Chenlei Guo. MEND: Meta demon- stration distillation for efficient and effective in-context learning. arXiv preprint arXiv:2403.06914, 2024.
  14. [Li et al., 2025] Tianle Li, Ge Zhang, Quy Duc Do, Xiang Yue, and Wenhu Chen. Long-context llms struggle with long in-context learning. Transactions on Machine Learn- ing Research, 2025.
  15. [Liu et al., 2022] Jiachang Liu, Dinghan Shen, Yizhe Zhang, Bill Dolan, Lawrence Carin, and Weizhu Chen. What makes good in-context examples for GPT-3? In ACL, 2022.
  16. [Liu et al., 2024a] Haoyu Liu, Jianfeng Liu, Shaohan Huang, Yuefeng Zhan, Hao Sun, Weiwei Deng, Furu Wei, and Qi Zhang. se 2 : Sequential example selection for in- context learning. In ACL, 2024.
  17. [Liu et al., 2024b] Sheng Liu, Haotian Ye, Lei Xing, and James Zou. In-context vectors: making in context learning more effective and controllable through latent space steer- ing. In ICML, 2024.
  18. [Liu et al., 2024c] Yinpeng Liu, Jiawei Liu, Xiang Shi, Qikai Cheng, Yong Huang, and Wei Lu. Let's learn step by step: Enhancing in-context learning ability with curricu- lum learning. arXiv preprint arXiv:2402.10738, 2024.
  19. [Lu et al., 2022a] Yao Lu, Max Bartolo, Alastair Moore, Se- bastian Riedel, and Pontus Stenetorp. Fantastically or- dered prompts and where to find them: Overcoming few- shot prompt order sensitivity. In ACL, 2022.
  20. [Lu et al., 2022b] Yao Lu, Max Bartolo, Alastair Moore, Se- bastian Riedel, and Pontus Stenetorp. Fantastically or- dered prompts and where to find them: Overcoming few- shot prompt order sensitivity. In ACL, 2022.
  21. [Luo et al., 2024] Man Luo, Xin Xu, Zhuyun Dai, Panupong Pasupat, Mehran Kazemi, Chitta Baral, Vaiva Imbrasaite, and Vincent Y. Zhao. Dr.icl: Demonstration-retrieved in- context learning. Data Intelligence, 6(4):909-922, 2024.
  22. [Maekawa et al., 2023] Aru Maekawa, Naoki Kobayashi, Kotaro Funakoshi, and Manabu Okumura. Dataset distil- lation with attention labels for fine-tuning BERT. In ACL, 2023.
  23. [Maekawa et al., 2024] Aru Maekawa, Satoshi Kosugi, Ko- taro Funakoshi, and Manabu Okumura. Dilm: Distilling dataset into language model for text-level dataset distilla- tion. In ACL, 2024.
  24. [Mao et al., 2023] Anqi Mao, Mehryar Mohri, and Yutao Zhong. Cross-entropy loss functions: Theoretical analy- sis and applications. In ICML, 2023.
  25. [Nguyen and Wong, 2023] Tai Nguyen and Eric Wong. In- context example selection with influences. arXiv preprint arXiv:2302.11042, 2023.
  26. [Nguyen et al., 2025] Minh Nguyen, Andrew Baker, Clement Neo, Allen Roush, Andreas Kirsch, and Ravid Shwartz-Ziv. Turning up the heat: Min-p sampling for creative and coherent llm outputs. In ICLR, 2025.
  27. [Peng et al., 2024] Keqin Peng, Liang Ding, Yancheng Yuan, Xuebo Liu, Min Zhang, Yuanxin Ouyang, and Dacheng Tao. Revisiting demonstration selection strate- gies in in-context learning. In NAACL, 2024.
  28. [Qin et al., 2024] Tian Qin, Zhiwei Deng, and David Alvarez-Melis. A label is worth a thousand images in dataset distillation. In NeurIPS, 2024.
  29. [Robertson and Zaragoza, 2009] Stephen Robertson and Hugo Zaragoza. The probabilistic relevance framework: Bm25 and beyond. Found. Trends Inf. Retr., 3(4):333-389, 2009.
  30. [Rubin et al., 2022] Ohad Rubin, Jonathan Herzig, and Jonathan Berant. Learning to retrieve prompts for in- context learning. In NAACL, 2022.
  31. [S. et al., 2024] Vinay M. S., Minh-Hao Van, and Xintao Wu. In-context learning demonstration selection via in- fluence analysis. arXiv preprint arXiv:2402.11750, 2024.
  32. [Scarlatos and Lan, 2024] Alexander Scarlatos and Andrew Lan. Reticl: Sequential retrieval of in-context ex- amples with reinforcement learning. arXiv preprint arXiv:2305.14502, 2024.
  33. [Wang et al., 2018] Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel Bowman. GLUE: A multi-task benchmark and analysis platform for natural language understanding. In EMNLP, 2018.
  34. [Wang et al., 2023] Xinyi Wang, Wanrong Zhu, Michael Saxon, Mark Steyvers, and William Yang Wang. Large language models are latent variable models: explaining and finding good demonstrations for in-context learning. In NeurIPS, 2023.
  35. [Wu et al., 2023] Zhiyong Wu, Yaoxiang Wang, Jiacheng Ye, and Lingpeng Kong. Self-adaptive in-context learning: An information compression perspective for in-context ex- ample selection and ordering. In ACL, 2023.
  36. [Yang et al., 2019] Erkun Yang, Tongliang Liu, Cheng Deng, Wei Liu, and Dacheng Tao. Distillhash: Unsuper- vised deep hashing by distilling data pairs. In CVPR, pages 2946-2955, 2019.
  37. [Yang et al., 2022] Zhengyuan Yang, Zhe Gan, Jianfeng Wang, Xiaowei Hu, Yumao Lu, Zicheng Liu, and Li- juan Wang. An empirical study of gpt-3 for few-shot knowledge-based vqa. In AAAI, 2022.
  38. [Yang et al., 2024] Jinghan Yang, Shuming Ma, and Furu Wei. Auto-icl: In-context learning without human super- vision. arXiv preprint arXiv:2311.09263, 2024.
  39. [Zhao and Bilen, 2021] Bo Zhao and Hakan Bilen. Dataset condensation with differentiable siamese augmentation. In ICLR, 2021.
  40. [Zhao and Bilen, 2023] Bo Zhao and Hakan Bilen. Dataset condensation with distribution matching. In WACV, 2023.

References were extracted automatically from the PDF and may contain errors.

Welcome Future Conferences AI Journal Division IJCAI Proceedings About IJCAI IJCAI Awards