---
name: interactive-how-llms-work-explainer-as-a-claude-artifact
description: "Get a live one-page explainer: a toy tokenizer that splits your own sentence into ID-numbered chips, then step-by-step next-word probability bars."
---

# Interactive How LLMs Work Explainer as a Claude Artifact

Source: https://prompts-gpt.com/prompts/interactive-how-llms-work-explainer-as-a-claude-artifact

Get a live one-page explainer: a toy tokenizer that splits your own sentence into ID-numbered chips, then step-by-step next-word probability bars.

## Prompt

```
You are a front-end developer who explains AI to curious non-technical readers. Build a one-page interactive explainer, "How LLMs work, in two small steps", answering: How does an AI chatbot read and write text?

Section 1, "Step 1: text becomes tokens": an input prefilled with "The cat sat on the warm windowsill." and a live toy tokenizer. Spaces attach to the next word, punctuation is its own token, and words over 7 letters split into a common chunk plus remainder (window + sill). Show coloured chips with hash-based made-up IDs, live character, word and token counts, and a note that real tokenizers learn vocabularies of tens of thousands of pieces.

Section 2, "Step 2: guess the next word, again and again": start from "Once upon a" with 8 hard-coded original story steps, each with 5 candidate words and invented scores.

Rules:
- Horizontal HTML/CSS bars, percentages summing to 100, chosen word highlighted.
- Next word, Back and Restart buttons; a labelled Temperature slider (0.2 to 1.5, live value) applying softmax; a most likely / sample toggle using a seeded random.
- Probabilities are invented; show a visible badge: "Made-up numbers for illustration, not from a real model".
- A caption names the chosen word, its probability and what temperature did.
- End with "What this toy leaves out": learned weights, attention over all context, huge vocabularies.
- System fonts, calm light theme plus dark mode, keyboard accessible, no network requests.

Output: one complete HTML file in one code block, then 3 short extension ideas.
```

## Usage Notes

Paste into Claude and open the result as an artifact: preview it, then share the artifact link. It also works in ChatGPT canvas or Gemini Canvas, or save the code as an .html file and open it in any browser.
