<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/medium-p64bynjtm" -->

---
title: Medium | daily.dev
description: An intuitive explanation of self-attention in Transformer models, walking through how tokens exchange information using Query, Key, and Value vectors. Uses...
canonical: https://daily.dev/posts/medium-p64bynjtm
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Medium | daily.dev
og:description: An intuitive explanation of self-attention in Transformer models, walking through how tokens exchange information using Query, Key, and Value vectors. Uses...
og:url: https://daily.dev/posts/medium-p64bynjtm
og:image: https://api.daily.dev/og/posts/P64BynjTm.png
og:image:alt: Medium
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Medium

**[Medium](https://daily.dev/sources/medium_js)** · 4 min read · 0 upvotes · 0 comments

## Summary

An intuitive explanation of self-attention in Transformer models, walking through how tokens exchange information using Query, Key, and Value vectors. Uses examples like resolving the pronoun 'it' and the ambiguous word 'bank' to show how attention scores determine relevance and how Value vectors carry the actual information transferred between tokens. Explains why the mechanism is called 'self'-attention because Q, K, and V all derive from the same sequence.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://medium.com/@yeonju123/self-attention-how-words-learn-from-other-words-89dd4e076292>

## Questions this post answers

### What are Query, Key, and Value in self-attention and what does each one do?

Query, Key, and Value are three learned vector representations created for each token in a Transformer. The Query represents what information a token is looking for, the Key represents what kind of information a token contains, and the Value represents the actual information a token contributes. Query and Key are compared to compute relevance scores, while Value vectors are weighted by those scores to gather the information actually transferred into a token's updated representation.

_Grasping Q, K, and V roles helps when debugging or explaining transformer architectures, a topic developers track on daily.dev._

### Why is it called self-attention instead of just attention?

It is called self-attention because the Queries, Keys, and Values are all derived from tokens within the same sequence, meaning each token attends to other tokens in that same input. This differs from other attention forms where one sequence attends to information from a separate sequence, such as in encoder-decoder cross-attention.

_Developers exploring transformer internals can follow deeper architecture explainers on daily.dev._

## Similar posts on daily.dev

- [How Self-Attention Works in Large Language Models: Explained with Simple Examples](https://daily.dev/posts/how-self-attention-works-in-large-language-models-explained-with-simple-examples-g2g9mklnw) · Code Like A Girl · 4 upvotes · 0 comments
- [The Q, K, V Matrices](https://daily.dev/posts/the-q-k-v-matrices-aeoio0pms) · Hacker News · 0 upvotes · 0 comments
- [The Machine Learning “Advent Calendar” Day 24: Transformers for Text in Excel](https://daily.dev/posts/the-machine-learning-advent-calendar-day-24-transformers-for-text-in-excel-38pg2g7xb) · Towards Data Science · 0 upvotes · 0 comments
- [Multi-Head Attention Explained: Queries, Keys, and Values Made Simple](https://daily.dev/posts/multi-head-attention-explained-queries-keys-and-values-made-simple-6tda3mel9) · DigitalOcean Community · 0 upvotes · 0 comments
- [Self-Attention: The Innovation That Changed AI](https://daily.dev/posts/self-attention-the-innovation-that-changed-ai-x8tcpysf8) · Medium · 0 upvotes · 0 comments

---

Tags: [#machine-learning](https://daily.dev/tags/machine-learning), [#deep-learning](https://daily.dev/tags/deep-learning), [#nlp](https://daily.dev/tags/nlp), [#transformers](https://daily.dev/tags/transformers)

[View this post on daily.dev](https://daily.dev/posts/medium-p64bynjtm)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Medium","url":"https://daily.dev/posts/medium-p64bynjtm","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/medium-p64bynjtm"},"datePublished":"2026-08-24T03:18:29.116Z","dateModified":"2026-08-24T03:19:33.471Z","description":"An intuitive explanation of self-attention in Transformer models, walking through how tokens exchange information using Query, Key, and Value vectors. Uses...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/a05cabdb972fe583120e04dc61485789?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/a05cabdb972fe583120e04dc61485789?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Medium","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Medium","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/medium","url":"https://daily.dev/sources/medium_js"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/medium-p64bynjtm","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"machine-learning,deep-learning,nlp,transformers","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Medium","item":"https://daily.dev/sources/medium_js"},{"@type":"ListItem","position":3,"name":"Medium"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/medium-p64bynjtm#faq","mainEntity":[{"@type":"Question","name":"What are Query, Key, and Value in self-attention and what does each one do?","acceptedAnswer":{"@type":"Answer","text":"Query, Key, and Value are three learned vector representations created for each token in a Transformer. The Query represents what information a token is looking for, the Key represents what kind of information a token contains, and the Value represents the actual information a token contributes. Query and Key are compared to compute relevance scores, while Value vectors are weighted by those scores to gather the information actually transferred into a token's updated representation. Grasping Q, K, and V roles helps when debugging or explaining transformer architectures, a topic developers track on daily.dev."}},{"@type":"Question","name":"Why is it called self-attention instead of just attention?","acceptedAnswer":{"@type":"Answer","text":"It is called self-attention because the Queries, Keys, and Values are all derived from tokens within the same sequence, meaning each token attends to other tokens in that same input. This differs from other attention forms where one sequence attends to information from a separate sequence, such as in encoder-decoder cross-attention. Developers exploring transformer internals can follow deeper architecture explainers on daily.dev."}}]}
```

