Daily Brief AI Fluency

How Generative AI Works: Transformers, Pre-Training and Scaling

Part 4 of 11 · Anthropic's AI Fluency Course

Curated with AI, reviewed by Nazmul

Picked by Nazmul

Drew Bent, a teacher, programmer and member of technical staff at Anthropic, walks through what generative AI is, how large language models work under the hood, and the developments that made them possible. Generative AI systems create new content rather than only analyzing existing data. A traditional system might sort email into spam and not-spam by pattern; a generative model can write a new email. The first analyzes and categorizes, the second produces something that did not exist before, which Bent calls a fundamental shift in AI capability.

Large language models such as Anthropic's Claude are a prominent type of generative AI. They are language models because they are trained to predict and generate human language, and large because they hold billions of parameters, mathematical values that determine how the model processes information, which Bent compares to synaptic connections in the brain. He says the path to today's systems was not sudden but the convergence of three developments:

  • Algorithmic and architectural breakthroughs. Neural networks existed conceptually for decades, but the transformer architecture, developed in 2017, was a game-changer. It handles sequences of text while keeping relationships between words intact across long passages, which Bent says is critical for understanding language in context.
  • The explosion of digital data. Modern LLMs learn from websites, code repositories and other text representing human knowledge and communication, giving them a broad, nuanced grasp of language and concepts.
  • Massive increases in compute. Specialized hardware such as GPUs and TPUs, plus distributed computing networks called clusters, made it possible to train these models on that data, processing that Bent says would have been impossible a few years earlier.

Together these produced the scaling laws: empirical findings that as models grew larger, trained on more data with more compute, performance improved in predictable ways. More surprisingly, Bent says, entirely new capabilities emerged with scale, abilities no one explicitly programmed, such as reasoning through problems step by step or adapting to new tasks with minimal instruction.

On training, he describes pre-training as analyzing patterns across billions of text examples, like reading every website and text you could find, not to absorb facts but to learn the statistical relationships between words, phrases and concepts, building something like a complex map of language and knowledge. The model is shown text and asked to predict what comes next, refining its predictions over many iterations. Fine-tuning follows: the model learns to follow instructions, give helpful responses and avoid harmful content, often using human feedback and reinforcement learning with rewards and penalties to push behavior toward being helpful, honest and harmless. Anthropic's models are then deployed.

At use time, a prompt is text the model reads and continues from based on learned patterns; it is not retrieving pre-written answers from a database but generating text that statistically follows from the input. Bent also flags the context window, the model's working memory, covering prompts, responses and anything else shared in the conversation. Companies keep growing it, but the limit means the system does not have unlimited access to information and cannot use content beyond the current window without specialized tools like web search. He closes with three characteristics that make modern generative AI powerful: processing vast amounts of information during training to learn nuanced patterns; in-context learning, adapting to new tasks from instructions or examples in the prompt without extra training; and capabilities that emerge from scale, sometimes surprising even their creators.

Source: Anthropic on YouTube

Reading transcript

Edited transcript of Lesson 3A: What is generative AI? (Deep Dive) | AI Fluency: Framework & Foundations Course by Anthropic. Filler and repeated phrases removed; punctuation and headings edited for reading.

Introduction

Hi, my name is Drew Bent and I'm a teacher, programmer, and member of technical staff at Anthropic. Welcome to our exploration of generative AI. In this video, we'll dive into what generative AI actually is, how it works under the hood, and the technological breakthroughs that made these systems possible. You might interact with generative AI daily without fully understanding what's happening behind the scenes. Let's change that.

What generative AI is

Generative AI refers to artificial intelligence systems that can create new content rather than just analyzing existing data. For example, while traditional AI might classify emails as spam or not spam based on patterns, generative AI can write a completely new email for you. The first approach analyzes and categorizes. The second creates something new that didn't exist before. This represents a fundamental shift in AI capabilities.

Large language models, or LLMs, like Anthropic's Claude models are a prominent type of generative AI. They're called language models because they're trained to predict and generate human language, and large because they contain billions of parameters, mathematical values that determine how the model processes information, somewhat like synaptic connections in your brain.

Three developments that made today's AI possible

The path to today's generative AI wasn't sudden. It involved three crucial developments coming together at the right time.

First, there were algorithmic and architectural breakthroughs that fundamentally changed how AI systems learn. While neural networks have been around conceptually for decades, the development of the transformer architecture in 2017 was a game-changer. This architecture excels at processing sequences of text while maintaining relationships between words across long passages, which is critical for understanding language in context.

Second, the explosion of digital data provided the essential raw material for training. Modern LLMs like Claude learn from diverse sources such as websites, code repositories, and other text that represent human knowledge and communication. This vast tapestry of information helps models develop a broad and nuanced understanding of both language and concepts.

And third, massive increases in computational power made it possible to train these complex models on all that data. Specialized hardware like GPUs, or graphics processing units, and TPUs, or tensor processing units, along with distributed computing networks often called clusters, enable processing that would have been impossible just a few years earlier.

Scaling laws and emergent capabilities

The combination of these three factors led to an important discovery known as the scaling laws. These empirical findings showed that as models grew larger and trained on more data with more computing power, their performance improved in predictable ways. More surprisingly, researchers found that entirely new capabilities began to emerge as these models grew larger. Abilities no one explicitly programmed, like reasoning through problems step by step or adapting to new tasks with minimal instruction.

How these systems work under the hood

Let's peek under the hood at how these systems actually work. During initial training, also called pre-training, LLMs like Claude analyze patterns across billions of text examples. Imagine reading every website and piece of text you could find, not just to absorb information, but to understand the statistical relationships between words, phrases, and concepts. At this stage, the model essentially builds something like a complex map of language and knowledge. This pre-training process involves showing the model text and asking it to predict what comes next. Through many iterations, the model gradually refines its predictions, learning the patterns that make language coherent and meaningful.

After pre-training, models undergo additional training called fine-tuning, where they learn to follow instructions, provide helpful responses, and importantly, avoid generating harmful content. This often involves human feedback to improve the model's performance, as well as reinforcement learning, which uses rewards and penalties to shape the model's behavior toward being more helpful, honest, and harmless.

Prompts and the context window

In the case of Anthropic's models, once models are trained, they are then deployed for you to interact with. When you interact with Claude or another LLM, you're providing a prompt, which is text that the model reads and then continues from based on patterns it learned during training. The model isn't retrieving pre-written answers from a database. Instead, it's generating new text that statistically follows from what you've written.

There's also a practical limit to how much information an LLM can consider at once, known as the context window. Think of this as the AI's working memory. The context window includes your prompts, the AI responses, and any other information you've shared in your conversation. While AI companies continue to grow the context window to allow for longer context documents and conversations, these limits remind us that these systems don't have unlimited access to information and cannot use content beyond its current context window without specialized tools like web search.

Three characteristics that make modern generative AI powerful

Bringing this together, the three characteristics that make modern generative AI so powerful include: first, its ability to process vast amounts of information during training, allowing it to learn complex and nuanced patterns in language and knowledge. Second, its in-context learning ability. LLMs can adapt to new tasks based on instructions or examples in your prompt without requiring additional training. And third, emerging capabilities that arise from scale. As these models grow larger, they develop abilities that weren't explicitly designed into them, sometimes surprising even their creators.

In the next video, we'll explore what these systems can and can't do well, along with their most common or valuable applications.

Thoughts? Reply to the email or join the Lab →

Get it by email.

Choose the Daily Brief, Articles, or both. Free.