What Is ChatGPT and How Does It Work? A Plain-English Guide
ChatGPT is an AI chatbot made by OpenAI, first released on 30 November 2022. It is built on large language models (LLMs) that use the transformer architecture to predict the next piece of text, called a token, based on everything before it. The models are first trained on large amounts of text, then refined with human feedback so they follow instructions and respond helpfully.
Topic: Generative AI & LLMs in AI & Data · Explainer
Learning path: Generative AI & AI Infrastructure, lesson 1 of 14
Quick answer: ChatGPT is an AI chatbot made by OpenAI, first released on 30 November 2022. It is built on large language models (LLMs) that use the transformer architecture to predict the next piece of text, called a token, based on everything before it. The models are first trained on large amounts of text, then refined with human feedback so they follow instructions and respond helpfully. ChatGPT can also use tools such as web search, file analysis and code execution. It is useful for drafting, explaining, summarising and coding, but it can state wrong information confidently, so important facts need checking.
Key takeaways
- ChatGPT generates text one token at a time by predicting what comes next.
- Training has two broad stages: pre-training on text, then instruction tuning with human feedback.
- It has no built-in understanding of truth; it can "hallucinate" plausible errors.
- The context window limits how much text it can consider at once.
- Good results come from clear context, a defined goal and verification.
Table of Contents
- What Is ChatGPT?
- How Does a Language Model Generate Text?
- What Are Tokens and Context Windows?
- How Is ChatGPT Trained?
- How Do Tools Extend ChatGPT?
- What Are Its Limitations?
- How Do You Use It Well?
- How Does ChatGPT Compare with Other Assistants?
- How Do You Use ChatGPT Safely for Security Work?
- References
What Is ChatGPT?
OpenAI introduced ChatGPT as a conversational interface to its GPT models. Since then OpenAI has released several model generations; the app chooses or lets you choose among them depending on your plan. ChatGPT is available on the web, on mobile and desktop apps, and through business plans; developers use the same underlying models through the OpenAI API.
How Does a Language Model Generate Text?
GPT stands for Generative Pre-trained Transformer. The transformer architecture, introduced in the 2017 paper Attention Is All You Need, uses a mechanism called attention to weigh how each word relates to every other word in the input. Given your conversation, the model calculates probabilities for the next token, picks one, adds it to the text, and repeats until the answer is complete. Settings such as temperature control how predictable or varied the choices are.
What Are Tokens and Context Windows?
Models read and write tokens, which are pieces of words. A common English word is often one token; longer or rarer words split into several. You can count tokens with OpenAI's open source tiktoken library:
# pip install tiktoken
import tiktoken
enc = tiktoken.get_encoding("o200k_base")
text = "Cybersecurity training in Pune and Mumbai"
tokens = enc.encode(text)
print(len(tokens), [enc.decode([t]) for t in tokens])
The context window is the maximum number of tokens the model can consider at once, including your messages, files and its replies. Very long conversations may lose earlier details, which is why restating key context helps.
How Is ChatGPT Trained?
| Stage | What happens | Result |
|---|---|---|
| Pre-training | Model learns to predict the next token across a very large text dataset | Broad language and knowledge patterns |
| Supervised fine-tuning | Trained on example conversations written by people | Follows instructions in a chat format |
| Reinforcement learning from human feedback (RLHF) | People rank answers; the model is tuned toward preferred ones | More helpful, safer responses |
| Safety work | Testing and policies to reduce harmful output | Refusals and safer behaviour |
OpenAI described the instruction-following approach in its InstructGPT paper.
How Do Tools Extend ChatGPT?
- Web search: retrieves current information and cites sources.
- File analysis and code execution: reads documents and runs Python for data analysis and charts.
- Image understanding and generation: describes images and creates new ones.
- Voice: spoken conversation in the mobile and desktop apps.
For settings such as memory and privacy controls, see our guide to useful ChatGPT features and privacy settings.
What Are Its Limitations?
- Hallucination: confident but false statements, which NIST's Generative AI Profile calls confabulation.
- Knowledge cut-off: without search, it does not know recent events.
- Bias: reflects patterns in its training data.
- Security risks: can be manipulated through prompt injection when reading untrusted content.
- Privacy: what you type may be stored; avoid confidential information in personal accounts.
How Do You Use It Well?
- State your role, goal and audience: "I am a CCNA student; explain VLANs for a revision note."
- Ask for a format: table, steps, code block or a word limit.
- Provide source material when accuracy matters, and ask it to stick to that material.
- Ask for assumptions and uncertainties.
- Verify facts, figures and code before relying on them.
Related: the history of AI and deep learning. WebAsha offers AI fundamentals courses.
How Does ChatGPT Compare with Other Assistants?
| Assistant | Company | Notes |
|---|---|---|
| ChatGPT | OpenAI | Broad general assistant with tools and custom GPTs |
| Gemini | Integrated with Google Workspace and search (formerly Bard) | |
| Claude | Anthropic | General assistant with long-document handling |
| Microsoft Copilot | Microsoft | Integrated with Windows and Microsoft 365 |
| Open-weight models | Various (Meta Llama, Mistral and others) | Can run on your own hardware |
Capabilities change quickly; compare them on your own tasks rather than on marketing claims. Open models can be run locally with tools such as Ollama when data must stay on your machine.
How Do You Use ChatGPT Safely for Security Work?
- Never paste secrets, private keys, customer data or internal IP addresses into personal accounts.
- Treat generated commands and code as untrusted; read them before running, especially with sudo.
- Check suggested CVE details against NVD and vendor advisories; models can invent identifiers.
- Be aware of prompt injection when the assistant browses or reads files, as described in the OWASP LLM Top 10.
- Follow your organisation's policy and India's CERT-In guidance on generative AI.
References
Frequently Asked Questions
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Wow
0
Sad
0
Angry
0