← All links
Theme
Using automatic theme
Back to top

Article notes

What Is ChatGPT Doing… and Why Does It Work?

By Stephen Wolfram

Read the original

Listen

Audio version

A direct reading of the notes, with clickable timestamps throughout the article.

Total length: 9:30
9:30 remaining

In one sentence

ChatGPT works by repeatedly predicting a plausible next token with a very large trained neural network. Its surprising coherence suggests that human language and ordinary thought contain more compressible structure—and perhaps more discoverable “laws”—than previously assumed. Yet next-token prediction alone does not guarantee factual correctness or deep computation; reliable systems must use external computational tools.

Overview

Published February 14, 2023, the essay explains ChatGPT from the outside in. Wolfram begins with the simple operational picture: given the text so far, estimate probabilities for possible next tokens, sample one, append it, and repeat. He then explains why naïve word-frequency or n-gram methods fail, introducing neural networks as flexible models that interpolate beyond examples. The discussion progresses through training, embeddings, transformers, attention, post-training human feedback, and the limits imposed by feed-forward computation. The final sections interpret ChatGPT’s success as evidence that meaningful language has hidden regularities that might eventually be expressed through semantic grammar or computational language.

Core ideas

The core loop is next-token prediction

ChatGPT does not compose an entire essay at once. It repeatedly estimates a probability distribution over possible next tokens, selects one—sometimes using controlled randomness—and feeds the growing text back into the same process. “Token” matters because the unit may be a word fragment rather than a whole word. This simple loop can produce large-scale coherence when the probability model is good enough.

Why simple lookup tables are insufficient

A model based only on observed word or phrase frequencies would run out of data: the number of possible long sequences vastly exceeds the amount of text available. An LLM therefore learns a compact, parameterized model that estimates probabilities for sequences it has never literally encountered. The important achievement is generalization, not memorization of every passage.

Neural networks learn functions, not explicit rules

A neural network is a large mathematical function built from simple weighted operations and nonlinear activation functions. Training adjusts the weights to reduce a loss function on examples, usually by gradient-based optimization. The network is not explicitly programmed with rules such as “look for whiskers” or “apply grammar”; useful intermediate features and procedures emerge through training.

Embeddings turn language into geometric representations

Words, tokens, and longer passages are represented as high-dimensional arrays of numbers. Items used in similar contexts tend to occupy nearby regions in an abstract meaning space. These embeddings let the network work with relationships among words and contexts rather than treating every word as an unrelated symbol. The geometry is useful, but its exact semantic interpretation remains unclear.

Transformers provide selective memory through attention

A transformer processes token embeddings while allowing each position to “attend” selectively to earlier positions. This gives the model a way to connect a current word with relevant material much farther back than a simple local n-gram could. ChatGPT’s operation consists of embedding tokens and positions, passing them through many attention blocks, and decoding the final representation into next-token probabilities.

Training has two importantly different stages

First comes large-scale pretraining on human-produced text, where the model learns to predict missing or subsequent tokens without manually labeled answers. Then human feedback is used to make outputs more conversational and less likely to wander. Human judgments train a separate preference model, which helps tune the original system toward responses people rate as better.

Coherence is not the same as truth or computation

The model is optimized to continue text plausibly, not to verify claims against the world. It can produce locally convincing language while failing at global consistency, formal logic, arithmetic, long-range counting, or computationally irreducible tasks. Wolfram’s practical conclusion is that language models should call external tools—such as symbolic or numerical systems—when correctness requires explicit computation.

Computational irreducibility sets a ceiling

Some processes cannot be shortcut: to know their outcome, one must effectively carry out the steps. Wolfram argues that trainability depends on compressing regularities, whereas powerful general computation often resists compression. This creates a tradeoff: a network that is easy to train may be poor at deep algorithmic computation unless it can invoke an external computational system. Wording such as “computational irreducibility” reflects Wolfram’s broader theoretical framework, not an uncontested explanation of all LLM limitations.

Practical takeaways

Caveats and counterpoints

Questions worth revisiting

Return to this when…

Return to this note when you need a compact conceptual map of LLMs: next-token prediction → learned neural-network function → embeddings and attention → training and human feedback → coherent but non-guaranteed output → need for external tools. Revisit the caveats before using Wolfram’s broader claims about language, thought, or semantic laws as established conclusions.

References

  1. What Is ChatGPT Doing … and Why Does It Work?—Stephen Wolfram Writings