Automatic Demonstration Selection for LLM-based Tabular Data Classification

Shuchu Han, Wolfgang Bruckner
6/25/2025
cs.LGcs.AI

No confident code implementation found for this paper.

Abstract

A fundamental question in applying In-Context Learning (ICL) for tabular data classification is how to determine the ideal number of demonstrations in the prompt. This work addresses this challenge by presenting an algorithm to automatically select a reasonable number of required demonstrations. Our method distinguishes itself by integrating not only the tabular data's distribution but also the user's selected prompt template and the specific Large Language Model (LLM) into its estimation. Rooted in Spectral Graph Theory, our proposed algorithm defines a novel metric to quantify the similarities between different demonstrations. We then construct a similarity graph and analyze the eigenvalues of its Laplacian to derive the minimum number of demonstrations capable of representing the data within the LLM's intrinsic representation space. We validate the efficacy of our approach through experiments comparing its performance against conventional random selection algorithms on diverse datasets and LLMs.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Cite this paper

@article{han2025automatic,
  title  = {Automatic Demonstration Selection for LLM-based Tabular Data Classification},
  author = {Shuchu Han and Wolfgang Bruckner},
  year   = {2025},
  eprint = {2506.20451},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2506.20451v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2506.20451.svg)](https://codeofpaper.com/paper/2506.20451)

Discussion