Manuscript Offprint

arXiv:2609.01564

From Confusion to Clarity: Confusion-Aware Retrieval and Knowledge Injection for Text Classification

Manish Gupta, Chaitanya Giri, Jayasimha Talur

Abstract

Large language models (LLMs) struggle to classify text into taxonomies with many semantically similar labels, as the distinctions are domain-specific and not captured by pretraining. To handle large label spaces, a common approach retrieves top-K candidate labels by embedding similarity and prompt the LLM to choose among them. However, top-K retrieval reduces the number of candidates but does not help the model tell similar ones apart. When two similar labels both appear as candidates, the model lacks the signal to choose correctly between them. We propose a framework that (1) identifies which label pairs the model struggles to distinguish, (2) expands the candidate set to include confusable labels, and (3) generates targeted rules to differentiate between similar candidates. The framework requires no fine-tuning, and the generated rules transfer to smaller, cheaper models. On three benchmarks (WOS, Flipkart, LEDGAR), our approach improves Macro F1 by up to 10.0pp over retrieval baselines, with smaller models (2B–20B) gaining up to 11.5pp via cross-model transfer.

1 Introduction

Classifying text into taxonomies with hundreds of semantically similar labels is a common industrial requirement, yet remains error-prone even for large language models. Product catalogs, customer service queues, and legal document taxonomies often involve labels that overlap in meaning, frequently organized into multi-level hierarchies. Misclassification in these settings directly degrades search relevance, ticket routing, and compliance filtering.

Large language models (LLMs) provide a zero-shot alternative to supervised classifiers: they require no task-specific training data and can interpret label semantics without fine-tuning. A common approach retrieves the top-K candidate labels

Query & Ground Truth

Query: Book Cover for tablet — genuine product, free shipping, cash on delivery

True label: Mob. & Acc. > Tablet Acc. > Cases & Covers

(a) Retrieval with K = 10

Candidates:

• Computers > Tablet Acc. > Cases & Covers

• Computers > Laptop Acc. > Laptop Bags

• Mob. & Acc. > Mobile Acc. > Pouches

x Correct label not retrieved

LLM Prediction: x WRONG

Computers > Tablet Acc. > Cases & Covers

(b) Retrieval with K = 20

Candidates:

• Computers > Tablet Acc. > Cases & Covers

• Mob. & Acc. > Tablet Acc. > Cases & Covers

• Computers > Laptop Acc. > Laptop Bags

• Mob. & Acc. > Mobile Acc. > Pouches

x Both present, LLM can't distinguish

LLM Prediction: x WRONG

Computers > Tablet Acc. > Cases & Covers

(c) Our Approach

Candidates + confusion partner:

• Computers > Tablet Acc. > Cases & Covers

  • Mob. & Acc. > Tablet Acc. > Cases & Covers — (confusion partner)

• Computers > Laptop Acc. > Laptop Bags

• Mob. & Acc. > Mobile Acc. > Pouches

Disambiguation Rule (X):

Assign 'Mob. & Acc. > Tablet Acc. > Cases & Covers' when query names a specific tablet brand/model and includes consumer design features (ultra-slim, magnetic lock, flip cover). Assign 'Computers > Tablet Acc. > Cases & Covers' when it emphasizes general materials (leather, fabric) or multi-device compatibility.

LLM Prediction:

Mob. & Acc. > Tablet Acc. > Cases & Covers

✓ CORRECT

Figure 1: Example illustrating the benefit of confusion-aware knowledge augmentation. Confusion partners recover missing labels, while learned disambiguation rules help the LLM distinguish semantically similar candidate labels

by embedding similarity and prompts the LLM to select the best match from this reduced set.

However, zero-shot LLMs consistently underperform fine-tuned models on domain-specific taxonomies (Vajjala and Shimangaud, 2025; Loukas et al., 2023). The gap is widest when labels overlap in meaning and only taxonomy-specific conventions separate them: for example, distinguishing “Women’s Western Wear” from “Women’s Ethnic Wear” requires knowing how a particular catalog defines each category. Retrieval helps by narrowing the label space, but when two confusable

∗^{*}Equal contribution.

labels both appear among candidates, the LLM still lacks the signal to choose correctly (Figure 1). Prior work addresses label ambiguity through tournament-style pairwise comparison (Lu et al., 2024) or taxonomy-structure injection (Zang et al., 2025). Neither analyzes which specific pairs the model gets wrong, nor generates targeted rules to fix those errors. By targeting the specific label pairs the model actually fails on, our approach directly addresses the root cause rather than relying on structural or generic signals.

This paper presents Confusion-Aware Knowledge Augmented Classification, a framework that: (1) identifies which label pairs the model struggles to distinguish by analyzing classification errors on a training set; (2) ensures both members of each problematic pair appear in the candidate set at inference time; and (3) generates targeted rules that tell the model how to differentiate between them.

We make the following contributions:

• A candidate augmentation strategy that uses confusion-matrix analysis to ensure systematically confused labels co-occur in the retrieval set.

• A three-stage knowledge generation pipeline that produces pairwise disambiguation rules from misclassified training examples.

• Empirical validation on three datasets and seven models (2B–32B) showing that pairwise disambiguation knowledge consistently improves F1 score, and that knowledge generated once by a large model transfers to smaller, cheaper classifiers without retraining.