RAPT: Retrieval-Augmented Post-hoc Thresholding for Multi-Label Classification
This paper introduces RAPT, a model-agnostic, retrieval-augmented post-hoc thresholding wrapper that dynamically adapts label selection thresholds for multi-label classification by leveraging similar historical cases, thereby significantly outperforming static baselines and few-shot LLMs in both accuracy and computational efficiency.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you are a librarian in a massive, chaotic library. Your job is to look at a new book and decide which categories it belongs to—like "History," "Cooking," or "Science."
In the old way of doing things, you’d use a rigid rule: "If the book looks 50% like a history book, tag it as History." But this is problematic. Sometimes a book is 60% history but also 40% cooking (a cookbook about the Roman Empire). A rigid 50% rule might miss the cooking tag entirely, or worse, tag a simple recipe book as "History" because it mentions ancient ingredients.
This paper introduces RAPT, which stands for Retrieval-Augmented Post-hoc Thresholding. Think of RAPT not as a new librarian, but as a smart assistant who stands next to your existing librarian and whispers advice before they make their final decision.
The Problem: The "One-Size-Fits-All" Trap
Most AI systems that sort documents use a global threshold (like that 50% rule). This is brittle.
- Noise: If a document is scanned poorly (OCR noise), the AI gets confused.
- Imbalance: Some categories are rare; others are common. A single rule doesn’t work for both.
- Context: A document about "Waste" might be a legal form in one context and a casual email in another. A fixed rule can’t tell the difference.
The Solution: RAPT’s "Neighborly Advice"
RAPT uses a technique called Case-Based Reasoning. Here’s how it works, step-by-step:
- The First Guess: The main AI model (the "librarian") looks at a new document and gives it scores for every possible label. It also creates a "digital fingerprint" (embedding) of the document.
- Finding Neighbors: RAPT looks at the library’s history. It finds the 10 most similar past documents (neighbors) based on that digital fingerprint.
- Learning from Mistakes: RAPT looks at how those neighbors were actually labeled in the past. It asks: "Did the AI over-tag or under-tag those similar documents? What was the right number of tags for that type of document?"
- Adjusting the Threshold: Instead of using the rigid 50% rule, RAPT adjusts the cutoff for this specific document based on its neighbors.
- Example: If the 10 most similar documents usually had 3 tags, RAPT tells the AI, "Hey, don’t just pick the top 1. Look for the top 3."
- Example: If the similar documents were hard to classify, RAPT might say, "Be stricter. Only pick labels with very high confidence."
Why It’s Better: The "Smart Wrapper"
RAPT is a wrapper. You don’t need to retrain your expensive AI model. You just plug RAPT on top of whatever AI you already have. It works with:
- Metric Learners: AI models that are good at finding similarities.
- Transformers: Large language models (like BERT) that understand text deeply.
The Results: Fast, Cheap, and Accurate
The researchers tested RAPT on industrial documents (from a waste management company) and six public datasets (news, legal, medical, etc.).
- Accuracy: RAPT consistently beat the old "fixed rule" methods. In the industrial test, it achieved an 87% Macro-F1 score (a measure of accuracy across all categories, especially the rare ones).
- Efficiency: This is the big win. Compared to using a massive Large Language Model (LLM) like Qwen to do the same job:
- RAPT was 115 times faster.
- RAPT used 13.5 times less memory.
- RAPT was 2 times more accurate than the LLM in this specific task.
The Creative Analogy: The Thermostat
Think of your AI classifier like a thermostat in a house.
- Old Way (Global Threshold): You set the thermostat to exactly 70°F. But in winter, 70°F feels cold. In summer, 70°F feels hot. The house is uncomfortable.
- RAPT Way (Dynamic Thresholding): RAPT is like a smart sensor that checks what the weather was like in similar houses nearby. If the neighbors are all heating up because it’s a cold snap, RAPT adjusts your thermostat to 72°F. If it’s a mild day, it keeps it at 68°F. It adapts the "comfort level" (threshold) based on local context, not a rigid global rule.
In Summary
RAPT is a lightweight, smart layer that sits on top of existing AI classifiers. It looks at similar past examples to decide how strict or loose the AI should be when tagging a new document. It makes the AI more accurate without needing to retrain it, and it does so much faster and cheaper than using giant, expensive language models.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.