MLPs Compass: What is Learned When MLPs are Combined with PLMs?

Li Zhou, Wenyu Chen, Yong Cao, Dingyi Zeng, Wanlong Liu, Hong Qu

TL;DR

While Transformer-based models like BERT are masters of semantic meaning, researchers are still uncovering how they handle structural linguistic information. This paper demonstrates that adding simple Multilayer Perceptrons (MLPs)—without any complex graph machinery—significantly boosts a Pre-trained Language Model's (PLM) ability to understand syntactic and semantic structures, particularly in the model's deeper layers.

What Problem Does This Paper Address?

In the quest to make AI understand language more like humans do, researchers often try to bake "structural bias" into models. For tasks like relation extraction, the standard move is to use Graph Neural Networks (GNNs) to process dependency trees. However, recent surprising results in the field suggest that humble MLPs might be just as good, if not better, at capturing these structures.

The authors of "MLPs Compass" wanted to move beyond just seeing if MLPs help and instead quantify what exactly is being learned. They address a fundamental gap: we know PLMs are powerful, but we don't fully understand the information gain provided when we combine them with "simple" components like MLPs. Does the MLP just act as a better classifier, or does it actually help the model "see" the underlying grammar and logic of a sentence more clearly?

Methods

The researchers employed a performance-based probing methodology. Think of this as a diagnostic test for a neural network.

  1. The Base: They used a standard BERT-base model with 12 layers.
  2. The Freeze: Crucially, they froze the BERT parameters. This ensures that any performance gain comes from the added components, not from BERT "cheating" by adapting its internal weights to the specific test.
  3. The Intervention: They introduced an MLP block between the BERT representations and the final task classifier. They used a ResNet-style architecture, meaning the model looks at both the original BERT output and the MLP-transformed output simultaneously ($MLPs(H) + H$).
  4. The Comparison: They compared the performance of a simple classifier (without MLPs) against the classifier equipped with the MLP block across 10 different linguistic tasks.

Datasets

The study primarily utilized SentEval, a well-known toolkit for evaluating sentence representations. They selected 10 tasks categorized into three levels:

  • Surface Tasks: Sentence Length (SentLen), Word Content (WC).
  • Syntactic Tasks: Tree Depth (TreeDepth), Top Constituents (TopConst), Bigram Shift (BShift).
  • Semantic Tasks: Tense, Subject Number (SubjNum), Object Number (ObjNum), Semantic Odd Man Out (SOMO), Coordination Inversion (CoordInv).

Additionally, they validated the real-world impact using two popular relation extraction datasets: ReTACRED and SemEval-2010 Task 8.

Key Insights and Ideas

  • MLPs as Structural Refiners: The most striking finding is that MLPs aren't just "extra layers"; they specifically help the model organize structural information. Even without being told about "graphs" or "trees," the MLP helps the model extract these patterns from the raw BERT embeddings.
  • The "High-Layer" Advantage: The benefit of MLPs isn't uniform. While performance fluctuates in the lower and middle layers of BERT, the improvements become remarkably consistent and significant in the higher layers (9-12). This suggests that the "raw material" for complex structure is present in BERT's deep layers, but it needs the MLP to "distill" it.
  • Syntactic and Semantic over Surface: MLPs provide a much larger boost to understanding how a sentence is built (syntax) and what it means (semantics) than they do for simple surface-level facts like how many words are in the sentence.

Key Results

  • Clustering Gains: To prove the MLPs were learning better features, the authors used K-means clustering and measured Normalized Mutual Information (NMI). The NMI for Syntactic tasks jumped from 0.14 to 0.57 when MLPs were added—a massive improvement in how well the model's internal representations grouped similar linguistic structures.
  • Probing Accuracy: In tasks like TopConst (identifying the top-level constituents of a syntax tree), adding MLPs consistently improved accuracy across almost all layers, with the highest gains in the final layer (Layer 12).
  • Downstream Impact: On the ReTACRED dataset, adding MLPs to BERT increased the F1 score from 87.66 to 88.05, proving that these probing insights translate to better performance on actual NLP applications.

Limitations and Future Work

The authors acknowledge that while MLPs are effective, they are currently looking at a "black box" combining with another "black box." * Model Scope: The study focused primarily on BERT-base. It remains to be seen if these findings hold for much larger models (LLMs) or different architectures like GPT. * Structural Bias: While the paper shows MLPs work well without structural bias, it doesn't explicitly define the upper limit—could a hybrid approach that uses minimal structural bias perform even better? * Future Direction: The authors suggest that these insights can help researchers craft "variations of PLMs" that are specifically tailored for tasks requiring deep linguistic understanding by strategically placing MLP components.

Summary updated

BibTeX
@inproceedings{zhou2024mlps,
  author = {Li Zhou and Wenyu Chen and Yong Cao and Dingyi Zeng and Wanlong Liu and Hong Qu},
  title = {{MLPs Compass: What is Learned When MLPs are Combined with PLMs?}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2024},
  url = {https://openreview.net/forum?id=JBHcKwg5xY},
}

Loading related content...

Figure