GitHub 项目简介: A straightforward method for training your LLM, from downloading data to generating text.
README: I implemented a transformer model from scratch using PyTorch, based on the paper Attention is All You Need. You can use my scripts to train your own billion or million parameter L…
README: A Transformer looks scary as one block of code, so we build it from four small pieces and then stack them.
README: Finally we wrap everything. Token ids become vectors through an embedding table, we add a position embedding so the model knows token order, we run the stack of blocks, normalize…
README: Pretraining is the long pole. We read random windows of tokens, ask the model to predict the next token at every position, measure how wrong it was with cross-entropy, and nudge t…