01Train BPE tokenizer
→02Embed + positional encoding
→03Causal multi-head attention
→04Feed-forward + residual
→05Train with schedule
→06Sample
StageTriggerSystemOutput
01 · TokenizeTriggerCorpus preparedSystemByte-pair encoding trained on the corpusOutputA vocabulary and merge rules; text becomes token IDs
02 · EmbedTriggerToken IDs batchedSystemToken embeddings plus positional encodingOutputA sequence of vectors carrying content and position
03 · AttendTriggerEach transformer blockSystemMulti-head self-attention with a causal maskOutputEach position mixed with earlier positions only
04 · TransformTriggerAfter attention in each blockSystemPosition-wise feed-forward, residual connections, layer normOutputA trainable deep stack that does not collapse
05 · TrainTriggerTraining loopSystemCross-entropy on next-token prediction, warmup and decay, gradient clippingOutputConverging loss with checkpoints
06 · GenerateTriggerInference from a promptSystemTemperature, top-k and nucleus sampling over logitsOutputGenerated text with controllable determinism and diversity