---
title: "Inside a Transformer: An Interactive, Step-by-Step Explainer"
description: "Follow one sentence from raw text to a next-token prediction. A tiny GPT-style transformer computes tokens, embeddings, attention, MLP and softmax live in your browser."
keywords: "transformer explained, how transformers work, self-attention, GPT, LLM internals, interactive explainer, attention heatmap"
url: "https://withashish.com/inside-llm/inside-a-transformer"
language: "en"
---

[Inside a LLM Concept](/inside-llm) / Concept 01

Concept 01 · Interactive explainer

# Inside a Transformer

Follow one sentence from raw text to a next-token prediction. **Every number is computed live in your browser** by a tiny 2-block GPT-style model \(vectors of size 8, 2 attention heads\) with random weights. The arithmetic is exactly what a real model does. The weights are untrained, so the prediction itself is noise.

Sentence Run

← Back Play Next →

Tip: use the ← and → keys to move between steps. Hover any coloured cell to see its value.

[← All concepts](/inside-llm)

Part of the [Inside a LLM Concept](/inside-llm) series.