Linguistic Profiling of a Neural Language Model
Alessio Miaschi, Dominique Brunato, Felice Dell'Orletta, Giulia Venturi
TL;DR
This work probes how a neural language model—specifically BERT—encodes linguistic knowledge across its $12$ transformer layers and how this knowledge shifts after fine-tuning on a native-language identification task. Using $68$ sentence-level probing tasks spanning raw text, morphosyntactic, and syntactic features, applied to the UD English treebanks ($23{,}943$ sentences) and the TOEFL11-based NLI corpus ($33{,}756$ sentences across $10$ language-pair subsets), the authors map internal representations to linguistic properties with a LinearSVR probe. They find that pre-trained BERT encodes a broad spectrum of linguistic phenomena, but fine-tuning tends to reduce this linguistic precision, especially in higher layers. Crucially, the extent to which BERT stores readable linguistic information correlates positively with downstream NLI performance, suggesting that linguistic knowledge supports better predictions and offering insights for improving interpretability of NLMs.
Abstract
In this paper we investigate the linguistic knowledge learned by a Neural Language Model (NLM) before and after a fine-tuning process and how this knowledge affects its predictions during several classification problems. We use a wide set of probing tasks, each of which corresponds to a distinct sentence-level feature extracted from different levels of linguistic annotation. We show that BERT is able to encode a wide range of linguistic characteristics, but it tends to lose this information when trained on specific downstream tasks. We also find that BERT's capacity to encode different kind of linguistic properties has a positive influence on its predictions: the more it stores readable linguistic information of a sentence, the higher will be its capacity of predicting the expected label assigned to that sentence.
