PBoS: Probabilistic Bag-of-Subwords for Generalizing Word Embedding

Jinman Zhao, Shawn Zhong, Xiaomin Zhang, Yingyu Liang

Abstract

Word embeddings often struggle with out-of-vocabulary (OOV) words, typically resorting to a generic "unknown" token. While subword-level models like fastText attempt to address this by breaking words into character n-grams, they often fail to distinguish between meaningful and nonsensical subwords. We present PBoS (Probabilistic Bag-of-Subwords), a model that treats words as probabilistic collections of their parts. By modeling subword segmentation and composition simultaneously, PBoS generalizes pre-trained embeddings to unseen words. Experimental results across 23 languages demonstrate that PBoS significantly outperforms existing subword models in word similarity and part-of-speech tagging tasks without requiring external morphological tools.

Introduction

Most popular word embeddings, such as word2vec or GloVe, operate on a fixed vocabulary. When these models encounter an "out-of-vocabulary" (OOV) word—such as a rare technical term, a typo, or new slang—they typically fail. While contextual models like BERT can infer meaning from surroundings, many scenarios involve standalone words (e.g., search queries). Previous subword models like fastText (Bag-of-Subwords) break words into character n-grams but treat every substring with equal weight. For example, in the word "higher," a standard model might weight the nonsensical subword "hig" as heavily as the meaningful root "high."

Methodology

The proposed PBoS (Probabilistic Bag-of-Subwords) model addresses this by modeling the likelihood of different ways a word can be segmented. Instead of a simple sum of all substrings, PBoS employs a two-step process:

  1. Probabilistic Segmentation: The model constructs a directed acyclic graph (DAG) representing all possible ways to split a word. Each edge (subword) is weighted by its frequency in a large corpus.
  2. Expectation-Based Embedding: The final embedding for a word is the mathematical expectation of the embeddings of its segments across all possible paths in the DAG. This weighted average ensures that "meaningful" segments—those appearing in likely segmentations—contribute more to the final vector.
Probabilistic segmentation graph for the word 'higher'.

To maintain efficiency, the authors developed a dynamic programming algorithm that computes these weights in $O(l^2)$ time, where $l$ is the word length. This allows PBoS to remain computationally competitive with simpler models.

Experimental Setup

The researchers evaluated PBoS across several dimensions using pre-trained Polyglot, Google News, and Wikipedia2Vec embeddings as target vectors:

  • Word Similarity: Benchmarked on WordSim353, RareWord (RW), and Card-660 (specifically for rare words).
  • Part-of-Speech (POS) Tagging: Tested on the Universal Dependency (UD) v1.4 dataset across 23 languages.
  • Affix Prediction: Used a derivational morphology dataset to evaluate the model's ability to discover prefixes and suffixes.

Results and Analysis

PBoS demonstrated superior generalization, particularly on the Card-660 dataset (79-90% OOV words), where it consistently outperformed standard Bag-of-Subwords (BoS) and complex attention-based models like KVQ-FH. In the affix prediction task, PBoS achieved an F1 score of 0.829, nearly doubling the performance of the BoS baseline (0.425).

POS tagging accuracy across 23 languages comparing KVQ-FH, BoS, and PBoS.

As shown in the table above, PBoS achieved the best POS tagging accuracy in 22 out of 23 languages. Notably, in Chinese, it improved accuracy by a staggering 20 percentage points over the best baseline. These results highlight several key insights:

  • Morpheme Discovery: PBoS discovers meaningful morphological structures (e.g., "farm" + "land" for "farmland") purely from statistical patterns without explicit linguistic rules.
  • Mutual Exclusivity: By enforcing a probabilistic framework over segmentation paths, PBoS effectively rules out irrelevant overlapping subwords.
  • Universal Applicability: The model shows significant gains across diverse linguistic structures, from complex morphology (Turkish) to isolating languages (Chinese).

Conclusion

While PBoS currently ignores context and can sometimes be sensitive to vector norms, it represents a significant step forward in OOV word generalization. Future work may involve combining PBoS with contextual information or using probabilistic segmentation to train embeddings from scratch on massive corpora. By giving OOV words a "second life," PBoS provides a robust framework for standalone word analysis across the global linguistic landscape.

Summary updated

BibTeX
@inproceedings{zhao2020pbos,
  author = {Jinman Zhao and Shawn Zhong and Xiaomin Zhang and Yingyu Liang},
  title = {{PBoS: Probabilistic Bag-of-Subwords for Generalizing Word Embedding}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2020},
  url = {https://openreview.net/forum?id=Yn-Fa2ePfeC},
}
Figure