naklecha/llama3-from-scratch ? reverse-engineered prompt
Reverse engineered prompt
Build me an educational Jupyter notebook that explains how Llama 3 works by recreating the forward pass from scratch, one tensor operation at a time. I want it to load the official Meta Llama 3 8B weights that the user has downloaded locally, read the tokenizer and model files, turn a prompt into tokens, convert them into embeddings, then walk through RMS normalization, attention, rotary embeddings, feed forward layers, and final token prediction using plain PyTorch tensor math.
Please make it feel like a guided lesson, not just code. Show tensor shapes after each important step, add short explanations in simple language, and include small diagrams or image placeholders where helpful. It should be able to run on a local machine if the weights are placed in the expected folder, and it should clearly tell the user what files they need from Meta before running. Keep the implementation transparent and readable so someone can understand the model without relying on a high level transformer library.
Are you gonna build this?
make sure you review the code using coderabbit