In-Context Learning for Extreme Multi-Label Classification

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: D'Oosterlinck, Karel, Khattab, Omar, Remy, François, Demeester, Thomas, Develder, Chris, Potts, Christopher
Format: Preprint
Publié: 2024
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866929218505408512
author D'Oosterlinck, Karel
Khattab, Omar
Remy, François
Demeester, Thomas
Develder, Chris
Potts, Christopher
author_facet D'Oosterlinck, Karel
Khattab, Omar
Remy, François
Demeester, Thomas
Develder, Chris
Potts, Christopher
contents Multi-label classification problems with thousands of classes are hard to solve with in-context learning alone, as language models (LMs) might lack prior knowledge about the precise classes or how to assign them, and it is generally infeasible to demonstrate every class in a prompt. We propose a general program, $\texttt{Infer--Retrieve--Rank}$, that defines multi-step interactions between LMs and retrievers to efficiently tackle such problems. We implement this program using the $\texttt{DSPy}$ programming model, which specifies in-context systems in a declarative manner, and use $\texttt{DSPy}$ optimizers to tune it towards specific datasets by bootstrapping only tens of few-shot examples. Our primary extreme classification program, optimized separately for each task, attains state-of-the-art results across three benchmarks (HOUSE, TECH, TECHWOLF). We apply the same program to a benchmark with vastly different characteristics and attain competitive performance as well (BioDEX). Unlike prior work, our proposed solution requires no finetuning, is easily applicable to new tasks, alleviates prompt engineering, and requires only tens of labeled examples. Our code is public at https://github.com/KarelDO/xmc.dspy.
format Preprint
id arxiv_https___arxiv_org_abs_2401_12178
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle In-Context Learning for Extreme Multi-Label Classification
D'Oosterlinck, Karel
Khattab, Omar
Remy, François
Demeester, Thomas
Develder, Chris
Potts, Christopher
Computation and Language
Artificial Intelligence
Multi-label classification problems with thousands of classes are hard to solve with in-context learning alone, as language models (LMs) might lack prior knowledge about the precise classes or how to assign them, and it is generally infeasible to demonstrate every class in a prompt. We propose a general program, $\texttt{Infer--Retrieve--Rank}$, that defines multi-step interactions between LMs and retrievers to efficiently tackle such problems. We implement this program using the $\texttt{DSPy}$ programming model, which specifies in-context systems in a declarative manner, and use $\texttt{DSPy}$ optimizers to tune it towards specific datasets by bootstrapping only tens of few-shot examples. Our primary extreme classification program, optimized separately for each task, attains state-of-the-art results across three benchmarks (HOUSE, TECH, TECHWOLF). We apply the same program to a benchmark with vastly different characteristics and attain competitive performance as well (BioDEX). Unlike prior work, our proposed solution requires no finetuning, is easily applicable to new tasks, alleviates prompt engineering, and requires only tens of labeled examples. Our code is public at https://github.com/KarelDO/xmc.dspy.
title In-Context Learning for Extreme Multi-Label Classification
topic Computation and Language
Artificial Intelligence
url https://arxiv.org/abs/2401.12178