Skip to content

    n-Gram

    AI fundamentals & modelsSequence of n elements
    Reading time: 2 min.Editorially reviewed on:

    Definition

    An n-gram consists of a specific number of consecutive elements.

    A contiguous sequence of n tokens, characters, or other discrete elements.

    Simply explained

    For words, a bigram is a pair of words and a trigram is a sequence of three words.

    Why it matters in practice

    Helps realistically assess model quality, limits, and technical decisions.

    Example from business

    Possible example: From "Wir liefern morgen" arise the word pairs "Wir liefern" and "liefern morgen" as well as a trigram from all the words.

    Limits and pitfalls

    • Ignore tokenization, sentence boundaries, and data scarcity or equate n-grams with semantics.

    Origin & history

    N-grams are a fundamental building block of classical language models and text analysis.

    Use in mid-sized companies

    • Possible application: A bigram considers word pairs, a trigram sequences of three.

    Frequently asked questions

    What does n-gram mean?

    A contiguous sequence of n tokens, characters, or other discrete elements.

    Which mistakes should be avoided?

    Ignore tokenization, sentence boundaries, and data scarcity or equate n-grams with semantics.

    Sources

    Source checked on 10.10.2026. Editorial application examples are hypothetical; no evidence of real customer results.

    Editorially reviewed on:

    On this page

    Next step

    Put knowledge into practice