liveBook · Manning

Machine learning

As explained in The AI Pocket Book

A field that builds systems that learn patterns from data to perform tasks.

Machine learning is a way to create programs by giving a computer data instead of writing every behavior by hand. An engineer designs the model’s architecture; training fills its parameters with values that improve performance on a task. section 1.25

Teaching a model from examples

An LLM learns from large amounts of text. Self-supervised training automatically creates examples by asking the model to predict missing or next tokens; later, manually generated examples can refine its behavior toward user goals. The result is useful, but its learned representations are difficult to interpret. section 1.1 section 1.14 section 1.34

The basic machine-learning workflow separates human design from machine adjustment:

  • Design an architecture: choose and arrange operations suited to the task, such as embeddings, projections, or a transformer. section 1.25
  • Leave parameters unspecified: these numerical values form the adjustable blanks inside the architecture. section 1.25
  • Train the model: run an algorithm over data to search for parameter values that improve performance. section 1.25
  • Choose a learning style: supervised learning uses labeled examples, self-supervised learning generates examples from data, and unsupervised learning finds structure without supplied answers. section 1.34
import torch
embedding = torch.nn.Embedding(num_embeddings=100000, embedding_dim=10000)
projection = torch.nn.Linear(10000, 2000)
model = torch.nn.Sequential(embedding, projection)

A short PyTorch model makes the division visible: the engineer assembles an embedding and projection, while training determines their parameters. section 1.25

Machine learning is not identical to artificial intelligence: AI describes the broader goal of making programs perform tasks in human-like ways, while machine learning is a commonly used method for pursuing that goal. Its main tradeoff is predictive power versus explainability. Complex models may predict well but become black boxes, so simpler models or explainable-AI techniques may be preferable when people need to understand the reasons behind outputs. section 1.0 section 4.4

How The AI Pocket Book covers it

How deep it goes
Explains architecture, parameters, training, learning types, and explainability, but stops short of training algorithms or mathematical derivations.
Examples
Uses LLM next-token prediction, embedding construction, PyTorch layers, and product-purchase or machine-replacement predictions as examples.
What it assumes
Assumes basic familiarity with programs and data, but teaches the distinction between hand-coded software, architectures, parameters, and training from first principles.
What you can do after
Evaluate/understand how data, architectures, parameters, and training produce models, while recognizing when explainability limits their use.
How it connects
Connects machine learning with artificial intelligence, deep learning, embeddings, transformers, convolutional neural networks, and explainable AI.

Also explained in

Compare how 42 books explain machine learning →

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.