Autoregressive Factorization and Decoding

Factor a sequence probability into next-token distributions and distinguish a trained model from the rule selecting outputs.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. Earlier choices become later inputs
  2. Decoding defines how probabilities become a sequence

Earlier choices become later inputs

A left-to-right model represents the probability of tokens \(x_1,\ldots,x_n\) as the product of \(p(x_i\mid x_{<i})\). Log probabilities add. During teacher-forced training, the model can condition on actual earlier tokens. During generation, earlier selected outputs instead determine subsequent inputs. A locally most probable choice can lead to a less probable whole sequence than an initially weaker alternative.

Decoding defines how probabilities become a sequence

Greedy selection, beam exploration and sampling make different decisions from the same distributions. Temperature can change the strength of preferences before sampling. A cache can retain past keys and values, since a causal model’s earlier token does not read appended future tokens. Stable softmax handles normalization. Efficient transformer architectures describe the memory cost of keeping that context.[1][2]

References

  1. Ashish Vaswani et al., Attention Is All You Need ↩
  2. Ian Goodfellow, Yoshua Bengio and Aaron Courville, Deep Learning ↩