Paper commentary
The Google Similarity Distance
Web page counts can measure how similar two words are
- Problem Expert-built resources like WordNet need long manual curation and hold far less than the web does. Computers need a way to capture word meaning at web scale.
- Method The Google similarity distance scores two terms with page counts from Google, alone and together. It needs no expert-built categories.
- Results SVM classifiers trained on these distances agreed with WordNet's expert categories at a mean accuracy of 0.8725.
Why hand-built word resources fall short
Computers need some representation of what words mean, and the usual route is expert-built resources. Projects such as Cyc and WordNet relate common objects and names through long, labor-intensive curation. Their output is tiny compared with what ordinary users have typed onto the web. The authors bet that the sheer mass of that text lets extremes cancel, so the average stays meaningful in a rough sense.
Page counts as a distance
The key idea is to read relatedness from how often two terms occur on pages, alone and together. Each search term's Google semantics is simply the set of pages Google returns for it. The authors ignore where on a page a term appears and how many times it appears. This lets page counts stand in for meaning without any feature extraction.
Let f(x) be the number of pages containing term x, f(x,y) the number containing both, and N the normalizing index size. The Normalized Google Distance is then computed as follows. \[ NGD(x,y) = \frac{\max\{\log f(x), \log f(y)\} - \log f(x,y)}{\log N - \min\{\log f(x), \log f(y)\}} \] The numerator is the larger single-term log count minus the joint log count.
The denominator is log N minus the smaller single-term log count. The authors often set N to M, the number of indexed pages, and they report that results seem insensitive to this choice. A larger N pulls the terms closer together, and a smaller N pushes them apart.
For horse and rider, the paper's example uses 46,700,000 hits for horse, 12,200,000 for rider, and 2,630,000 for both. With N = 8,058,044,651 this gives an NGD of about 0.443. When Google indexed about half as many pages, the value rose to about 0.460. The authors read the small shift as evidence that relative frequencies carry the signal rather than raw counts.
Why the web's counts should form a usable distribution
Each indexed page is treated as equally likely, so a single term's probability is its page count divided by M. For a pair of terms, the normalizing sum N turns joint counts into a distribution over all singleton and doubleton terms. Taking the negative log of these probabilities gives the Google code, which measures the information content of each term.
The authors also split the web into individual authors and ask whether the global distribution covers each one. A distribution is universal when it dominates every other member of a family up to a constant factor. The authors prove that the overall Google distribution is universal for the individual author distributions. Because the overall probability is a weighted sum of the author distributions, each author's weight bounds it from below.
The theory assumes that page counts approximate how society actually uses words. The authors rest this on earlier linguistics studies rather than testing it here.
What the distance guarantees
NGD is nonnegative, symmetric, and zero for identical terms. It is not a metric, though, because it can be zero for terms that are not identical. The authors build a case where the triangle inequality fails for every N, with NGD(x,y) infinite while NGD(x,z) and NGD(z,y) are 2/log N. The experiments below use NGD values as features, so the missing metric property matters less there.
Clustering, classification and translation results
For hierarchical clustering the authors build a ternary tree from the matrix of pairwise NGDs. On color and number terms, the tree puts colors on one side and numbers on the other. Ambiguous terms such as black, white, zero, one and two sit nearer the centre. The authors present this as a qualitative result, with no baseline to compare against.
For classification, each training word becomes a vector of NGD values to a set of anchor words, and an SVM learns from those vectors. For emergencies, with six anchors and 22 positive and 25 negative training cases, the classifier scored 75.00% on its test cases. For primes, with five anchors and 21 positive and 22 negative training cases, the test accuracy was 94.74%, or 18 of 19 cases.
Each test set has only 19 or 20 cases, so these scores are illustrations more than firm estimates.
For translation, the authors compute NGD matrices over known English words and over candidate orderings of the Spanish words. They keep the Spanish permutation whose NGD matrix correlates most positively with the English one. In this example the method recovered the correct permutation for the testing words.
Agreement with WordNet over 100 categories
The authors test agreement with WordNet on 100 randomly selected semantic categories. For each category the SVM trains on 50 labelled samples, with positives drawn from WordNet and negatives drawn from a dictionary. Each run uses six anchors, three from the category and three from the dictionary. Kernel width and error cost are set by five-fold cross validation, and the classifier is tested on 20 new balanced examples.
Across the 100 runs the mean accuracy of agreement was 0.8725. The variance was about 0.01367, which gives a standard deviation of about 0.1169. The authors say agreement below 75% is rare in these runs.
The authors read this as the NGD-based learner agreeing well with expert categories on average. The electrical-terms category reached 100% accuracy in one run, which is a single category rather than a broad result. The authors bound the full trial at 126,000 Google searches, and reuse of anchor counts reduced the per-experiment total to 496.
The authors treat the dictionary negatives as nearly always true negatives, which they consider negligible as a source of error.
Limits of the evidence
Google's returned counts are inaccurate in some cases, especially when the OR operator is used. Google estimates hit counts from samples and its index changes quickly, so the authors added a normalizing mechanism in CompLearn. Google limits each IP address to 500 queries per day, although it extended this quota for noncommercial use. Each experiment can take hours because of the Googling, network traffic and tree layout.
The authors argue that a smaller corpus would weaken results, and they chose not to test that. The large test uses only WordNet as its reference, and the clustering results have no baseline. NGD is not a metric, and the counts are assumed to reflect real word usage.
Paper info
- Authors
- Rudi Cilibrasi, Paul M. B. Vitanyi
- Venue
- arXiv · Preprint
- First published
- 2004-12-21
- Added
- 2026-11-12
- Updated
- 2007-5-30
- Version
- v3
- arXiv
- cs/0412098
- Category
- cs.CL · cs.AI · cs.DB · cs.IR · cs.LG
- Original paper terms
- Check in the original ↗
- What we show
- Paper info and commentary
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Quote from the paper
Rudi Cilibrasi, Paul M. B. Vitanyi (2004). The Google Similarity Distance. arXiv:cs/0412098v3. https://arxiv.org/abs/cs/0412098v3
BibTeX
@misc{cilibrasi2004google,
title = {{The Google Similarity Distance}},
author = {Rudi Cilibrasi and Paul M. B. Vitanyi},
year = {2004},
eprint = {cs/0412098},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/cs/0412098v3}
}