Preferences

Privacy is important to us, so you have the option of disabling certain types of storage that may not be necessary for the basic functioning of the website. Blocking categories may impact your experience on the website. More information (Cookie Policy)

Accept all cookies

How Does ChatGPT Work? From Training to Web Search and Citations

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

Published on:
17/10/2026
-
Updated on:
17/10/2026
Cover of the Sorank guide explaining how ChatGPT works, with a language model turning text into tokens and an answer citing web sources

Tools

Thibault Besson-Magdelain, founder of Sorank

About Author

Thibault Besson-Magdelain

Founder of Sorank, 7+ years of experience in SEO, GEO enthusiast.
On this page

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.

What is the model behind ChatGPT?

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.

How was ChatGPT trained?

1. Pre-training

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.

2. Supervised fine-tuning

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.

3. Reinforcement learning from human feedback

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.

What happens when you send a message?

StepWhat ChatGPT doesWhy it matters
1. TokenizationSplits your text into tokens (words or word pieces)Limits and costs are counted in tokens
2. ContextAdds instructions, memory and earlier messages to the context windowThe model only sees what fits in this window
3. Search decisionDecides whether the question needs fresh information from the webTriggers the citation of external pages
4. RetrievalRuns searches, reads the most relevant pages, extracts passagesThis is where websites get selected
5. GenerationPredicts the answer one token at a timeEach word depends on everything before it
6. CitationLinks the sources used for each part of the answerBrings visits and credibility to cited sites
7. Safety checksApplies usage policies and filtersSome answers are refused or reworded

Tokens and the context window

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.

Generation word by word

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.

How does ChatGPT search the web and cite sources?

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.

What are ChatGPT's limits?

  • Hallucinations: it can state false facts, invented quotes or non-existent sources with confidence, because it predicts plausible text.
  • Knowledge cutoff: without web search, it ignores everything after its training data.
  • Context limits: very long documents or conversations exceed what it can consider at once.
  • Sensitivity to wording: a slightly different prompt can produce a different answer, or a different list of recommended brands.
  • Source selection: when it searches, it reads only a handful of pages, so being among them matters.

What does this mean for getting cited by ChatGPT?

Understanding the pipeline gives a clear checklist for any brand that wants to appear in ChatGPT answers:

  1. Let the crawlers in: allow OAI-SearchBot in robots.txt, and serve content in HTML that works without heavy JavaScript.
  2. Rank in classic search: ChatGPT search starts from search results, so pages that rank well on the underlying queries are more likely to be read.
  3. Write extractable passages: a direct answer under each heading, short self-contained paragraphs, definitions, tables and sourced figures.
  4. Be present where it reads: reviews, comparison articles, forums, media and Wikipedia shape what the model says about your brand, both in training data and in live search.
  5. Stay consistent: the same name, description and facts across your site and third-party profiles help the model identify your brand as one entity.
  6. Measure: ask the questions your customers ask and see whether you are cited. The free ChatGPT visibility checker gives a first answer in a minute.

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.

Frequently asked questions

Does ChatGPT look up answers on the internet?

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.

Why does ChatGPT sometimes give wrong answers?

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.

Is ChatGPT the same thing as GPT?

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.

Our Blog for Ambitious Company

Our free SEO tools

See all our free tools

THEY TRIED SORANK BEFORE YOU

Testimonials from ambitious founders

Organic growthE-commerce

0 to 10000 visitors in 5 months

Celio Fabianomonrobotlavevitre.fr
Organic growthSoftware

0 to 5000 clients in 8 months

Thibault BMsorank.com
Organic growthLeisure and aviation

0 to 1104 clicks in 4 months

Dominiqueflight-sensations-idf.com
Organic growthMusic software

x30 clicks in 4 months

Valentin Cordiertiger-sounds.com
Organic growthHealth and wellness

x30 clicks in 4 months

Rodrigue Bretonalthevia.com