liveBook · Manning

Language model

As explained in The AI Pocket Book

A neural language model trained on large text corpora to predict and generate natural language.

A large language model (LLM) is a language model trained on enormous text collections to predict and generate language. Its core job is narrower than the hype suggests: given a prompt, it predicts what token should come next. Repeating that step produces full responses. section 1.1 section 1.34

Autocomplete that reaches surprisingly far

Given “The Eiffel,” an LLM may assign high probability to “Tower.” Given “How much is 2 + 5? It is. . .,” completing the sentence requires arithmetic. A translation prompt similarly turns next-token prediction into a translation task. section 1.1

An LLM generates an answer through a sequence of linked operations:

  • Tokenizes the input into common words, word fragments, characters, and special symbols drawn from a fixed vocabulary. section 1.8
  • Represents tokens as embedding vectors, then uses the transformer architecture to make each token sensitive to its context. section 1.34
  • Calculates a probability for every possible next token rather than selecting a word directly. section 1.21
  • Lets a wrapper choose a token, append it to the prompt, and repeat the process until a complete output is produced. section 1.21 section 1.34

Training uses machine learning to define the model’s missing parameters from large datasets. Popular LLMs are first trained automatically from public data, then refined with manually generated data to align their behavior with user objectives. section 1.1 section 1.34

An LLM is self-contained and static after training: it does not browse the web for each prediction and needs updated training data to discuss newer events. A system prompt or wrapper can add context before the user’s prompt, but that context comes from surrounding software. section 1.1 section 1.5

Table 1.1 In the last step, the LLM assigns a probability value
for each possible token in the vocabulary. All the values add to 1.

0.01

0.0

0.05

…

0.8

…

“a”

“b”

“c”

“audible”

Use the probability table to see that the model assigns a value to every possible token; the wrapper then selects among those values. section 1.21

How The AI Pocket Book covers it

How deep it goes
Traces tokenization, embeddings, contextualization, probabilities, and wrapper-driven generation, but defers exact internal calculations.
Examples
Uses Eiffel Tower completion, arithmetic, translation, token probability tables, and system-prompt date responses.
What it assumes
Starts from ordinary autocomplete examples while introducing tokens, embeddings, transformers, and machine learning.
What you can do after
Evaluate how prompts, token probabilities, wrappers, and injected context shape an LLM’s response.
How it connects
Connects tokens, embeddings, transformers, machine learning, system prompts, wrappers, and multimodal 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 The AI Pocket Book. The section links point to the parts of the book it draws on.