Skip to content
Artificial Inteligence10 min read0 reads

How ChatGPT was trained (and Claude and Gemini)

How was ChatGPT trained? See the stages, where the data comes from (web, books, humans and their chats) and how much it costs to train models like Claude and Gemini.

NinaKalkazu.org

Pending cover

Listen to this article

Narrated by Thalita

0:00 / 11:22

You ask ChatGPT a question and, in two seconds, it answers as if it had read an entire library. In a sense, it did. But how was ChatGPT trained, where did those texts come from and how much did it cost?

This article answers all three questions, from raw internet text to chatbot, and applies to Claude and Gemini as well. By the end, you'll know how to prevent your conversations from becoming training material.

Quick summary: the answer in 30 seconds. All three AIs learned to predict the next word by reading trillions of pieces of text from the internet, books and purchased data. Then, people gave examples and ratings to teach them how to converse. Finally comes reasoning training. The chip usage alone for training the most advanced AIs cost tens to hundreds of millions of dollars, and the full bill is much larger.

Contents

  • How ChatGPT was trained, in one sentence
  • Stage 1: pre-training, reading almost everything
  • Stage 2: teaching it to converse (fine-tuning and RLHF)
  • Stage 3: learning to reason
  • AI training blocked: where it all comes from
  • How Claude and Gemini were trained: what's different
  • How much it costs to train an AI
  • What this means for you
  • Frequently asked questions

How ChatGPT was trained, in one sentence

ChatGPT was trained to guess the next word in a text, trillions of times, until it got very good at it. Then, people taught it to use that skill in conversation. Everything it seems to "know" is a side effect of this guessing game, played at a scale no human can reach.

OpenAI itself uses a simple example on the page where it explains the process: completing the sentence "instead of turning left, she turned ___". At first, the model guesses randomly. After seeing millions of sentences, it learns to get "right".

This model is an LLM (large language model): the phone keyboard that suggests the next word, only after reading a huge fraction of everything ever written.

Stage 1: pre-training, reading almost everything

Pre-training is the phase where the model reads a mountain of text and adjusts its internal numbers to better predict the next word. It's the longest and most expensive stage. At the end, the model writes well and knows a lot, but still doesn't converse or follow requests.

The text enters chopped into tokens (word pieces): "training" might become "train" + "ing", like Lego pieces. The size of a training run is measured in these pieces. Meta reported that Llama 3, its own AI, was pre-trained on over 15 trillion tokens, seven times the volume of Llama 2.

What the model learns is stored in parameters (internal numbers that adjust with each error). GPT-3, from 2020, had 175 billion of them. Imagine a giant mixing board: each prediction error turns billions of knobs a little, until the sound comes out right.

Stage 2: teaching it to converse (fine-tuning and RLHF)

After pre-training, people teach the model to act as an assistant. First, they write example conversations for it to imitate. Then, they compare the machine's responses and say which is best. This second part is called RLHF, and it's what transformed an autocomplete into a chatbot that takes requests.

Fine-tuning is the first part. At ChatGPT's launch in 2022, OpenAI said that its trainers wrote conversations playing both roles, user and assistant, for the model to imitate.

What is RLHF

RLHF (reinforcement learning from human feedback) works like this: the model gives two or more responses to the same request, and a person ranks them from best to worst. With thousands of these choices, the company trains a second model, the "judge", which imitates human taste and scores millions of responses.

The main model learns to seek high scores, like a dog doing tricks for treats. In the study that brought the method to GPT-3, evaluators preferred a 1.3 billion parameter model trained this way over the original GPT-3, one hundred times larger.

Who are the people training the AI

Behind RLHF is an army of annotators (people paid to write and evaluate responses). A report from The Verge showed they earned $10 to $25 per hour in the United States, and $1 to $3 in Kenya.

Stage 3: learning to reason

The newest stage trains the model to "think before answering". OpenAI said that o1, its 2024 model, was trained with large-scale reinforcement learning to write internal reasoning, like the scratch work a student does before the final answer. It solves problems with verifiable answers, like math and code, and gets rewarded when it's right.

AI training blocked: where it all comes from

The data comes from public internet pages, books, paid agreements with other companies and texts created by the AI itself. OpenAI also cites what users, trainers and researchers provide, which includes conversations with ChatGPT, if you don't turn that option off.

The public internet and the bots that collect pages

OpenAI says it uses only what's open on the internet and that it filters hate speech, adult content, spam and sites that collect personal data. A site owner can block the company's collection bot, GPTBot, with a rules file called robots.txt, a kind of "do not enter" sign.

Books, and Anthropic's $1.5 billion settlement

Books are good, edited text; the problem is how they were obtained. Anthropic, which owns Claude, reached a $1.5 billion settlement with authors, approved by a judge in July 2026.

The decision approving the settlement estimates about $3,000 per work for rights holders, from a list of 482,460 books. The company must also destroy files downloaded from the pirate libraries Library Genesis and Pirate Library Mirror.

The court understood that training AI with purchased books is allowed; what mattered was the piracy. OpenAI and Meta face similar lawsuits, according to Ars Technica and Wired.

Purchased data and synthetic data

When the open internet isn't enough, companies buy. In February 2024, Google announced access to Reddit's data API (the door through which one system pulls data from another) to, among other things, train its models. The amount was not officially disclosed.

The other solution is synthetic data (text created by one AI to train another), which OpenAI says it uses increasingly. It's the teacher writing new exercises when the textbook runs out.

Do your conversations go in?

In personal accounts for all three services, conversations can enter training, and all three let you turn it off. Business plans and developer access are excluded by default (verified on 10/19/2026):

ServicePersonal accountsHow to turn off
ChatGPTMay use conversationsSettings > Data controls > "Improve the model for everyone"
ClaudeUses if you acceptPrivacy settings
GeminiUses with activity onTurn off "Keep activity"

At Anthropic, those who accept have conversations stored for up to five years; those who decline stay at the normal 30 days. At Google, some conversations are read by human reviewers and stored for up to three years, even after you delete the history.

How Claude and Gemini were trained: what's different

Claude and Gemini go through the same stages as ChatGPT: pre-training, fine-tuning and reinforcement. Anthropic replaces part of the human feedback with written principles; Google trained Gemini with text, image, audio and video together from the start.

Anthropic's technique is called Constitutional AI, with principles inspired by sources like the Universal Declaration of Human Rights. Claude critiques and rewrites its own responses based on them, and another AI chooses the best response instead of a human evaluator. It's a student correcting their essay with the style guide open.

Google designed Gemini to be multimodal from the origin, while many models learn text first and gain "eyes" later. The first version was trained on Google's own chips, TPUs.

How much it costs to train an AI

The computation alone for training GPT-4 cost about $78 million, and for Gemini Ultra, about $191 million, according to the AI Index from Stanford University. The full cost, with research, salaries and data, is much larger, and companies don't disclose the numbers for current models.

In the table, "final run" is the definitive training, without the tests that came before. DeepSeek is a Chinese company.

ModelTraining costSource
GPT-4 (2023)~$78 million in computeStanford estimate
Gemini Ultra (2023)~$191 million in computeStanford estimate
Claude 3.5 Sonnet (2024)"A few tens of millions"Dario Amodei, Anthropic CEO
DeepSeek-V3 (2024)$5.576 million, final run onlyDeepSeek report

What's left out of the bill

The DeepSeek case shows the trap. The $5.6 million from the technical report assumes chip rental at $2 per hour and leaves out research and previous tests. It's like pricing a car counting only the assembly line, without the factory and prototypes.

The Epoch AI institute calculated that the cost of the final run grows about 2.4 times per year since 2016. Chips take 47% to 67% of the cost, the team 29% to 49% and energy 2% to 6%.

Left out of the tables are annotators, licensed data and legal settlements. Anthropic's settlement alone, at $1.5 billion, is worth almost 20 times GPT-4's computation. And energy weighs even on neighbors, as we showed in the article about AI data centers and electricity bills.

What this means for you

Turn off the use of your conversations in training if they contain anything sensitive, and don't paste personal documents in the chat. The rest depends on your profile:

If you…Do this
Use AI at work with customer dataTurn off conversation use in training or use a business plan
Just ask everyday questionsCan keep the default, but don't paste personal documents
Write and publish on the internetPublish knowing that open text may be collected
Have a websiteBlock AI bots in robots.txt, if you don't want to be collected

Want to know how one model copies another? Read about AI distillation or see more in the artificial intelligence section.

Frequently asked questions

How is AI trained, simply put?

First, it reads trillions of pieces of text and learns to predict the next word. Then, people show how to answer well and rate the responses. Finally, it practices problems with correct answers to learn to reason.

What is RLHF?

It's reinforcement learning from human feedback. People compare AI responses and choose the best; a "judge" model learns this taste and trains the main AI at scale. It was the method used in ChatGPT.

How much does it cost to train an AI like ChatGPT?

GPT-4's computation cost about $78 million, according to Stanford. With research, salaries and data, the total is much larger, and OpenAI doesn't disclose the cost of current models.

How do I prevent my conversations from training the AI?

All three services have a button for this in settings; the table above shows where each one is. Business plans already come turned off.


Behind each two-second answer are trillions of words, thousands of people and hundreds of millions of dollars. The next step is yours: check your privacy settings today.

Tags:chatgpt training,ai training,cost of training ai,ai training data,rlhf,claude training,gemini training

Comments (0)

Text and emojis only. Links and code are not accepted. Community guidelines

    Latest articles by category

    Oct 22, 20265 min read

    The Impact of Mistral AI's Voxtral 3

    Audio processing by artificial intelligence is undergoing a profound architectural transformation. Historically limited by high error rates, Voxtral 3 achieves sub-second latency and consolidates listening, reasoning and speech synthesis in a unified platform.

    Related articles