LexFit: Lexical Fine-Tuning of Pretrained Language Models

Ivan Vulic, Edoardo Maria Ponti, Anna Korhonen, Goran Glavas

Abstract

While Transformer-based Language Models (LMs) like BERT excel at processing text in context, they often struggle to represent words in isolation, frequently capturing topical relatedness rather than semantic similarity. We present LEXFIT, a lightweight fine-tuning procedure that "rewires" pretrained LMs to function as high-quality, static word embedders. Using a dual-encoder setup and minimal lexical constraints, LEXFIT extracts "decontextualized" word vectors that significantly outperform traditional models like fastText and vanilla BERT across multiple languages and lexical tasks, demonstrating extreme sample efficiency.

Introduction

Traditional static embeddings like fastText are efficient but lack the deep linguistic knowledge found in massive LMs. Conversely, vanilla BERT's representations of isolated words often fail to distinguish between semantic similarity (e.g., "bank" as a financial institution) and topical relatedness (e.g., "bank" and "river"). LEXFIT bridges this gap by unlocking and refining the latent lexical knowledge inside BERT to create a superior static word encoder.

Methodology

The LEXFIT pipeline consists of two primary steps:

  1. Lexical Fine-Tuning: The LM is integrated into a dual-encoder (Siamese) architecture with shared weights. It is trained on word pairs $(w, v)$ from external lexical resources like WordNet. Three loss functions are explored: Classification (Softmax) for relation prediction, Multiple Negatives Ranking (MNEG) for contrastive learning, and Multi-Similarity (MSIM) for weighted metric learning.
  2. Extraction: Post-tuning, word vectors are extracted by feeding words into the model in isolation (ISO). The final representation typically averages subword encodings across all layers.
The LEXFIT two-step pipeline: Lexical fine-tuning followed by word embedding extraction.

This post-hoc process is highly efficient, requiring only a small set of word pairs rather than massive corpora or full retraining.

Experimental Setup

LEXFIT was evaluated across eight languages (EN, DE, ES, FI, IT, PL, RU, TR). Training utilized synonyms and antonyms from WordNet and Roget’s Thesaurus, with automatic translations for non-English languages. Benchmarks included Multi-SimLex for multilingual similarity, SimVerb-3500, SimLex-999, WordNet-based RELP for relation prediction, and MUSE for Bilingual Lexicon Induction (BLI).

Key Results and Insights

Performance and Efficiency

LEXFIT-ed BERT shows massive performance gains. On the English Multi-SimLex task, it achieved a Spearman’s correlation of ~74.3, compared to vanilla BERT’s ~51.8 and fastText’s 44.2. Notably, the model exhibits extreme sample efficiency, reaching significant gains with as few as 5,000 training pairs.

Performance across LSIM, BLI, and RELP tasks relative to the number of LEXFIT fine-tuning examples.

The "Rewiring" Hypothesis

The success of LEXFIT on pretrained models versus its failure on randomly initialized ones suggests that lexical knowledge is already latent within the LM. LEXFIT acts as a "rewiring" mechanism that makes this knowledge accessible for decontextualized use.

Layer Migration and Task Specificity

Fine-tuning causes useful lexical information to migrate from lower layers to the entire network depth, necessitating an average across all layers for optimal results. Furthermore, the choice of loss function is task-dependent: ranking losses (MNEG/MSIM) excel at similarity tasks, while classification loss is superior for relation tasks like antonym detection.

Conclusion and Future Work

LEXFIT successfully transforms contextual LMs into powerful static embedders. While it improves multilingual BERT (mBERT), a performance gap remains compared to monolingual models, likely due to mBERT's capacity constraints. Future work will explore the use of "hard negatives" and more robust native multilingual resources to further refine lexical precision.

Summary updated

BibTeX
@inproceedings{vulic2021lexfit,
  author = {Ivan Vulic and Edoardo Maria Ponti and Anna Korhonen and Goran Glavas},
  title = {{LexFit: Lexical Fine-Tuning of Pretrained Language Models}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2021},
  doi = {10.18653/v1/2021.acl-long.410},
}
Figure