Language Model Playground
Character-level n-gram text generation with adjustable context length and sampling temperature
Contexts Learned
-
Corpus Size
-
Avg Choices / Step
-
Generation Time
-
Generated Text
Select a corpus and press Generate. Comparing context length 2 and 6 on the same corpus shows the effect of the context window.
Background

Before neural networks, language models were tables of observed continuations like this one. The generation loop is unchanged in modern systems; what changed is the model in the middle, since a neural network can share information between similar contexts and generalize to contexts it has never seen.

The dead end restarts statistic counts contexts that appeared too rarely in the training text to continue from, which becomes more common at higher context lengths and illustrates why larger context windows require more training data.