ICS 582Lecture 03Glossary

Glossary

Every term in N-gram language models, defined once and used the same way in every part. Each entry links to the slides where the idea appears.

Terms
55
Letters
21

#

<UNK> token

A single vocabulary item that stands for every out-of-vocabulary word; it changes the vocabulary, so perplexities are comparable only with the same UNK handling, and in Kneser-Ney it is a normal word with count 0 that gets mass only from the uniform floor.

A

Absolute discounting

Subtracting a fixed discount d (about 0.75) from each non-zero count and interpolating with a lower-order distribution.

Add-k smoothing

Adding a fractional count k (such as 0.1 or 0.01, tuned on dev data) to every n-gram instead of one.

B

Backoff

Using the highest-order n-gram if it was seen, otherwise falling back to a lower order.

Backoff weight (lambda)

The normalizing weight d / C(h) times the number of distinct continuations of h, which redistributes exactly the discounted mass.

Bag of words

Treating text as an unordered collection of words; a unigram model is one, since it ignores context and word order.

Berkeley Restaurant Project corpus

A small dialog corpus of 9332 restaurant queries with a vocabulary of about 1446 words, used to illustrate bigram tables.

Bigram

A two-word sequence; a bigram model conditions each word on the one preceding word, P(w_i | w_{i-1}).

C

Chain rule of probability

Decomposes a sequence probability into a product of next-word probabilities, each conditioned on all previous words.

Church and Gale held-out experiment

Bigrams with training count c (2 to 9) occur about c minus 0.75 times on average in an equal-size held-out set.

Context-dependent interpolation

Linear interpolation whose lambda weights depend on the context, trusting higher-order n-grams more when that context has strong counts.

Continuation count

The number of distinct words that precede w in the training data, |{v : C(vw) > 0}|.

Continuation probability

How likely w is to appear as a novel continuation: its continuation count divided by the number of bigram types.

Count of counts (n1, n2)

The number of distinct n-grams seen exactly once (n1) or exactly twice (n2); Ney et al. use them to estimate the discount d = n1 / (n1 + 2 n2).

Cross-entropy

The entropy of the true distribution measured under a model m; it upper-bounds the true entropy, and perplexity equals 2 to its value.

D

Data contamination

Test sentences leaking into training, making probabilities look artificially high and perplexity misleadingly low.

Development set

Held-out data used to tune hyperparameters such as interpolation weights or k in add-k.

Discounting

Reducing the counts of observed n-grams to free probability mass for unseen ones.

E

Entropy

A measure of uncertainty, H(X) = -sum p(x) log2 p(x), in bits; lower entropy means outcomes are easier to predict.

Extrinsic evaluation

Evaluating an LM by its effect inside an application such as speech recognition or machine translation.

G

Genre dependence

An LM encodes the statistics of its training corpus, so a model trained on one genre (Shakespeare) fits another (newswire) poorly.

Greedy decoding

Always emitting the most probable next word instead of sampling from the distribution; deterministic and prone to bland, repetitive text.

H

Held-out data

Data kept out of training (a dev corpus, not the test set) used to set hyperparameters such as interpolation weights and discounts by maximizing its likelihood, equivalently minimizing its perplexity.

Hyperparameter

A setting such as an interpolation weight or smoothing constant chosen on held-out data, not estimated from training counts.

I

Intrinsic evaluation

Evaluating LM quality directly, independent of any application, typically with perplexity.

K

KN count

The count used in recursive Kneser-Ney: raw count at the highest order and continuation count at lower orders.

Kneser-Ney smoothing

Absolute discounting whose lower-order distribution is the continuation probability rather than raw word frequency.

L

Language model

A model that assigns a probability distribution over the next word or token, equivalently a probability to a whole word sequence.

Laplace (add-one) smoothing

Adding one to every count and V to the denominator; simple but moves too much mass to unseen events.

Linear interpolation

Mixing unigram, bigram and trigram estimates with weights lambda that sum to 1, learned on held-out data.

Log probability

Storing and adding logarithms of probabilities instead of multiplying them, to avoid numerical underflow.

M

Markov assumption

Approximates the full history by only the last N-1 words when predicting the next word.

Maximum likelihood estimation

Estimating n-gram probabilities as relative frequencies: the n-gram count divided by the count of its prefix.

Modified Kneser-Ney

Kneser-Ney with three discounts D1, D2 and D3+ for counts of 1, 2 and 3 or more, estimated per order from counts of counts; the standard n-gram baseline in KenLM and SRILM.

N

N-gram

A contiguous sequence of n words or tokens, and by extension the probabilistic model built on their counts.

Neural language model

An LM that represents words or tokens in continuous space and generalizes via similarity instead of exact context matches.

Numerical underflow

A product of many probabilities (each at most 1) becoming too small for floating point and rounding to zero; avoided by adding log probabilities.

O

Overfitting

Higher-order n-grams on small corpora copying training fragments because few continuations follow a long prefix.

P

Perplexity

The inverse probability of a test set normalized by the number of tokens, PP(W) = P(W)^{-1/N}; lower is better.

Pseudo-count

An imaginary count added to every type or possible continuation before normalizing: one in add-one smoothing, k in add-k.

R

Reconstituted count

The count C* implied by a smoothed model, its smoothed probability times the prefix count, compared with the raw count to see how much smoothing changed it.

Relative frequency

A count normalized by the total count of its conditioning context so the values sum to 1.

S

Sampling from an LM

Generating text by repeatedly drawing the next word from the model's conditional distribution until </s> is produced.

Sentence boundary tokens

The symbols <s> and </s> that mark sentence start and end so the model gives a proper distribution over all sentence lengths.

Shannon game

Guessing the next word in a sentence, used as the intuition that a better model gives higher probability to the word that actually occurs.

Smoothing

Shaving probability mass from seen events and giving it to unseen ones so no plausible sequence gets probability zero.

Sparsity

Most possible n-grams never appear in training data, so count tables are mostly zeros, worse as n grows.

Stupid backoff

A web-scale backoff score that uses the relative frequency if seen, otherwise 0.4 times the lower-order score; not a true distribution.

Subword tokenization

Representing text as subword or byte tokens (as in BPE), so any word can be spelled and a test set need not contain unseen tokens even when it contains unseen words.

T

Test set

Unseen data used only for final evaluation, run once or very few times.

Training set

The data used to estimate model parameters (counts).

Trigram

A three-word sequence; a trigram model conditions each word on the two preceding words.

U

Unigram

A single word; a unigram model uses no context and estimates P(w).

W

Weighted branching factor

Interpretation of perplexity as the effective number of equally likely next words given the model's probabilities.

Z

Zero-probability problem

An unseen test n-gram gets probability 0, making the whole sequence probability 0 and perplexity undefined.