Introduction
Adapting Pre-trained Language Models (PLMs) to downstream tasks via prompt-tuning or prefix-tuning has become a standard practice. By framing classification as a "cloze-style" completion task, these methods leverage the inherent knowledge of PLMs. However, a significant hurdle remains: many-class classification. When dealing with dozens or hundreds of categories, standard methods often falter due to semantic overlap between labels.
The Challenge of Many-Class Classification
The primary issue in large label spaces is verbalizer ambiguity. When classes are numerous, the words chosen to represent them (verbalizers) often share significant semantic meaning. For instance, in fine-grained entity typing, categories like "Person-Actor" and "Person-Employee" both fall under the "Person" umbrella. A standard model might focus on generic attributes—such as a location or the mention of a company—that apply to both classes, failing to capture the specific nuances required to distinguish between them.
Methodology: CCPrefix
To address this, the authors propose CCPrefix (Counterfactual Contrastive Prefix-tuning). Drawing inspiration from social science research, which posits that explanations are most effective when they are contrastive (answering "why A and not B"), CCPrefix generates instance-dependent soft prefixes that highlight the differences between the ground truth and its most confusing alternatives.
The CCPrefix pipeline consists of four key stages:
- Contrastive Generation: For each instance, the model constructs "fact-counterfactual" pairs. It projects sentence representations into a contrastive subspace defined by the difference between label embeddings ($v_{fact} - v_{counterfactual}$).
- Prototype Constraint: To filter noise, the model learns global "prototypes" for contrastive attributes. These prototypes help identify which attributes are truly discriminative across the dataset, ensuring the model isn't distracted by semantically distant or irrelevant labels.
- Prefix Construction: The top-$m$ most relevant contrastive attributes are selected to serve as "soft prefix" tokens, which are then prepended to the input to guide the PLM.
- Siamese Training: A Siamese representation learning objective is employed to align the generated prefix with an "ideal" prefix containing all positive attributes, ensuring training stability.
Evaluation and Results
CCPrefix was evaluated across several many-class benchmarks, including Relation Classification (TACRED, ReTACRED), Topic Classification (DBPedia), and Entity Typing (FewNERD).
The results demonstrate that CCPrefix consistently outperforms strong baselines like PTR and ProtoVerb. Notably, in few-shot settings ($K=1$ or $2$), the model showed substantial gains. For example, on DBPedia with $K=1$, CCPrefix achieved an F1 score of 84.02%, significantly higher than ProtoVerb's 72.85%. In fully supervised Relation Classification on ReTACRED, it reached a state-of-the-art F1 of 91.2%.
Qualitative analysis further reveals that CCPrefix produces more concentrated highlights within a sentence compared to standard methods. Instead of scattered attention, it focuses on determinant keywords—such as "native of" for birth locations—thereby reducing ambiguity.
Limitations and Future Work
While effective, CCPrefix currently assumes all non-gold labels are potential counterfactuals, which may include semantically unrelated noise. Additionally, in tasks with multiple entities, the model can occasionally associate attributes with the wrong entity. Future work aims to adapt this contrastive approach for Causal Language Models (CLMs) and more complex extraction tasks.
Summary updated