Imputing Out-of-Vocabulary Embeddings with LOVE Makes LanguageModels Robust with Little Cost

Lihu Chen, Gaël Varoquaux, Fabian M. Suchanek

Introduction

Modern Natural Language Processing (NLP) systems typically rely on fixed vocabularies. When these models encounter "Out-of-Vocabulary" (OOV) words—such as rare terminology, slang, or simple typos—they often fail or default to a generic "unknown" token. Even powerful models like BERT are surprisingly brittle; a single character swap can flip a sentiment prediction.

The researchers introduce LOVE (Learning Out-of-Vocabulary Embeddings), a lightweight contrastive learning framework that generates high-quality vectors for words not seen during training. By mimicking the behavior of established models like BERT and FastText using only a word's surface form, LOVE significantly boosts model robustness against typos and rare words with minimal computational overhead.

The OOV Challenge

While some models (like FastText) use character n-grams to handle OOV words, they are often massive in size and expensive to train from scratch. The authors aim to bridge this gap: how can we make existing language models robust to noisy text without the massive "memory tax" of traditional subword models?

The LOVE Framework

LOVE adopts a "mimick-like" approach. Instead of training a whole new language model, LOVE learns to "impute" (estimate) what the embedding of an OOV word should have been by looking at its characters and subwords.

Key technical innovations include:

  • Mixed Input Representation: LOVE uses both characters and subwords to capture low-level spelling (robustness to typos) and high-level morphemes (semantic meaning).
  • Positional Attention Module (PAM): A lightweight encoder that uses positional attention to extract local n-gram features and self-attention to capture global patterns within a single word.
  • Contrastive Learning with Hard Negatives: The model is trained to maximize the similarity between a "clean" word's embedding and its "corrupted" version (e.g., "misspelling" vs. "mispelling"). Crucially, they use hard negatives—words that look similar but mean different things—to force the model to learn fine-grained differences.
The LOVE contrastive learning framework maximizes similarity between clean and corrupted word forms.

Evaluation and Benchmarks

The model was evaluated across a massive battery of tests including 8 intrinsic word similarity datasets and extrinsic tasks like text classification (SST2, MR) and Named Entity Recognition (CoNLL-03, BC2GM). To test robustness, the authors created corrupted versions of these datasets by simulating OCR errors and typos to see how performance degrades as noise increases.

Key Insights

  • Efficiency: LOVE achieves performance comparable to FastText but uses only 6.5 million parameters, compared to FastText’s 900 million. This makes it viable for edge devices or resource-constrained environments.
  • The Power of Corruption: By intentionally "breaking" words during training (swapping letters, dropping characters), the model learns a representation that is inherently "typo-proof."
  • Subwords aren't enough for BERT: BERT’s standard WordPiece tokenization is fragile. When a word is misspelled, it gets broken into entirely different subword pieces. LOVE fixes this by providing a single, stable vector for the whole misspelled string.

Results

LOVE improved the performance of FastText and BERT on noisy text by 1.4 to 6.8 percentage points. In extrinsic tasks like NER, LOVE outperformed other "mimick" models (like MIMICK or BoS) while remaining significantly more parameter-efficient.

Performance of BERT and FastText with and without LOVE as typo probability increases on the SST2 dataset.

As shown in the figure above, LOVE drastically reduces the performance "cliff" usually seen when typos are introduced. Furthermore, LOVE is incredibly fast at inference, producing vectors for 10,000 words in just 0.9 seconds, compared to 380 seconds for a standard Edit Distance baseline.

Conclusion and Future Work

LOVE provides a plug-and-play solution for making language models robust to OOV words with minimal cost. While the current study focuses on English, the principles of character and subword modeling are general. Future work could extend LOVE to a multilingual setting and explore more sophisticated data augmentation strategies to handle diverse types of real-world linguistic noise.

Summary updated

BibTeX
@inproceedings{chen2022imputing,
  author = {Lihu Chen and Gaël Varoquaux and Fabian M. Suchanek},
  title = {{Imputing Out-of-Vocabulary Embeddings with LOVE Makes LanguageModels Robust with Little Cost}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2022},
  doi = {10.18653/v1/2022.acl-long.245},
}
Figure