How ChatGPT works: language model, pre-training, human feedback, tokens, context window, web search and citations, limits, and how to get cited by it.

In short
ChatGPT is an assistant built on a large language model, a neural network of the transformer type trained on huge amounts of text to predict the next piece of a sentence. It was then fine-tuned with human feedback to follow instructions and answer helpfully. When you send a message, it splits the text into tokens, reads it with the conversation in its context window and writes its answer one token at a time. For recent or factual questions, it can also search the web and cite the pages it used.
Want to go further? Ask
Knowing how ChatGPT works explains both its strengths and its errors, and tells you what makes a website likely to be cited in its answers. OpenAI launched ChatGPT in November 2022; its name comes from GPT, Generative Pre-trained Transformer.
ChatGPT runs on a large language model (LLM). An LLM is a statistical model with billions of parameters that has learned the relations between words, facts and styles from text. It holds patterns learned from those texts and uses them to produce plausible continuations of any text; individual pages are not kept as such.
The architecture is the transformer, introduced by Google researchers in the paper Attention Is All You Need in 2017. Its key mechanism, attention, lets the model weigh every word of the input against every other word, so it understands that "it" in a sentence refers to a noun three lines earlier.
The model reads a very large corpus of text (public web pages, books, code, licensed data) and learns one task: predict the next token. Repeated billions of times, this simple task forces it to learn grammar, facts, reasoning patterns and many languages. The result is a powerful text predictor that does not yet follow instructions well.
People write examples of good answers to prompts, and the model is trained to imitate them. It learns the format of a helpful assistant: answer the question, structure the reply, ask for clarification when needed.
Reviewers compare several answers to the same prompt and rank them. A reward model learns those preferences, and the language model is then optimized to produce answers that score well. OpenAI described this method, called RLHF, in its InstructGPT research paper. It is what makes ChatGPT polite, structured and more careful about refusing harmful requests.
| Step | What ChatGPT does | Why it matters |
|---|---|---|
| 1. Tokenization | Splits your text into tokens (words or word pieces) | Limits and costs are counted in tokens |
| 2. Context | Adds instructions, memory and earlier messages to the context window | The model only sees what fits in this window |
| 3. Search decision | Decides whether the question needs fresh information from the web | Triggers the citation of external pages |
| 4. Retrieval | Runs searches, reads the most relevant pages, extracts passages | This is where websites get selected |
| 5. Generation | Predicts the answer one token at a time | Each word depends on everything before it |
| 6. Citation | Links the sources used for each part of the answer | Brings visits and credibility to cited sites |
| 7. Safety checks | Applies usage policies and filters | Some answers are refused or reworded |
A token is a chunk of text: in English, one token is on average about four characters, or three quarters of a word. The context window is the number of tokens the model can consider at once, including your conversation and any documents or web pages it reads. When a conversation becomes too long, the oldest parts fall out of view.
At each step, the model computes a probability for every possible next token and picks one, with a controlled share of randomness. That is why the same question can get slightly different answers, and why ChatGPT writes fluently even when it is wrong: it optimizes for a likely continuation, without checking facts against a source.
A model only knows what was in its training data, up to a cutoff date. To answer about recent events, prices or products, ChatGPT can run a web search. OpenAI announced this feature as ChatGPT search in October 2024. The assistant rewrites your question into one or several queries, retrieves results from search providers and from OpenAI's own crawler, reads the pages, and writes an answer with links to its sources.
This method is called retrieval-augmented generation (RAG): the model generates text grounded in documents it has just retrieved. OpenAI documents its crawlers on its developer platform: OAI-SearchBot for search, GPTBot for training, and ChatGPT-User for pages opened on behalf of a user. OpenAI states that sites blocking OAI-SearchBot in robots.txt are not shown in ChatGPT search answers.
Understanding the pipeline gives a clear checklist for any brand that wants to appear in ChatGPT answers:
ChatGPT predicts text from what it learned and, for fresh questions, from the few web pages it chooses to read: the brands it cites are those whose pages are easy to find, easy to extract and confirmed by other sources. To follow your presence in ChatGPT, Gemini and Claude over time and publish content built to be cited, Sorank tracks your prompts and writes optimized articles on autopilot, with a 3-day free trial.
Not always. For many questions, ChatGPT answers from what its model learned during training. When a question needs recent or precise information, it can run a web search, read a few pages and show the sources it used as links in the answer.
ChatGPT generates the most likely continuation of a text, and likely does not always mean true. When its training data is thin, outdated or contradictory, it can produce confident but false statements, called hallucinations. Checking important facts against a reliable source remains necessary.
No. GPT is the family of language models developed by OpenAI, while ChatGPT is the conversational product built on top of them. ChatGPT adds instruction tuning, safety rules, memory, tools such as web search and file analysis, and an interface designed for dialogue.
THEY TRIED SORANK BEFORE YOU
