[Paper Review] TX-Ray: Quantifying and Explaining Model-Knowledge Transfer in (Un-)Supervised NLP
TX-Ray introduces a novel explainability method for quantifying and visualizing knowledge transfer in NLP models by analyzing neuron activation preferences across pretraining, zero-shot inference, and fine-tuning. It extends activation maximization to NLP, enabling fine-grained tracking of how self-supervised models build linguistic abstractions and how supervision reshapes neuron preferences, with pruning experiments validating its ability to identify task-irrelevant neurons and improve generalization.
While state-of-the-art NLP explainability (XAI) methods focus on explaining per-sample decisions in supervised end or probing tasks, this is insufficient to explain and quantify model knowledge transfer during (un-)supervised training. Thus, for TX-Ray, we modify the established computer vision explainability principle of 'visualizing preferred inputs of neurons' to make it usable transfer analysis and NLP. This allows one to analyze, track and quantify how self- or supervised NLP models first build knowledge abstractions in pretraining (1), and then transfer these abstractions to a new domain (2), or adapt them during supervised fine-tuning (3). TX-Ray expresses neurons as feature preference distributions to quantify fine-grained knowledge transfer or adaptation and guide human analysis. We find that, similar to Lottery Ticket based pruning, TX-Ray based pruning can improve test set generalization and that it can reveal how early stages of self-supervision automatically learn linguistic abstractions like parts-of-speech.
Motivation & Objective
- To address the lack of methods that explain and quantify knowledge transfer during unsupervised and supervised NLP training beyond per-sample decision explanations.
- To enable analysis of how self-supervised models build linguistic abstractions like parts-of-speech during pretraining.
- To measure zero-shot knowledge transfer from pretraining to new domains without retraining.
- To investigate how supervision during fine-tuning reconfigures neuron preferences and transfers knowledge backward into model abstractions.
- To validate the faithfulness of the method by demonstrating that pruning based on TX-Ray measures improves test set generalization.
Proposed method
- TX-Ray adapts activation maximization from computer vision to NLP by modeling neurons as feature preference distributions over discrete inputs like tokens or POS tags.
- It computes and compares activation distributions across three stages: pretraining on a source corpus, zero-shot inference on a target domain, and fine-tuning with supervision.
- Neuron knowledge transfer is quantified by measuring shifts in activation mass distributions, with sparsification indicating specialization and broader distributions indicating generalization.
- The method uses these distributions to guide neuron pruning, where removing neurons with low preference for task-relevant features improves generalization.
- It enables both detailed neuron-level analysis and high-level model overview through visualizations of sorted activation masses across stages.
- The approach is applied to BERT-style encoders and validated on IMDB and WikiText-2 datasets using activation patterns and pruning outcomes.
Experimental results
Research questions
- RQ1How can we explain and quantify knowledge transfer during self-supervised pretraining in NLP models?
- RQ2What knowledge subset do pretrained models apply to a new domain without retraining, i.e., in a zero-shot setting?
- RQ3Can knowledge transfer 'backwards' from supervision labels into a pretrained model’s internal abstractions?
- RQ4Do TX-Ray-based pruning measures identify neurons that, when removed, improve or degrade test set generalization?
- RQ5At what stage of pretraining do models begin to learn linguistic abstractions such as parts-of-speech?
Key findings
- TX-Ray reveals that self-supervision during pretraining automatically learns linguistic abstractions such as parts-of-speech, with neurons showing strong preference for POS tags early in training.
- After fine-tuning on supervised data, neuron activation distributions become significantly sparser (e.g., peak activation mass increases), indicating specialization to the downstream task.
- Pruning based on TX-Ray’s preference distributions improves test set generalization, validating the method’s ability to identify task-irrelevant neurons.
- Supervision not only causes catastrophic forgetting but also activates previously underused neurons, adding new knowledge to previously unpreferred features.
- The method detects domain mismatch between pretraining and zero-shot inference, as shown by broader and weaker activation distributions on out-of-domain data.
- TX-Ray visualizations show that fine-tuned models achieve higher peak activation masses and shorter tails, indicating more focused and task-specific abstractions.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.