Skill-Based Few-Shot Selection for In-Context Learning
Shengnan An, Bo Zhou, Zeqi Lin, Qiang Fu, Bei Chen, Nanning Zheng, Weizhu Chen, Jian-Guang Lou
Abstract
In-context learning is the paradigm that adapts large language models to downstream tasks by providing a few examples. Few-shot selectionselecting appropriate examples for each test instance separately-is important for in-context learning. In this paper, we propose SKILL-KNN, a skill-based few-shot selection method for in-context learning. The key advantages of SKILL-KNN include: (1) it addresses the problem that existing methods based on pre-trained embeddings can be easily biased by surface natural language features that are not important for the target task; (2) it does not require training or fine-tuning of any models, making it suitable for frequently expanding or changing example banks. The key insight is to optimize the inputs fed into the embedding model, rather than tuning the model itself. Technically, SKILL-KNN generates the skill-based descriptions for each test case and candidate example by utilizing a pre-processing few-shot prompting, thus eliminating unimportant surface features. Experimental results across five cross-domain semantic parsing datasets and six backbone models show that SKILL-KNN significantly outperforms existing methods. DB Schema: employee (name, age, city, …) … Question: Which cities do more than one employee under age 30 come from? Prompting-Based Rewriting Off-the-Shelf Embedding Model Skill-Based Descriptions Input Query Candidate 1:This task requires the greater-than and less-than constraints. Candidate 2:This task requires to apply two constraints on one selected column. Candidate … … Example Bank Skill-Based Selection DB Schema: cinema (name, capacity, location, …) … Question: Find the locations that have more than one movie theater with capacity above 300. SQL Query: SELECT … WHERE capacity > 300 GROUP BY location HAVING count() > 1 DB Schema: endowment (school, donator, amount, …) … Question : Find the number of schools that have more than one donator whose donation amount is less than 8.5. SQL Query: SELECT ... WHERE amount > 8.5 GROUP BY school HAVING count() > 1 … Context DB Schema: employee (name, age, city, …) … Question: Which cities do more than one employee under age 30 come from? In-Context Learning SQL Query: SELECT city FROM employee WHERE age < 30 GROUP BY city HAVING count(*) > 1
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.
18 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Measuring Massive Multitask Language Understanding cites Language Models are Few-Shot Learners
- PURPLE: Making a Large Language Model a Better SQL Writer cites Language Models are Few-Shot Learners
- PURPLE: Making a Large Language Model a Better SQL Writer cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Unraveling the Mechanics of Learning-Based Demonstration Selection for In-Context Learning cites Language Models are Few-Shot Learners
- Unraveling the Mechanics of Learning-Based Demonstration Selection for In-Context Learning cites Calibrate Before Use: Improving Few-shot Performance of Language Models
- A Systematic Survey and Critical Review on Evaluating Large Language Models: Challenges, Limitations, and Recommendations cites Measuring Massive Multitask Language Understanding
- A Systematic Survey and Critical Review on Evaluating Large Language Models: Challenges, Limitations, and Recommendations cites Language Models are Few-Shot Learners
- A Systematic Survey and Critical Review on Evaluating Large Language Models: Challenges, Limitations, and Recommendations cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- HuggingGPT: Solving AI Tasks with ChatGPT and its Friends in Hugging Face cites Language Models are Few-Shot Learners
- HuggingGPT: Solving AI Tasks with ChatGPT and its Friends in Hugging Face cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Chain-of-Thought Prompting Elicits Reasoning in Large Language Models cites Calibrate Before Use: Improving Few-shot Performance of Language Models
- Unveiling Chain of Step Reasoning for Vision-Language Models with Fine-grained Rewards cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Calibrate Before Use: Improving Few-shot Performance of Language Models cites Language Models are Few-Shot Learners
Cited by top-tier papers18
- PURPLE: Making a Large Language Model a Better SQL WriterTonghui Ren, Yuankai Fan, Zhenying He, Ren Huang et al.ICDE 2024 · 49 citations
- A Systematic Survey and Critical Review on Evaluating Large Language Models: Challenges, Limitations, and RecommendationsMd. Tahmid Rahman Laskar, Sawsan Alqahtani, M. Saiful Bari, Mizanur Rahman et al.EMNLP 2024 · 47 citations
- Unraveling the Mechanics of Learning-Based Demonstration Selection for In-Context LearningHui Liu, Wenya Wang, Hao Sun, Chris Xing Tian et al.ACL 2025 · 13 citations
- Fine-tuned LLMs Know More, Hallucinate Less with Few-Shot Sequence-to-Sequence Semantic Parsing over WikidataSilei Xu, Shicheng Liu, Theo Culhane, Elizaveta Pertseva et al.EMNLP 2023 · 10 citations
- Unveiling Chain of Step Reasoning for Vision-Language Models with Fine-grained RewardsHonghao Chen, Xingzhou Lou, Xiaokun Feng, Kaiqi Huang et al.NeurIPS 2025 · 7 citations
Builds on29
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma et al.NeurIPS 2022 · 22,562 citations
- Measuring Massive Multitask Language UnderstandingDan Hendrycks, Collin Burns, Steven Basart, Andy Zou et al.ICLR 2021 · 7,905 citations
- Calibrate Before Use: Improving Few-shot Performance of Language ModelsZihao Zhao, Eric Wallace, Shi Feng, Dan Klein et al.ICML 2021 · 1,843 citations
- HuggingGPT: Solving AI Tasks with ChatGPT and its Friends in Hugging FaceYongliang Shen, Kaitao Song, Xu Tan, Dongsheng Li et al.NeurIPS 2023 · 1,778 citations
Related papers
- Context Tuning for In-Context OptimizationJack Lu, Ryan Teehan, Zhenbang Yang, Mengye RenICML 2026
- Focused Large Language Models are Stable Many-Shot LearnersPeiwen Yuan, Shaoxiong Feng, Yiwei Li, Xinglin Wang et al.EMNLP 2024
- Self-Adaptive In-Context Learning: An Information Compression Perspective for In-Context Example Selection and OrderingZhiyong Wu, Yaoxiang Wang, Jiacheng Ye, Lingpeng KongACL 2023 · 50 citations
- Revisiting In-context Learning Inference Circuit in Large Language ModelsHakaze Cho, Mariko Kato, Yoshihiro Sakai, Naoya InoueICLR 2025
- Code-Style In-Context Learning for Knowledge-Based Question AnsweringZhijie Nie, Richong Zhang, Zhongyuan Wang, Xudong LiuAAAI 2024 · 24 citations
