slug: llm-fundamentals
title: "How LLMs Work — Tokens, Context Windows, and Model Behavior"
version: 1.0.0
description: "Understand tokens, tokenization, transformers, context windows, and why LLMs behave the way they do."
category: ai-and-llm
tags: [llm, ai, tokens, context-window, transformer, machine-learning]
difficulty: intermediate

xp:
  read: 15
  walkthrough: 40
  exercise: 25
  quiz: 20
  quiz-perfect-bonus: 10

time:
  quick: 5
  read: 25
  guided: 50

prerequisites: [prompt-engineering]
related: [rag-fundamentals, ai-agents]

triggers:
  - "How do LLMs work?"
  - "What are tokens in AI?"
  - "What is a context window?"
  - "Why do LLMs hallucinate?"

visuals:
  diagrams: [diagram-mermaid, diagram-architecture]
  quiz-types: [quiz-matching, quiz-timed-choice]
  playground: bash
  slides: true

sources:
  - url: "https://www.anthropic.com/research"
    label: "Anthropic Research"
    type: research
  - url: "https://arxiv.org/abs/1706.03762"
    label: "Attention Is All You Need"
    type: paper
