Tensor by Tensor

02.13 · UNIT 03 · Text representations and neural language baselines · Lesson

Bigram language models and probabilistic baselines

A bigram model predicts the next token using only the current token.

PLAIN-LANGUAGE INTRODUCTION

What is this?

A bigram model predicts the next token using only the current token.

One simple example

In abab, a→b appears 2 times. b→a appears 1 time.

What goes in?

One current token or its ID.

What comes out?

Counts, probabilities, or scores for the next token.

Why does it matter?

It is a small language-model baseline with visible arithmetic.

What is it not?

A bigram cannot use tokens earlier than the current one.

WORK THROUGH THE IDEA

See the idea in more detail

  1. Read adjacent pairs in abab: ab, ba, and ab.
  2. The count table records a→b = 2 and b→a = 1. Other counts are zero.
  3. For current token a, the observed next-token probability for b is 2/2 = 1.
  4. A learned bigram replaces counts with trainable next-token scores for each current token.
  5. Common mistake: probability 1 describes this tiny text. It does not prove all future text follows that rule.
Open the detailed notes ↗