Skip to content

feat: Add Tiny Char-Level GPT That Learns Toy Sequences - #11

Open
ThomasHartDev wants to merge 1 commit into
mainfrom
thomas/feat/tiny-gpt
Open

feat: Add Tiny Char-Level GPT That Learns Toy Sequences#11
ThomasHartDev wants to merge 1 commit into
mainfrom
thomas/feat/tiny-gpt

Conversation

@ThomasHartDev

Copy link
Copy Markdown
Owner

Adds a one-block decoder-only language model over characters: token + position embeddings, causal self-attention, a residual ReLU FFN, and a linear vocab head, with hand-written backprop through the attention path. Trains with the existing Adam optimizer on next-token cross-entropy so a repeating ABAB corpus is enough to drop loss and prefer the right next character. Generate samples autoregressively under a temperature. pytest covers shapes, causal independence of past logits, finite-difference grads, and the learning check.

One-block decoder-only LM over characters with causal self-attention,
hand-derived backprop through attention, and Adam training on a toy
next-token task.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant