Table of Contents
Fetching ...

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.

Linguistic Profiling of a Neural Language Model

TL;DR

This work probes how a neural language model—specifically BERT—encodes linguistic knowledge across its transformer layers and how this knowledge shifts after fine-tuning on a native-language identification task. Using sentence-level probing tasks spanning raw text, morphosyntactic, and syntactic features, applied to the UD English treebanks ( sentences) and the TOEFL11-based NLI corpus ( sentences across 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.

Paper Structure

This paper contains 15 sections, 6 figures, 4 tables.

Figures (6)

  • Figure 1: BERT average layerwise $\rho$ scores.
  • Figure 2: Layerwise $\rho$ scores for the 68 linguistic features. Absolute baseline scores are reported in column B.
  • Figure 3: Hierarchical clustering of the 68 probing tasks based on layerwise $\rho$ values. Bold numbers correspond to the ranking of each probing feature based on the correlation with sentence length.
  • Figure 4: Layerwise mean $\rho$ scores for the pre-trained and fine-tuned models.
  • Figure 5: Differences between BERT--base and fine--tuned models $\rho$ scores (multiplied by 100) computed using the output layer representations (-1). Statistically significant variations (Wilcoxon Rank-sum test) are marked (*).
  • ...and 1 more figures