The most misleading thing about conversational AI is its confident fluency. Ask a question, and back comes an answer in polished, well-formed sentences. It is easy to anthropomorphize it, but behind those answers lie stark calculations rather than human thoughts.
Transformer Explainer, developed by a team associated with Georgia Tech’s Polo Club of Data Science, offers a glimpse into those calculations. Under the hood is a modest but genuine language model: the smaller, 124-million-parameter version of GPT-2. It runs directly in the browser, with nothing to install. It is free and open source, but works only in English. Users can enter their own sentences and follow the visualizations to see how the model arrives at the individual elements of its response. A good starting point is a short sentence opening: change a single word and watch what happens. The developers’ aim was to let curious non-specialists move gradually from the big picture into the details.
First, the sentence is split into tokens. A token may be a whole word, part of a word, or another unit of text. Each is associated with a numerical vector, and the system also receives information about its position in the text. From there, the visualization guides users through the processing blocks. Expanding the details reveals multi-head self-attention, where “attention” means mathematical weighting.
The query, key, and value matrices also come into view. They may look intimidating at first, but the principle is straightforward: comparing queries with keys produces attention weights, while the values supply the information to which those weights are applied. The MLP, or multilayer perceptron, then further transforms the internal representation of each token. The site also illustrates residual connections, in which the input to a processing branch is added to its output.
There is no need to get too bogged down in the details. Simply adjusting the temperature is enough to start exploring: lower settings give the more likely continuations a greater advantage, while higher settings make the probability distribution more even. Top-k filtering keeps only the k most likely candidates in contention; top-p narrows the field based on cumulative probability. This makes it easier to understand what “creativity” can mean in a chatbot. Adjusting the sampling settings affects the variety of its choices. It is worth trying the same sentence with several settings and observing what happens.
The demo can also be used in the classroom: everyone first guesses how the text will continue, then compares their prediction with the model’s output. For those who would prefer to begin with a guided explanation, 3Blue1Brown’s materials on transformers offer another route into the subject. Anyone interested in image generation can find further opportunities to experiment with Diffusion Explainer and GAN Lab, developed by the same research group.
So how does all this give rise to intelligent behavior? Even the precise role of a single attention head can be difficult to untangle, let alone the interplay between many layers. We know the calculations, and here we can see the patterns too. But exactly how learned patterns combine to produce complex capabilities that appear intelligent is something even leading researchers do not yet fully understand…