MarginSel : Max-Margin Demonstration Selection for LLMs

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Ambati, Rajeev Bhatt, Lester, James, Srivastava, Shashank, Chaturvedi, Snigdha
Format: Preprint
Publié: 2025
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866915332952686592
author Ambati, Rajeev Bhatt
Lester, James
Srivastava, Shashank
Chaturvedi, Snigdha
author_facet Ambati, Rajeev Bhatt
Lester, James
Srivastava, Shashank
Chaturvedi, Snigdha
contents Large Language Models (LLMs) excel at few-shot learning via in-context learning (ICL). However, the effectiveness of ICL is often sensitive to the selection and ordering of demonstration examples. To address this, we present MarginSel: Max-Margin Demonstration Selection for LLMs, a two-step method that selects hard demonstration examples for the ICL prompt, adapting to each test instance. Our approach achieves 2-7% absolute improvement in F1-score across classification tasks, compared to a random selection of examples. We also provide theoretical insights and empirical evidence showing that MarginSel induces max-margin behavior in LLMs by effectively increasing the margin for hard examples, analogous to support vectors, thereby shifting the decision boundary in a beneficial direction.
format Preprint
id arxiv_https___arxiv_org_abs_2506_06699
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle MarginSel : Max-Margin Demonstration Selection for LLMs
Ambati, Rajeev Bhatt
Lester, James
Srivastava, Shashank
Chaturvedi, Snigdha
Machine Learning
Artificial Intelligence
Computation and Language
Large Language Models (LLMs) excel at few-shot learning via in-context learning (ICL). However, the effectiveness of ICL is often sensitive to the selection and ordering of demonstration examples. To address this, we present MarginSel: Max-Margin Demonstration Selection for LLMs, a two-step method that selects hard demonstration examples for the ICL prompt, adapting to each test instance. Our approach achieves 2-7% absolute improvement in F1-score across classification tasks, compared to a random selection of examples. We also provide theoretical insights and empirical evidence showing that MarginSel induces max-margin behavior in LLMs by effectively increasing the margin for hard examples, analogous to support vectors, thereby shifting the decision boundary in a beneficial direction.
title MarginSel : Max-Margin Demonstration Selection for LLMs
topic Machine Learning
Artificial Intelligence
Computation and Language
url https://arxiv.org/abs/2506.06699