From language models to foundation models
Applications like ChatGPT and Copilot didn't come from nowhere — they're the culmination of decades of language modeling, with the first language models emerging in the 1950s. What changed recently is scale, and scale had two consequences: models became powerful enough to enable far more applications, and because training them requires data, compute, and talent only a few organizations can afford, those organizations began offering their models as a service. The result: demand for AI applications went up while the barrier to entry went down. Building applications on top of these readily available models is what the book calls AI engineering.
Key concept · Tokens, tokenization, and vocabulary
The basic unit of a language model is the token — a character, a word, or (most often) a part of a word. Breaking text into tokens is tokenization, and the full set of tokens a model works with is its vocabulary. Tokens sit between characters and words: they let the model break words into meaningful components (cook + ing), keep the vocabulary smaller and the model more efficient, and handle unknown words gracefully. For GPT-4, a token averages roughly ¾ of a word, so ~100 tokens ≈ 75 words.
Key concept · Masked vs. autoregressive models
Two kinds of language model differ by what context they use to predict a token. A masked language model (e.g., BERT) fills in a blank using context from both before and after — good for non-generative tasks like classification and sentiment analysis. An autoregressive language model predicts the next token using only the preceding tokens, generating one token after another. Autoregressive models are the choice for text generation, so in this book "language model" means autoregressive unless stated otherwise.
Key concept · Self-supervision — why language models scaled
Traditional ML often relies on supervision: training on human-labeled examples, which is expensive and slow (labeling a million ImageNet images at 5¢ each ≈ $50,000). Language modeling is self-supervised: the training data provides its own labels, because each sequence supplies both the input context and the next token to predict. The sentence "I love street food." yields several training samples for free. Removing the labeling bottleneck is what let language models scale to the size behind the ChatGPT moment.
Key concept · Completion machines & generative AI
A language model is best understood as a completion machine: given a prompt, it predicts a plausible continuation. Completions are predictions based on probability — not guaranteed correct, which is exactly what makes these models both powerful and frustrating. Because a model can generate open-ended outputs from a finite vocabulary, it's generative — hence generative AI. Many tasks (translation, summarization, classification, coding) can be reframed as completion. A foundation model extends this idea: a large, general model — often multimodal — that serves as the shared base you adapt to many downstream applications.
What foundation models are being used for
The potential applications feel endless, and even categorizing them is hard — different surveys slice them differently. Studying 205 open-source applications (plus interviews and case studies), the book groups use cases into eight categories spanning consumer and enterprise contexts. Because foundation models are general, one application often spans several categories at once.
| Category | Consumer examples | Enterprise examples |
|---|---|---|
| Coding | Code generation, autocomplete | Code generation, review |
| Image & video production | Photo/video editing, design | Presentations, ad generation |
| Writing | Email, social/blog posts | Copywriting, SEO, reports, memos |
| Education | Tutoring, essay grading | Employee onboarding & upskilling |
| Conversational bots | General chatbot, AI companion | Customer support, product copilots |
| Information aggregation | Summarization, talk-to-your-docs | Summarization, market research |
| Data organization | Image search | Knowledge management, doc processing |
| Workflow automation | Travel/event planning | Data extraction & entry, lead generation |
Key concept · Coding leads; the enterprise prefers lower risk
Across surveys, coding is the single most popular use case (about 30% of the open-source applications studied), followed by conversational bots. But enterprises deploy differently from consumers: they move faster on internal-facing, lower-risk applications (internal knowledge management, text summarization) than on external-facing ones (customer chatbots), because internal apps build expertise while limiting the blast radius of data-privacy, compliance, and catastrophic-failure risks. Close-ended tasks like classification are also favored because they're easier to evaluate, making their risks easier to estimate.
Not everything that can be built should be
Building a cool demo is easy; building a profitable product is hard. If you're doing this for a living, it's worth stepping back to ask why you're building and how you'll go about it. The chapter frames planning as a sequence: evaluate the use case, decide the role of AI and humans, weigh defensibility, then set concrete expectations and milestones.
Key concept · Use-case evaluation — three levels of motivation
Building an AI application is usually a response to risk or opportunity. Ordered high to low: (1) If you don't, competitors with AI can make you obsolete — existential, highest priority; (2) If you don't, you'll miss opportunities to boost profits and productivity (cheaper acquisition, better retention, faster operations); (3) You're unsure where AI fits, but don't want to be left behind — investing in understanding a transformational technology, if you can afford it. Once you have a reason, ask whether you must build it yourself or can buy.
Key concept · The role of AI and of humans
How central AI is shapes the requirements. Three axes: critical vs. complementary (Face ID fails without AI; Gmail's Smart Compose is optional) — the more critical, the higher the reliability bar; reactive vs. proactive (a chatbot reacts to a request; traffic alerts are proactive) — reactive features often need to be fast, proactive ones can be precomputed but need a higher quality bar since they're unsolicited; and dynamic vs. static (continually updated per-user vs. periodically updated for a group). Deciding how much humans stay in the loop is human-in-the-loop design — Microsoft's Crawl-Walk-Run framework increases automation gradually: crawl (human involvement mandatory), walk (AI interacts with internal staff), run (increased automation, including external users).
Key concept · Defensibility, expectations, and the last-mile challenge
A low entry barrier is a blessing and a curse: what's easy for you is easy for competitors, and if the underlying models get better, your thin layer can be subsumed. The three competitive moats are technology, data, and distribution — with foundation models, core tech converges and distribution favors incumbents, so a startup's edge is often the data flywheel from getting to market first. When you commit, set measurable business metrics and a usefulness threshold (quality, latency — TTFT/TPOT, cost per request, plus fairness/interpretability). Beware the last-mile challenge: initial demos are deceptively easy — "0 to 60 is easy; 60 to 100 is exceedingly hard" — the final gains against hallucinations and edge cases take the most time.
Three layers — and how the role differs from ML engineering
Amid the hype and FOMO, it helps to see the durable building blocks. AI engineering evolved out of ML engineering, and their roles overlap heavily — many companies file both under one umbrella. The chapter organizes the work into three layers you typically enter from the top and descend as needed.
| Layer | What it covers | Example responsibilities |
|---|---|---|
| Application development | Using ready-made models to build apps — the layer that has seen the most action. | AI interface, prompt engineering, context construction, evaluation. |
| Model development | Tooling for creating and adapting models; data is central here. | Inference optimization, dataset engineering, modeling & training, evaluation. |
| Infrastructure | The stable base beneath everything. | Compute & data management, model serving, monitoring. |
Key concept · What shifted — and what stayed the same
After Stable Diffusion and ChatGPT (2023), growth concentrated in the application and application-development layers; the infrastructure layer grew far less, because core needs — resource management, serving, monitoring — remain the same. So does much else: enterprise apps still solve business problems, so you still map business metrics to ML metrics, still evaluate rigorously, still care about latency and cost. The excitement is real, but many principles of productionizing AI carry straight over from traditional ML.
Key concept · AI engineering vs. ML engineering
Why "AI engineering" and not "ML engineering"? Working with foundation models differs enough to warrant the term. Traditional ML engineering leans on tabular data, feature engineering, and training models; AI engineering leans on prompt engineering, context construction, and parameter-efficient finetuning of models someone else trained. The center of gravity moves from building a model to adapting and evaluating one — though a real system often uses both foundation models and traditional ML, so both skill sets stay valuable.
Chapter 1 quiz
Sixteen questions on foundation models, use cases, planning, and the AI stack. Answer first, then expand Show answer.
Part A · Multiple choice
The book argues the single word best describing AI post-2020 is:
- A Scale
- B Speed
- C Safety
- D Simplicity
Show answer
A — scale. It made models more capable and lowered the barrier to building on them.
The basic unit a language model works with is a:
- A Token
- B Byte
- C Sentence
- D Pixel
Show answer
A — a token (a character, word, or part of a word). The full set is the model's vocabulary.
An autoregressive language model predicts a token using:
- A Only the preceding tokens
- B Both preceding and following tokens
- C A human label
- D The vocabulary size
Show answer
A. Masked models (like BERT) use context from both sides; autoregressive models generate left-to-right.
Why did language models scale where many other ML models couldn't?
- A They can be trained with self-supervision, avoiding the labeling bottleneck
- B They need no data
- C They're smaller
- D They use only labeled data
Show answer
A. Each sequence supplies its own labels (the next tokens).
A useful mental model for a language model is a:
- A Completion machine that predicts a plausible continuation
- B Database lookup
- C Deterministic calculator
- D Search engine
Show answer
A. Completions are probabilistic predictions — not guaranteed correct.
According to the surveys in the chapter, the most popular use case is:
- A Coding
- B Image generation
- C Education
- D Workflow automation
Show answer
A — coding (about 30% of the open-source apps studied), then conversational bots.
Which does the enterprise tend to deploy first?
- A Internal-facing, lower-risk applications
- B External customer chatbots
- C Open-ended creative tools
- D Consumer companions
Show answer
A. Internal apps build expertise while limiting privacy/compliance/failure risk.
The three layers of the AI engineering stack are:
- A Application development, model development, infrastructure
- B Frontend, backend, database
- C Prompt, model, GPU
- D Data, labels, weights
Show answer
A. You usually start at the top and move down as needed.
The three types of competitive advantage (moats) named for AI products are:
- A Technology, data, distribution
- B Speed, size, secrecy
- C Price, brand, patents
- D Compute, talent, luck
Show answer
A. With foundation models, tech converges and distribution favors incumbents — so data is often the startup's edge.
Microsoft's framework for gradually increasing automation is called:
- A Crawl-Walk-Run
- B Plan-Do-Check-Act
- C Test-Deploy-Monitor
- D Alpha-Beta-GA
Show answer
A. Crawl (human involvement mandatory) → walk (internal staff) → run (more automation, including external users).
Part B · True or false
A foundation model is typically a large, general (often multimodal) model you adapt to many downstream applications.
Show answer
True. It's the shared base — hence "foundation."
Because a foundation model is general, a single application can belong to more than one use-case category.
Show answer
True. E.g., a bot that both provides companionship and aggregates information.
The more critical AI is to an application, the lower the reliability bar can be.
Show answer
False. The more critical it is, the more accurate and reliable it must be; people tolerate mistakes more when AI is complementary.
After 2023, the infrastructure layer grew far more than the application layer.
Show answer
False. Applications and application development grew most; core infrastructure needs stayed relatively stable.
Part C · Short answer
Name the three axes for deciding the role of AI in a product.
Show answer
Critical vs. complementary; reactive vs. proactive; dynamic vs. static.
In one line, how does AI engineering differ from traditional ML engineering?
Show answer
AI engineering centers on adapting and evaluating existing foundation models — prompt engineering, context construction, parameter-efficient finetuning — rather than building models from tabular data, feature engineering, and training from scratch.