---
title: "Discussion on \"Self-Attention and Multi-Head Attention\" | Hashnode"
description: "Discussion on \"Self-Attention and Multi-Head Attention\". Build Self-Attention, Multi-Head, Causal, and Cross-Attention from scratch in PyTorch: the four building blocks behind every transformer."
url: "https://hashnode.com/posts/self-attention-and-multi-head-attention/6b0ed3c787f987670190d2da"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Self-Attention and Multi-Head Attention](https://backpropolis.hashnode.dev/self-attention-and-multi-head-attention?utm_source=hashnode&utm_medium=feed)

Build Self-Attention, Multi-Head, Causal, and Cross-Attention from scratch in PyTorch: the four building blocks behind every transformer.

18h ago · 16 min read · backpropolis.hashnode.dev  
Read the article

-   [#transformers](https://hashnode.com/tag/transformers)
-   [#attention](https://hashnode.com/tag/attention)
-   [#pytorch](https://hashnode.com/tag/pytorch)
-   [#deep-learning](https://hashnode.com/tag/deep-learning)
-   [#llm](https://hashnode.com/tag/llm)

## Written by

[David Hoang](https://hashnode.com/@backpropolis)

@backpropolis

  
[View profile](https://hashnode.com/@backpropolis)

learning NLP 🫠

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
