llm.c by hand ✍️ C meets Transformer
This combination is perhaps as low as we can get to explain how the Transformer works.
Special thanks to @Andrej Karpathy
--
Part 1: gpt2_forward
Karpathy's llm.c implements the transformer forward step as the following sequence.
(skip)layernorm_forward
1. matmul_forward
2. attention_forward
3. matmul_forward
(skip) residual_forward
(skip) layernorm_forward
4. matmul_forward
5. gelu_forward
6. matmul_forward
(skip)residual_forward
--
Part 2: matmul_forward
B: Batches (of Tokens)
T: Tokens
C: Input Channels
OC: Output Channels
--
C programming and matrix multiplication are two of the most important topics. But it is often difficult to get people excited by these topics.
I hope this exercise can help people see further into the LLM black box, and appreciate C programming and matrix multiplication by hand. 😀
---
100% original, made by hand ✍️
Join 56K+ readers of my newsletter: https://t.co/fFt8roc8D9
@UmArchitectBR@srprogrammer software com 150 clientes eh um demo, nao acredito que utilizar lowcode como backend e fazer cruds pode ser chamado de sistema, me mostra como vc deve seguir a LGPD criptografando os dados os dados dos seus clientes no seu banco? seu código é apenas um miojo! nada mais.
recentemente o MrBeast conseguiu a façanha magnânima de bater o recorde de retweets nessa rede ao prometer repassar por diversão $25,000 para 10 pessoas que repostassem o Tweet abaixo
mas tem um detalhe que me chamou atenção...
https://t.co/k8mmvzpMtY
Bolsonaro vence a eleição. Eleitores de Lula, indignados, fecham estradas, ruas, insinuam fraude eleitoral e sugerem uma revolução armada para tomar o poder.
Imagina o tanto de borracha que estaria cantando agora.