One token through a decoder-only model

One token through a decoder-only model A workflow diagram generated by Archify. 01 / Forward pass: same model weights in prefill and decode 02 / Temporary request state Tokenizer · text to token IDs · Forward pass: same model weights in prefill and decode Tokenizer text to token IDs Token embeddings · IDs to vectors · Forward pass: same model weights in prefill and decode Token embeddings IDs to vectors Decoder blocks · attention and MLP · Forward pass: same model weights in prefill and decode Decoder blocks attention and MLP Vocabulary head · scores for next ID · Forward pass: same model weights in prefill and decode Vocabulary head scores for next ID Sampling · choose next ID · Forward pass: same model weights in prefill and decode Sampling choose next ID Tokenizer decode · IDs to visible text · Forward pass: same model weights in prefill and decode Tokenizer decode IDs to visible text KV cache · per-layer keys, values · Temporary request state KV cache per-layer keys, values access KV next step Legend User UI Agent logic Context / trace