What Is ChatGPT and How It Works
What Is ChatGPT and How It Works
ChatGPT is a conversational assistant powered by a large language model (LLM). It reads your message, predicts the most likely next tokens, and returns a coherent answer. It generates text; it does not search the web or look up answers in a database. That single fact explains most of what is useful and most of what is dangerous about it.
Tokens, Not Words
The model processes text in chunks called tokens. A token is often a short word fragment, so words such as "developer" may use multiple tokens. Token count drives cost and response limits, so thinking in tokens matters when you build with the API.
How the Model Is Trained
Training starts with a huge body of public text. The model learns to predict the next token and adjusts billions of internal weights. A second stage, reinforced by human feedback (RLHF), steers answers toward helpful, truthful, and harmless responses. This is why the model refuses some requests and why answers feel natural.
A Minimal API Example
The same engine is available through the OpenAI API. A basic chat completion in Python looks like this:
from openai import OpenAI
client = OpenAI()
response = client.chat.completions.create(
model="gpt-4o",
messages=[
{"role": "user", "content": "Explain recursion to a junior developer"}
]
)
print(response.choices[0].message.content)What It Can and Cannot Do
- Can: explain concepts, draft and review code, summarize long text, translate between styles, and act as a brainstorming partner.
- Cannot: run your code, reach private systems, know events after its training cutoff, or guarantee that claims are true.
Treat every answer as a strong draft. Verify facts, run the code, and read the docs. ChatGPT is a multiplier for a developer who directs it, not a replacement for understanding.
Key Points
- ChatGPT is a language model that generates text by predicting tokens.
- It is not a search engine; responses must be verified.
- Tokens, not words, drive cost and limits.
- The API exposes the same model for programmatic use.