Definition
ChatGPT is a conversational AI built on a large transformer language model. At its core it does one thing: given the conversation so far, it predicts the most plausible next token (a word or word-fragment), then appends it and repeats. What makes it feel like an assistant rather than an autocomplete engine is the multi-stage training pipeline OpenAI uses to shape that raw prediction ability toward helpfulness, honesty, and safety.
Stage 1: Pre-training
The journey begins with pre-training on an enormous corpus — hundreds of billions of tokens drawn from the public internet, books, and code. The model’s only task is next-token prediction: see some text, guess what comes next, adjust its billions of parameters when it is wrong. Done at scale, this teaches the model grammar, facts, reasoning patterns, and coding conventions. The result is a base model that is highly knowledgeable but undirected — it will happily continue a prompt in any direction rather than answer your question.
Stage 2: Supervised fine-tuning
Next comes supervised fine-tuning (SFT). Human contractors write or curate high-quality example conversations showing how an ideal assistant should respond to instructions. The base model is fine-tuned on these demonstrations, learning the shape of helpful, instruction-following dialogue. After SFT the model behaves much more like an assistant, but its responses are still inconsistent in quality and tone.
Stage 3: Reward modelling and RLHF
The final stage is Reinforcement Learning from Human Feedback (RLHF). Humans are shown several model responses to the same prompt and rank them best to worst. These rankings train a separate reward model that predicts how much a human would like any response. Then, using an RL algorithm — typically PPO (Proximal Policy Optimization) — the assistant generates responses, the reward model scores them, and the model is nudged toward higher-scoring behaviour. A penalty keeps it from drifting too far from the SFT model. This is what makes ChatGPT follow instructions, refuse harmful requests, and adopt its characteristic tone.
What happens when you hit send
When you type a message, your full conversation is converted into tokens and fed through the transformer, which produces a probability distribution over the next token. A decoding strategy (often temperature and top-p sampling) selects a token, it is appended, and the process repeats until the model emits a stop token. The text streams back to you token by token. There is no database lookup and no reasoning engine — just very capable pattern completion, which is also why ChatGPT can confidently hallucinate facts it never truly verified.