Abstract
Adapting pre-trained language models (PrLMs) to new domains has gained much attention recently. Instead of fine-tuning PrLMs as done in most previous work, we investigate how to adapt the features of PrLMs to new domains without fine-tuning. We explore unsupervised domain adaptation (UDA) in this paper. With the features from PrLMs, we adapt the models trained with labeled data from the source domain to the unlabeled target domain. Self-training is widely used for UDA which predicts pseudo labels on the target domain data for training. However, the predicted pseudo labels inevitably include noise, which will negatively affect training a robust model. To improve the robustness of self-training, in this paper we present class-aware feature self-distillation (CFd) to learn discriminative features from PrLMs, in which PrLM features are self-distilled into a feature adaptation module and the features from the same class are more tightly clustered. We further extend CFd to a cross-language setting, in which language discrepancy is studied. Experiments on two monolingual and multilingual Amazon review datasets show that CFd can consistently improve the performance of self-training in cross-domain and cross-language settings.
Introduction
Pre-trained language models (PrLMs) are the backbone of modern NLP, but they are notoriously sensitive to "domain shift"—for example, a model trained on news articles might struggle to classify the sentiment of a snarky Amazon review.
The standard solution is Unsupervised Domain Adaptation (UDA), specifically using self-training: a model trained on a labeled "source" domain predicts labels for an unlabeled "target" domain. These "pseudo-labels" are then used as ground truth for further training. However, pseudo-labels are often noisy and incorrect. If the model learns from its own mistakes, it enters a feedback loop of error. While most research focuses on fine-tuning the entire model, this paper investigates adapting only the features of a frozen PrLM, which is more computationally efficient but requires robust handling of label noise.
Methodology: The CFd Framework
The proposed Class-aware Feature self-distillation (CFd) framework sits on top of a frozen PrLM and consists of three main components designed to extract and refine transferable knowledge.
Feature Adaptation Module (FAM)
Instead of relying solely on the final layer of a PrLM, the FAM uses an attention mechanism to compute a weighted sum of the last $N$ layers (typically 10). This approach captures a richer mix of transferable and discriminative information across the model's hierarchy.
Feature Self-Distillation (Fd)
To ensure the FAM retains the foundational knowledge of the original PrLM, the authors maximize the Mutual Information (MI) between the PrLM's raw features and the FAM's adapted features. Using Noise Contrastive Estimation (NCE), the adapted features are encouraged to maintain the high-quality representations found in the pre-trained model.
Class Information (C) and Selection
To combat pseudo-label noise, an intra-class loss is introduced. The model calculates a "center" for each class in the feature space and forces samples with the same pseudo-label to cluster tightly around that center. This structural regularizer prevents the model from overfitting to individual incorrect labels. Furthermore, a Rank-Diversify Selection strategy is used to select high-confidence, class-balanced pseudo-labels for training.
Experimental Evaluation
The researchers evaluated CFd on major benchmarks including MonoAmazon (English reviews across four domains) and MultiAmazon (multilingual reviews in English, German, French, and Japanese).
Key Results
On the MonoAmazon dataset, CFd achieved an average accuracy of 71.89%, significantly outperforming standard self-training (69.21%) and adversarial methods like MMD (70.05%). The performance gains were consistent across various domain pairs, as shown in the table below.
In cross-lingual and cross-domain settings (e.g., training on English Books and testing on German DVDs), CFd consistently outperformed baselines by 2-3 percentage points. Analysis of the $\mathcal{A}$-distance revealed that CFd drastically reduced domain discrepancy, proving the learned features were becoming truly domain-invariant.
Conclusion
This work demonstrates that a well-adapted feature-based approach can outperform standard fine-tuning by effectively leveraging multi-layer representations. By forcing same-class features to cluster, the model becomes resilient to the noise inherent in unsupervised adaptation. Future work will explore the application of CFd to token-level tasks like Named Entity Recognition and address the sensitivity of the method's hyperparameters.
Summary updated