Skip to main content
QUICK REVIEW

[Paper Review] Charagram: Embedding Words and Sentences via Character n-grams

John Wieting, Mohit Bansal|arXiv (Cornell University)|Jul 10, 2016
Topic ModelingComputer Science46 references44 citations
TL;DR

Charagram introduces a simple yet effective method for learning word and sentence embeddings using character n-grams: it represents sequences as count vectors of character n-grams (n=2,3,4), followed by a single nonlinear transformation to produce low-dimensional embeddings. The approach outperforms complex character-level RNNs and CNNs on word and sentence similarity tasks, achieving state-of-the-art results on SimLex-999 and multiple STS benchmarks, while also showing strong performance on part-of-speech tagging with faster convergence.

ABSTRACT

We present Charagram embeddings, a simple approach for learning character-based compositional models to embed textual sequences. A word or sentence is represented using a character n-gram count vector, followed by a single nonlinear transformation to yield a low-dimensional embedding. We use three tasks for evaluation: word similarity, sentence similarity, and part-of-speech tagging. We demonstrate that Charagram embeddings outperform more complex architectures based on character-level recurrent and convolutional neural networks, achieving new state-of-the-art performance on several similarity tasks.

Motivation & Objective

  • To develop a simple, effective character-based compositional model for word and sentence embeddings that avoids complex architectures like RNNs and CNNs.
  • To evaluate whether character n-gram count vectors with a single nonlinear transformation can match or exceed performance of deep learning models on semantic and syntactic NLP tasks.
  • To investigate the benefits of subword modeling for rare words and morphological variation in text representation.
  • To provide a strong, efficient baseline for subword-aware text representation that is easy to implement and train.

Proposed method

  • Represent each word or sentence as a count vector of character n-grams (n=2,3,4), using a fixed vocabulary of 100,283 n-grams from the PPDB XXL lexical section.
  • Apply a single nonlinear transformation (with learnable weights and bias) to map the n-gram count vector into a low-dimensional embedding space (dimension 300).
  • Train the model using a margin-based contrastive loss that encourages paraphrase pairs to be closer in embedding space than negative examples, with cosine similarity as the metric.
  • Use mini-batch negative sampling strategies (MAX and MIX) to select hard negative examples during training to improve generalization.
  • Tune hyperparameters including activation functions (tanh, linear), regularization (λ ∈ {10⁻⁴, 10⁻⁵, 10⁻⁶}), and batch size (25 or 50).
  • Compare the charagram model against baselines: character-level RNN (charLSTM), character-level CNN (charCNN), and paragram-phrase embeddings.

Experimental results

Research questions

  • RQ1Can a simple character n-gram count vector with a single nonlinear transformation outperform more complex deep learning models like RNNs and CNNs on word and sentence similarity tasks?
  • RQ2To what extent does subword modeling via character n-grams improve performance on rare words and morphological variants?
  • RQ3How do different n-gram vocabulary sizes affect performance across semantic and syntactic tasks?
  • RQ4Can the learned embeddings capture both semantic similarity and morphological/orthographic variation simultaneously?
  • RQ5How does the model’s training speed and convergence compare to more complex architectures like charLSTM and charCNN?

Key findings

  • Charagram achieved state-of-the-art performance on the SimLex-999 word similarity benchmark, outperforming both charLSTM and charCNN models.
  • On the STS 2014 and STS 2015 sentence similarity benchmarks, charagram achieved the highest average Pearson correlation (74.7 and 76.1, respectively), surpassing all baselines.
  • For part-of-speech tagging, charagram reached high accuracy faster than charLSTM and charCNN, converging to performance comparable to the more complex models.
  • The model showed significant gains on rare words, demonstrating the empirical benefit of subword modeling for out-of-vocabulary and morphologically complex words.
  • Larger character n-gram vocabularies provided greater gains on semantic tasks (e.g., similarity) than on syntactic tasks (e.g., POS tagging), though strong performance was still achieved with only a few thousand n-grams.
  • Nearest neighbor analysis confirmed that charagram embeddings capture spelling variation, morphology, and semantic similarity simultaneously, with examples like 'die' and 'mort' being close due to etymological links.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.