Загрузка видео...

Не удалось загрузить видео

На главную

Transformer by hand✍️ Excel ~ I designed this exercise to show the core math of a Transformer model is to combine columns (attention), combine rows (feed forward), and repeat.👇Join the 'AI Math' community. 👇Download xlsx.

66,816 просмотров • 1 год назад •via X (Twitter)

Комментарии: 0

Нет доступных комментариев

Здесь появятся комментарии из оригинального поста

Похожие видео

Transformer by hand ✍️ ~ 6 steps walkthrough below Open the hood of a transformer and the parts list is overwhelming: embeddings, positional encoding, attention weighting, self-attention, cross-attention, multi-head attention, layer norm, skip connections, softmax, linear, Nx, shifted right, query, key, value, masking. Which of those actually make the car run? Two of them. Attention weighting and the feed-forward network. Everything else is an enhancement to make it run faster and longer, which is how we got from a car to a truck, and to the word "large" in large language model. So I drew and calculated those two parts entirely by hand. Goal: push five features through one transformer block, filling in every cell yourself. 1. Given Five positions of input features, arriving from the previous block. 2. Attention matrix Let us feed all five features to a query-key module (QK) and read back an attention weight matrix, A. The details of that module are a post of their own. 3. Attention weighting We multiply the input features by A to get the attention weighted features, Z. Still five positions. The effect is to combine features *across positions*, horizontally: X1 becomes X1 + X2, X2 becomes X2 + X3, and so on. 4. First layer Let us feed all five weighted features into the first layer of the FFN. Multiply by the weights and biases. This time the combining happens *across feature dimensions*, vertically, and each feature grows from 3 numbers to 4. Note that every position goes through the same weight matrix. That is what "position-wise" means. 5. ReLU We cross out the negatives. They become zeros. 6. Second layer Let us bring it back down: 4 dimensions to 3. The output feeds the next block, which has a completely separate set of parameters, and the whole thing runs again. You have just calculated a transformer block by hand. ✍️ The takeaway: the two parts are doing two different jobs, and neither one alone is enough. Attention mixes *across positions*, so a feature can see its neighbours. The FFN mixes *across feature dimensions*, so each position can think about itself. Horizontal, then vertical. Then that pattern repeats N times, each block with its own separate set of weights. That is the Nx from the list up top, and that is what makes the transformer run. 💾 Save this post! #AIbyHand #Transformers #DeepLearning

Tom Yeh

26,089 просмотров • 1 месяц назад

GUYS!! NIGERIA, AEDC, AND TINUBU HAPPENED TO MY SMALL COMMUNITY IN LUGBE YESTERDAY!!!😥 For almost 3 years since I built my small hut in this community, we have been battling with epileptic power situation due to the overloaded Transformer which has been serving 3 communities including mine. In December 2025, after myself and a few community members spearheaded a regime change and ensured a proper election was conducted. After the election, we told the newly elected chairman (who happens to be my very very good friend) that the priority is for us to get our own dedicated Transformer for the community. Initially, we were thinking of buying. But considering it will cost over N20million to buy a 500KVA Transformer and another N15million plus for accessories and installation, the mission looked impossible. Then I and others told the Chairman that we can actually give it a try an reach out to the aedcelectricity for a Transformer given that the NERC Nigeria has told Nigerians that it is the responsibility of the DISCOs to provide Transformer and any power related infrastructure to any community or area in need of such infrastructure. Considering the Nigerian factor, many, infact, almost the entire community said it was never going to be possible for AEDC to give us a Transformer free of charge. But as someone who has been an advocate of government and who has always benefited from government by following due process, I encouraged my community and the Chairman that this is actually worth a try. In January 2026, we drafted a Transformer request letter and submitted to the AEDC Head Office at Wuse Zone 4, and the processes began. Low and behold, in less than 4 months, the AEDC, yesterday, delivered a brand new 500KVA Transformer with complete accessories to my community FREE-OF-CHARGE!🤸‍♂️🕺 I have told my community people that we have started benefitting our own share of the N3.3trillion approved by President Bola Ahmed Tinubu to GENCOs and all of us have agreed that come 2027, it is TINUBU OR NOTHING!!!🤗💪🏾 God bless the AEDC! God bless NERC!! God bless President Tinubu!!! God bless Nigeria 🇳🇬🙏🏾

𝒀𝑨𝑺𝑺𝑬𝑹 𝑨𝑺𝑬𝑲𝑶𝑴𝑬 𝑮𝑨𝑹𝑩𝑨, PGD, MLSCM

54,130 просмотров • 4 месяцев назад