Contrast Is All You Need
Burak Kilic, Florix Bex, Albert Gatt
TL;DR
This work tackles data-scarce, imbalanced legal text classification by comparing SetFit, a contrastive finetuning approach, to vanilla finetuning on the LEDGAR dataset. It employs a two-stage SetFit process (contrastive fine-tuning of a Sentence Transformer followed by a logistic head) and analyzes decision rationales with LIME to assess reliance on legally informative features. Results show SetFit yields better or comparable performance with far fewer labeled samples, and LIME reveals that the contrastive objective emphasizes legally relevant features more strongly than standard finetuning. The findings support using contrastive, data-efficient methods for legal NLP tasks and highlight the value of explainability analyses in assessing model trustworthiness and feature use.
Abstract
In this study, we analyze data-scarce classification scenarios, where available labeled legal data is small and imbalanced, potentially hurting the quality of the results. We focused on two finetuning objectives; SetFit (Sentence Transformer Finetuning), a contrastive learning setup, and a vanilla finetuning setup on a legal provision classification task. Additionally, we compare the features that are extracted with LIME (Local Interpretable Model-agnostic Explanations) to see which particular features contributed to the model's classification decisions. The results show that a contrastive setup with SetFit performed better than vanilla finetuning while using a fraction of the training samples. LIME results show that the contrastive learning approach helps boost both positive and negative features which are legally informative and contribute to the classification results. Thus a model finetuned with a contrastive objective seems to base its decisions more confidently on legally informative features.
