Part 1 of 7 — How AI Actually Works

The AI Stack — Overview

The complete map. Six layers from hardware to application.

You know how a web request works. A browser sends a request, it travels through DNS, hits a load balancer, reaches a web server, pulls from a database, and a response comes back. Every layer has a job. Every layer depends on the one below it.

AI works the same way. There's a stack. Each layer has a job. A prompt goes in at the top — a response comes out at the bottom. This page maps the whole journey before we dive into each layer.

The Six Layers

6
Application Layer

Chatbots, code assistants, search, agents. What gets built on top of AI and delivered to end users.

5
Interface Layer

The API, the web UI, the prompt. How the outside world communicates with the model — and how the model responds.

4
Inference Layer

Running a live query. The prompt arrives, gets processed, tokens are generated one by one, a response is assembled and returned.

3
Model Layer (LLM)

The trained model itself. Transformer architecture, tokenization, neural network weights — the frozen knowledge from training.

2
Training Layer

How the model learned. Data ingestion, supervised and reinforcement learning, RLHF — the process that produced the model.

1
Hardware Layer

GPU and TPU clusters, high-speed interconnects, massive storage. The physical infrastructure everything else runs on.

A Sysadmin Analogy

Think of it like a web application stack:

Hardware → your servers and network
Training → building and compiling the application
Model → the compiled binary sitting on disk
Inference → a running process handling a request
Interface → the API endpoint and client
Application → what the end user actually sees

The key difference: in a web app you write the logic. In AI, the model learns the logic from data. The training layer is where that happens.

Two Phases — Build vs Run

The stack splits cleanly into two phases:

Build time (layers 1–2): Happens once, takes weeks or months, costs millions of dollars in compute. Hardware runs training. Data shapes the model. The result is a set of weights — billions of numbers that encode what the model knows.

Run time (layers 3–6): Happens continuously, milliseconds per query. The frozen model receives a prompt, generates a response, delivers it through the interface to the application. No learning happens here — inference is pure execution.

This distinction matters: when you use Claude or ChatGPT, you are talking to a frozen model. It is not learning from your conversation in real time. The learning happened months ago, on hardware you'll never see, with data you'll never read.

What Comes Next

The remaining six parts of this series take each layer in turn — starting at the bottom of the stack and working up to the application. By the end you will have a complete mental model of how AI works, end to end, with no black boxes.