V4 Ventures

The Growth Catalyst Blog / AI fundamentals

How Chat-GPT and transformers work in a nutshell

Maximilian Freiermuth · November 2026 · 3 min read

A robot sets a metal word block into a line of type.

A brief explanation behind the alchemy that lends ChatGPT & Co their impressive cognitive capabilities.

How would you finish “The bank turned down my application for a...”? You probably picked “loan.” Change the first half to “We pulled the canoe onto the bank of the...” and “river” becomes a better bet. The same word is doing two jobs. A language model has to work out which one fits before it can write anything useful.

What goes into the model?

A tokenizer breaks the text into numbered pieces. A token can be a whole word, part of one, or punctuation. Each number selects a vector, a list of learned values the model can do arithmetic with. Information about position gives it a way to distinguish “the dog chased the cyclist” from “the cyclist chased the dog.” The vocabulary is identical. The story is quite different.

How does a word pick up meaning from its neighbors?

Take the sentence “The bank inspected the loan application.” At each position, an attention head computes a query, a key and a value from the current representation. The query is compared with the keys at positions the model can see. The resulting weights determine how much of each value gets mixed into the representation at that position.

In a GPT-style model, “loan” can draw on the earlier “bank.” When the model reaches “application,” both are available. Earlier positions cannot peek ahead. Several heads can mix information differently, and later layers can combine the results. The example illustrates what the mechanism makes possible. Finding a particular head that reliably means “banking” is a separate research question. Read the original transformer paper.

Where does the learning happen?

During pretraining, the model sees text and predicts the next token. Its predicted probabilities are compared with the token that actually followed. Training adjusts its weights so that, across many examples, better continuations receive higher probabilities. Patterns in grammar, facts and code all help with that task. The weights capture enough of those patterns that a few worked examples in a prompt can teach the model what format you want for this conversation. See the GPT-3 experiments on learning from examples.

An assistant needs another skill. If you ask “Could you shorten this email?”, a plausible continuation of web text might be somebody quoting your question. You want an edited email. One documented approach trained a model on demonstrations of helpful responses and then used human rankings to reward preferred answers. That helps explain the gap between finishing a sentence and following a request. Read the InstructGPT study.

What happens when you press send?

The model turns its final representation into a probability distribution over the vocabulary. A decoding rule chooses a token, appends it to the conversation and repeats. That is how a paragraph can appear a piece at a time. The same process can also produce a polished sentence containing a wrong number.

Try asking for the cancellation deadline in a contract. Give the assistant the relevant clause and ask it to return the date, the sentence that supports it and any condition that would change it. Then remove the clause and try again. For a product team, both trials matter. The first tests whether the system can read. The second tests what it does when nobody has given it the answer.

Back to the blog