Let the Rule Speak: Enhancing In-context Learning Debiasing with Interpretability

Ruixi Lin, Yang You · Submission to ICLR 2025 · Rejected

TL;DR

Large language models performing in-context learning (ICL) often suffer from severe per-class accuracy imbalances, frequently favoring certain output classes over others. FuRud (Fuzzy Rule Optimization based Debiasing) fixes this by learning human-readable, triangular fuzzy membership functions that asymmetrically amplify or dampen specific probability ranges for each class. By optimizing these rules via simulated annealing, FuRud boosts average classification accuracy by 21% (relative) and slashes pairwise class accuracy bias (COBias) by 56% over standard ICL across seven benchmarks.

What Problem Does This Paper Address?

When using ICL for multi-class classification, LLMs are notoriously sensitive to prompt formats, demonstration ordering, and token frequencies. This creates a severe output distribution skew known as class accuracy imbalance (or COBias, which measures the average pairwise difference between per-class accuracies). For instance, an LLM might assign consistently high probabilities to "True" over "False" on entailment tasks, causing near-perfect accuracy on one class but abysmal accuracy on the other.

While existing debiasing strategies—like output distribution calibration or uniform class probability re-weighting—can boost overall accuracy, they act largely as black boxes. They fail to answer:

  1. Which specific classes actually need correction?
  2. Why do they need correction, and how can we apply nuanced, range-specific adjustments (e.g., boosting a class when its predicted probability is ambiguous/low, without uniformly scaling all its outputs)?

Methods

FuRud treats probability correction through the lens of fuzzy rule-based systems, combining human-readable membership functions with combinatorial optimization:

  • Triangular Membership Functions: Instead of multiplying a class’s probability by a flat scalar weight, FuRud maps class output probabilities through triangular membership functions ($f_k$). The candidate pool consists of 19 functions spanning four granularities (slopes of $\pm 1, \pm 2, \pm 4, \pm 8$) plus a crucial "Don’t Change" identity function ($y = x$). This allows the model to leave well-calibrated classes untouched while applying sharp or smooth non-linear corrections to miscalibrated ranges in other classes.
  • Single-Rule Architecture: The debiaser can be interpreted as a single fuzzy rule: $$\text{If class 1 is } A_1 \text{ and } \dots \text{ and class } N \text{ is } A_N \text{ then predict } \arg\max_j f_{A_j}(p_{mj})$$
  • Multi-Objective Simulated Annealing: Selecting the best membership function $\kappa_i$ for each class $i$ is formulated as an integer programming problem. FuRud uses Simulated Annealing (SA) to minimize an energy function balancing three objectives on a small optimization set:
  • Maximize overall accuracy ($Z^{\text{Acc}}$)
  • Minimize class-pair accuracy discrepancy ($Z^{\text{COBias}}$)
  • Penalize extreme low-accuracy classes below a threshold $\lambda = 0.5$ ($Z^{\text{Extreme}}$)

Datasets

The authors evaluated FuRud across seven diverse text classification benchmarks (prompting primarily with Llama-2-13B, alongside Llama-2-7B and GPT2-XL):

  • General / Topic Classification: AGNews (4 classes), DBpedia (14 classes)
  • Sentiment Analysis: SST-5 (5 classes)
  • Question Classification: TREC (6 classes)
  • Natural Language Inference: RTE (binary)
  • Biomedical Domain: DDI (drug-drug interaction, 5 classes), PubMedQA (biomedical QA, 3 classes)

No new datasets were introduced; standard splits and preprocessing from prior literature were used.

Key Insights and Ideas

  • Intra-Class Probability Ranges Matter: Skew does not mean an entire class is uniformly suppressed. Often, a model performs poorly specifically on examples falling into low-to-medium probability intervals (e.g., in AGNews' Business class, samples in $[0.0, 0.4]$ exhibited 0–9% accuracy). FuRud's piecewise triangular functions specifically amplify these misestimated ranges without blindly inflating the whole class.
  • The "Don't Change" Function is Essential: Forcing transformations on every class hurts calibration. Ablation experiments showed that without the identity function, COBias increased by 6%. On DBpedia (14 classes), FuRud assigned "Don't Change" to 4 classes, preventing over-correction on already reliable outputs.
  • Mitigating Letter-Choice Bias: When prompted with multiple-choice letters ("A", "B", "C") rather than natural semantic tokens, LLMs frequently collapse to specific letters (e.g., overwhelmingly predicting "B" for Sports in AGNews). FuRud rescues these scenarios, raising letter-prompt accuracy by 44% relative.

Key Results

  • Overall Benchmark Performance (Llama-2-13B, 1-shot):
  • Accuracy: FuRud reached 72.0% average accuracy across the 7 datasets, outperforming raw ICL (59.4%), Batch Calibration (BC, 62.6%), and Nonlinear Integer Programming (DNIP, 69.2%).
  • COBias: FuRud dropped the average COBias from 40.5% (ICL) down to 17.8% (a 56% relative reduction), performing on par with DNIP (14.3%) and significantly better than BC (27.9%).
  • Hard Classes: On the challenging DDI dataset, FuRud skyrocketed accuracy from 7.2% (ICL) to 69.3%.
  • Few-Shot Data Efficiency: FuRud does not require huge validation sets. With as few as 10 optimization examples, it achieved an average 9% relative accuracy improvement and an 18% COBias reduction over baseline ICL on TREC and SST-5.
  • Letter Option Prompts: Across all 7 datasets, FuRud improved average accuracy from 36.9% to 53.1% and reduced COBias from 47.2% to 21.6%.

Limitations and Future Work

  • Model Scale: Primary experiments focused on smaller open models (GPT2-XL, Llama-2-7B, Llama-2-13B); evaluations on frontier-scale models (70B+ or closed API models) remain for future work.
  • Inter-Class Interactions: FuRud learns independent 1D membership functions per class. While transparent, this single-rule approach cannot explicitly capture complex multi-attribute feature correlations between competing classes.
  • Scope: The evaluation is restricted to classification tasks. Extending interpretable fuzzy debiasing to free-form text generation, reasoning chains, and multimodal inputs is left to future exploration.

Summary updated

Abstract

In-context learning, which allows large language models to perform diverse tasks with a few demonstrations, is found to have imbalanced per-class prediction accuracy on multi-class text classification. Although notable output correction methods have been developed to tackle the issue and simultaneously improve downstream prediction accuracy, they may fail to answer the core interpretability challenges: why and which certain classes need corrections, and more importantly, a tailored correction for per-sample, per-class’s probability. To address such interpretability gaps, we first find that the imbalance arises from certain classes consistently receiving high ICL output probabilities, whereas others receiving lower or mixed ranges, so the former is more frequently chosen, resulting in higher accuracy; more crucially, we find that these ranges have significantly varying degrees of influence on the accuracy bias, highlighting the need for precise, interpretable probability corrections by range. Motivated by this, we propose FuRud, a Fuzzy Rule Optimization based Debiasing method, that (1) detects which classes need corrections, and (2) for each correction-needed class, detects its probability ranges and applies asymmetric amplifications or reductions to correct them interpretably. Notably, across seven benchmark datasets, FuRud reduces the pairwise class accuracy bias (COBias) by more than half (56\%), while achieving a relative increase of 21\% in accuracy, outperforming state-of-the-art debiasing methods. Moreover, FuRud can optimize a downstream task in a few-shot manner, with as few as 10 optimization examples. Furthermore, FuRud can work for prompt formats that lead to highly skewed predictions. For example, FuRud greatly improves ICL outputs which use letter options, with 44\% relative accuracy increase and 54\% relative COBias reduction.
BibTeX
@misc{lin2024let,
  author = {Ruixi Lin and Yang You},
  title = {{Let the Rule Speak: Enhancing In-context Learning Debiasing with Interpretability}},
  year = {2024},
  eprint = {2412.19018},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.19018},
}
Figure