liveBook · Manning

Language model

As explained in Data Without Labels

A large language model is a machine-learning model trained on very large text collections to understand and generate language.

A language model assigns probabilities to word sequences. It can use preceding words to predict what comes next. Large language models (LLMs) process natural-language inputs for tasks such as answering questions and summarizing documents; applications can access generative-AI capabilities through an API. section 7.11 section 7.3

An n-gram is a simple probabilistic language model. It estimates the probability of the next word from the previous n − 1 words, using how often that sequence occurs in a text corpus. A bigram uses one preceding word; a trigram uses two. N-grams also turn text into feature vectors for further analysis. They illustrate sequence-based prediction without describing how an LLM works internally. section 7.11

Change the amount of context

For “It is raining heavily,” a unigram treats each word separately, a bigram considers pairs, and a trigram considers groups of three. Increasing n changes which preceding words the model can use to predict the next one. section 7.11

For an application, start with the language task rather than the model name. An LLM API may suit document summarization, answers drawn from documents or websites, or customer support. Text still needs a numerical representation for mathematical analysis; preprocessing and representation choices remain important when building a text-data workflow. section 7.3 section 7.20

How Data Without Labels covers it

How deep it goes
Works through n-gram probabilities and context lengths, but does not explain LLM internals or implement an LLM.
Examples
Compares unigrams, bigrams, and trigrams using “It is raining heavily,” then names document summarization and customer support.
What it assumes
Introduces n-grams from a sentence example while assuming only that text must become numbers for analysis.
What you can do after
Evaluate/understand it by distinguishing an n-gram’s limited preceding-word context from the LLM applications described here.
How it connects
Connects n-grams and feature vectors to text representation, and LLMs to natural language processing and generative AI.

Also explained in

Compare how 67 books explain language model →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data Without Labels. The section links point to the parts of the book it draws on.