How Much Do Modifications to Transformer Language Models Affect Their Ability to Learn Linguistic Knowledge?

Simeng Sun, Brian Dillon, Mohit Iyyer

Abstract

While large language models (LLMs) demonstrate remarkable grammatical proficiency, the specific training choices that drive the acquisition of linguistic knowledge remain poorly understood. This study investigates the impact of four targeted modifications—Focal Loss, Masked Loss, Auxiliary Syntactic Loss, and Local Attention—on the performance of small-scale Transformer models. Using the Benchmark of Linguistic Minimal Pairs (BLiMP), we demonstrate that while aggregate performance remains largely unchanged across variants, specific architectural and objective-based modifications yield significant improvements in complex linguistic phenomena such as island effects and negative polarity items.

Introduction

Modern Transformer-based language models are often treated as "black boxes," making it difficult to isolate how specific training objectives or design choices influence their grasp of English grammar. To address this, researchers at UMass Amherst trained a suite of controlled Transformer models (16 layers, 100M tokens) to determine if specific tweaks can improve the learning of "hard" linguistic structures.

Methodology

The study compared a baseline Transformer against four variants, each modifying a single component:

  • Focal Loss (FL): A loss function that down-weights "easy" tokens, forcing the model to focus on high-surprisal "hard" tokens.
  • Masked Loss (ML): An extreme variant of Focal Loss that ignores the loss for any token predicted with >90% confidence.
  • Auxiliary Loss (AL): A multi-task approach where the model simultaneously predicts syntactic structures (constituent labels and depth) provided by an external parser.
  • Local Attention (LA): A structural constraint where each token only attends to the five preceding tokens, testing the impact of a strong recency bias.

Models were evaluated using BLiMP, a benchmark consisting of 67 datasets of minimal pairs. A model succeeds if it assigns a higher probability to the grammatical sentence in a pair (e.g., "The cat that meows is hungry" vs. "The cat that meow is hungry").

Results and Analysis

The Deception of Aggregate Scores

At a high level, all models performed similarly, with average accuracies hovering between 75% and 76%. However, this stability masks significant variation at the category and paradigm levels. As shown in Figure 1, different training methods excel in distinct linguistic areas.

Figure 1: Performance of model variants across broad linguistic phenomena.

Granular Improvements in "Hard" Language

Zooming into specific paradigms reveals that targeted modifications can lead to dramatic performance gains in areas where standard models struggle:

  • Syntactic Islands: Using Masked Loss (ML) or Focal Loss (FL) significantly improved the identification of Adjunct Islands. For instance, accuracy in this paradigm jumped from 0.69 in the baseline to 0.89 in the ML variant.
  • Negative Polarity Items (NPIs): Restricting the model to Local Attention (LA) surprisingly aided in identifying the correct scope of NPIs (like the word ever), outperforming the baseline by nearly 20 points in specific tests.
  • Agreement and Ellipsis: Focal Loss improved Determiner-Noun agreement in complex settings (with intervening adjectives), while Local Attention provided a 5% boost in handling ellipsis.
Figure 3: Detailed breakdown of performance across all 67 BLiMP paradigms, highlighting the niche strengths of different model variants.

Discussion and Limitations

The results suggest that there is no "silver bullet" for linguistic training; improvements in one area (e.g., island effects) are often offset by slight regressions in others, leading to the stable average scores observed.

Several questions remain for future research. First, the scale of these models (100M tokens) is small compared to modern LLMs trained on trillions of tokens; it is unclear if these specific benefits persist at scale. Second, while BLiMP measures linguistic knowledge, the downstream impact on tasks like summarization or translation is yet to be determined. Finally, the mechanistic reason why a recency bias (Local Attention) specifically aids NPI scope remains a subject for further investigation.

Conclusion

This research highlights the importance of granular evaluation in language modeling. While standard training objectives produce competent models, specific modifications like Focal Loss and Local Attention can significantly sharpen a model's understanding of the most challenging aspects of human syntax.

Summary updated

BibTeX
@inproceedings{sun2022how,
  author = {Simeng Sun and Brian Dillon and Mohit Iyyer},
  title = {{How Much Do Modifications to Transformer Language Models Affect Their Ability to Learn Linguistic Knowledge?}},
  booktitle = {Insights @ ACL},
  year = {2022},
  doi = {10.18653/v1/2022.insights-1.6},
}
Figure