liveBook · Manning

Language modeling

As explained in LLMs in Production

Language modeling is the task of learning the statistical structure of language so a system can predict or generate text.

Language modeling learns the statistical structure of language so systems can predict or generate text. Its practical value depends on more than producing plausible sentences: language carries ambiguity, lost context, and meaning that does not necessarily correspond to reality. section 2.0 section 2.5

A useful mental model treats language as an abstraction layered between human thoughts and machine-readable representations. Each abstraction—from meaning to language, tokens, embeddings, and model computations—can discard information or introduce failure. section 2.1

Language-modeling approaches have evolved by adding capabilities for representing structure and context:

  • N-grams and naive Bayes classifiers provide early statistical approaches. section 2.0
  • MLPs, recurrent neural networks, and LSTMs extend modeling with neural representations and sequential processing. section 2.0
  • Transformers use attention to handle larger context windows and support modern encoder, decoder, and combined architectures. section 2.5
  • Tokenization contributes morphology, while embeddings improve semantic approximations; pragmatics generally requires additional engineering. section 2.5

From impressive demo to dependable product

IBM Watson defeated elite Jeopardy contestants and attracted commercial interest, including healthcare applications, but those applications failed to become profitable. The contrast illustrates the central production lesson: a prototype needs to work once, while a product must work reliably for many users amid language’s nuances. section 1.3

Figure 2.1 We compare cognitive layers of abstraction to programming layers of abstraction down to the logical binary abstraction. Python doesn’t come from C, nor does it compile into C. Python is, however, another layer of abstraction distant from binary. Language follows a similar path. Each layer of abstraction creates a potential point of failure. There are also several layers of abstraction to creating a model, and each is important in seeing the full path from our feelings to a working model.
figure

Trace the parallel abstraction layers from human cognition through language and programming representations to binary, and identify where information loss or failure can arise. section 2.1

How LLMs in Production covers it

How deep it goes
Traces modeling from statistical methods through neural networks and transformers, while stopping short of formal derivations.
Examples
Uses abstraction layers, historical model families, and IBM Watson’s commercialization failure to illustrate capabilities and limits.
What it assumes
Builds from basic language, meaning, abstraction, and programming concepts before surveying model architectures.
What you can do after
Evaluate language-modeling approaches and anticipate how linguistic abstractions, architecture, and production constraints affect results.
How it connects
Connects language modeling to linguistics, semiotics, tokenization, embeddings, attention, transformers, encoders, and decoders.

Also explained in

Compare how 4 books explain language modeling →

Related concepts

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