Definitionintro
Pointwise mutual information
Also called PMI.
PMI(x, y) = log P(x, y) / (P(x) P(y)), the log ratio of how often two events occur together to how often they would if independent.
Pointwise mutual information compares how often two events occur together with how often they would occur together if they were independent. For events and it is . It is positive when the two occur together more often than chance, zero when they are independent, and negative when they avoid each other. In language processing the events are a word and a context, and PMI is the standard weighting of a word-context matrix: it lowers the weight of frequent contexts such as "the", which occur with every word. Church and Hanks 1990 brought it to lexicography as the association ratio. Its expected value over all pairs is the mutual information of two random variables, which is where the name comes from.
Definition
Let and be random variables with a joint distribution , and let and be values with and . The pointwise mutual information of and is
with the value when . The base of the logarithm is the unit: base 2 gives bits, as in Church and Hanks, and base gives nats. A page or paper that reports values must state the base.
From a word-context matrix with total , the maximum likelihood estimate is
These facts follow from the definition.
- Independence. exactly when .
- Upper bound. Since , , and in the same way . So PMI is at most the self-information of the more probable of the two events, with equality when that event always occurs with the other one. There is no lower bound.
- Symmetry. when both are computed from the same joint distribution. The association ratio of Church and Hanks counts ordered pairs, followed by within 5 words, so it is not symmetric.
- Expectation. , the mutual information, which is the Kullback-Leibler divergence of from the product of its marginals and so is at least 0. Single values of PMI can be negative, but their average under cannot.
Examples and non-examples
The check value. If , and , then , and bit, or nats. The two events occur together twice as often as independence predicts.
A small matrix. A word-context matrix, written for this page, with :
| word | pet | fur | road | the | row sum |
|---|---|---|---|---|---|
| cat | 4 | 3 | 0 | 5 | 12 |
| dog | 5 | 2 | 1 | 6 | 14 |
| car | 0 | 0 | 6 | 8 | 14 |
| column sum | 9 | 5 | 7 | 19 | 40 |
The PMI values in bits, with the ratio in brackets:
| word | pet | fur | road | the |
|---|---|---|---|---|
| cat | 0.5670 (40/27) | 1.0000 (2) | (0) | (50/57) |
| dog | 0.6666 (100/63) | 0.1926 (8/7) | (20/49) | (120/133) |
| car | (0) | (0) | 1.2922 (120/49) | 0.2666 (160/133) |
"Cat" and "fur" occur together twice as often as chance, which is 1 bit. The context "the" has the largest counts in every row, but its PMI is near 0 in every row, since it occurs with every word. The pairs never seen get .
Rare pairs. If a word and a context each occur once in the matrix, and together, then the ratio is and PMI is , which by the upper bound is the largest value any pair can have in that matrix. With it is 5.32 bits, more than every value in the table above, from one observation. This is why PMI is biased toward rare events, and why Church and Hanks left out pairs seen 5 times or less.
Not: mutual information. is one number for two random variables, the average of PMI over all pairs. PMI is a value for one pair. A pair with negative PMI does not make negative.
Not: a probability or a similarity. PMI has no fixed range, and its maximum depends on the frequencies of the two events, so a value of 3 bits means more for two frequent words than for two rare ones. Its values are not comparable across pairs of very different frequency without a correction.
Related definitions
- PPMI. Positive PMI replaces the negative values and by 0, which gives a sparse matrix that works better for word similarity.
- Normalized PMI. Dividing by maps PMI to the range , with 1 when the two events always occur together and when they never do.
- Shifted PMI. is, under some assumptions, the matrix that skip-gram with negative samples factorizes (see the factorization theorem).
- Mutual information and entropy. with the Shannon entropy . Brown clustering keeps the mutual information of the classes of adjacent words as high as possible.
- Other association measures. The likelihood ratio test and the t-test also score how strongly two words go together. They take the size of the sample into account, so a pair seen once does not get the top score.
- Information gain of one event. The form reads PMI as the change in the log probability of when is observed, the difference of two self-information values, .
References
- Church and Hanks 1990, the association ratio, with logarithms to base 2, counts of ordered pairs within a window of 5 words, pairs with counts of 5 or less left out, and values above 3 read as interesting
- Thomas M. Cover and Joy A. Thomas, Elements of Information Theory, second edition, Wiley, 2006, Chapter 2, the definition of mutual information as the expected value of log p(x, y) / (p(x) p(y)) and its nonnegativity
- Levy, Goldberg and Dagan 2015, PMI and its variants as weightings of the word-context matrix, and the bias of PMI toward rare contexts
Where this leads
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag V3AY2H Edit this page History Report an error Markdown