Free AI & NLP Learning Tools

    Interactive tools for understanding how language models actually work, built to be explored, not just used.

    100% client-side. Nothing is uploaded.No signup required

    About these tools

    Large language models are usually described either in hand-waving analogies or in dense mathematics, with very little in between. These tools sit in that gap: they let you build the mechanism yourself, on your own text, and watch what it does. The N-Gram Language Model Lab walks through the foundation that modern language models are built on. You tokenize a body of text, build n-grams from it, and then use those counts to predict the next word, seeing directly how context length changes the prediction, and why longer context both helps and runs into sparsity. It is a genuinely useful mental model. The statistical intuition behind n-grams, that the next token is predicted from the tokens before it weighted by what was observed in training data, is the same intuition that underlies transformer-based models, just with a far simpler mechanism you can inspect end to end.

    Frequently asked questions

    What is an n-gram?

    An n-gram is a contiguous run of n items from a text. In 'the cat sat', the 2-grams (bigrams) are 'the cat' and 'cat sat'. Counting n-grams across a corpus lets you estimate how likely a word is given the words before it.

    How do n-grams relate to modern AI models like ChatGPT?

    They share the core objective, predicting the next token from preceding context, but they differ enormously in mechanism. N-grams count exact sequences seen in training data, while transformers learn continuous representations that generalise to sequences never seen. N-grams are the clearest way to build the intuition.

    Do I need to know how to code?

    No. The lab is fully interactive: you paste text, adjust the settings, and see the tokenization, n-gram counts and predictions rendered directly.

    Is this tool free?

    Yes, and it needs no account. It also requires no API key, because the model is built from your text in your browser rather than calling an external service.