Enhancing Out-of-Vocabulary Estimation with Subword Attention

Raj Patel, Carlotta DomeniconiACL 2023

Introduction

Static word embeddings like word2vec and GloVe are fundamental to natural language processing (NLP), yet they face a significant "cold start" challenge: the inability to represent out-of-vocabulary (OOV) words not present in the training corpus. When encountering a new technical term or a rare misspelling, these models typically revert to a generic "unknown" token, discarding essential semantic information.

In this work, Patel and Domeniconi (ACL 2023) introduce SubAtt, a Transformer-based model designed to estimate OOV embeddings by leveraging both the internal structure of the word and its surrounding context.

The OOV Problem and Current Limitations

Existing approaches to OOV estimation generally rely on two signals: the surface form (subwords or character n-grams) and the context (surrounding words). While context processing has advanced through attention mechanisms, subword processing often remains simplistic, relying on n-gram summation or basic convolutional neural networks (CNNs). SubAtt addresses this gap by applying self-attention at the subword level, allowing the model to dynamically weigh the importance of different morphological components.

Methodology: The SubAtt Architecture

SubAtt utilizes a dual-stream architecture to process form and context independently before merging them:

  1. Pretrained Subword Representations: Character n-gram embeddings are pretrained by maximizing cosine similarity between the average of a word's n-grams and its actual pretrained word embedding.
  2. Subword Stream: A sequence of subword embeddings is passed through an 8-layer Transformer encoder. This enables the model to identify which subwords (e.g., the root "happi" in "unhappiness") are most semantically informative.
  3. Context Stream: Sentences containing the OOV word are processed via a Transformer-based context encoder to generate a contextualized representation.
  4. Gated Combination: An adaptive gating mechanism uses a learned weight to balance the subword and context estimates, favoring the more reliable signal based on the input.

Evaluation and Results

The model was evaluated on the Contextualized Rare Word (CRW) task and several downstream applications, including Named Entity Recognition (NER) and Part-of-Speech (POS) tagging.

Intrinsic Performance

On the CRW task, which measures correlation with human similarity judgments, SubAtt consistently outperformed state-of-the-art models like HiCE and Attentive Mimicking (AM) across all context sizes, from 1 to 128 sentences.

SubAtt performance on the CRW task compared to baselines across varying context sizes.

Downstream Applications

SubAtt demonstrated superior performance in extrinsic tasks, achieving the highest Macro F1 scores in the majority of tested datasets. Notably, on the Twitter POS tagging task, SubAtt reached an F1 of 0.5098, significantly exceeding the 0.4453 achieved by HiCE.

Comparison of SubAtt and baseline models across various downstream NLP tasks.

Key Insights

  • Subword Attention: Treating subwords as a sequence rather than a "bag of n-grams" allows the model to capture the semantic hierarchy within a word.
  • Pretraining Synergy: Pretraining subword embeddings provides a robust foundation, particularly beneficial when context is sparse.
  • Contextual Robustness: SubAtt's most significant gains occur in "low-information" scenarios with limited context, where its advanced subword processing compensates for missing environmental cues.

Conclusion and Future Directions

SubAtt establishes a new benchmark for OOV estimation in static embeddings. While currently focused on English, future research may explore its impact on morphologically rich languages where subword structure is even more critical. Additionally, adapting these principles to modern Transformer-based language models could further improve their handling of rare and technical vocabulary.

Summary updated

BibTeX
@inproceedings{patel2023enhancing,
  author = {Raj Patel and Carlotta Domeniconi},
  title = {{Enhancing Out-of-Vocabulary Estimation with Subword Attention}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.findings-acl.221},
}
Figure