logo
How it worksCoursesResearch CommunitiesBenefitsAbout Us
Schedule Demo
Learn Before
  • Generation of Query, Key, and Value Vectors in Self-Attention

    Concept icon
Case Study

Calculating a Query Vector in Self-Attention

Using the provided input vector and weight matrix, calculate the corresponding query vector. Show the steps of your calculation.

0

1

Updated 2025-10-06

Contributors are:

Gemini AI
Gemini AI
🏆 2

Who are from:

Google
Google
🏆 2

Tags

Ch.5 Inference - Foundations of Large Language Models

Foundations of Large Language Models

Foundations of Large Language Models Course

Computing Sciences

Application in Bloom's Taxonomy

Cognitive Psychology

Psychology

Social Science

Empirical Science

Science

Related
  • Single-Step Generation with a KV Cache

  • Updating the KV Cache

  • In a self-attention layer processing an input sequence of two tokens, let the input vector for the first token be x_1 and for the second token be x_2. The layer generates a query vector q_1 (for the first token) and a key vector k_2 (for the second token). Which statement accurately describes the relationship between these inputs and generated vectors?

  • Correcting a Misconception in Vector Generation

  • Calculating a Query Vector in Self-Attention

  • In a standard self-attention mechanism, an input vector is transformed into three separate vectors (Query, Key, and Value) using three distinct, learned weight matrices. Imagine a modified self-attention layer where these three weight matrices are constrained to be identical. What would be the most direct consequence of this change?

logo 1cademy1Cademy

Optimize Scalable Learning and Teaching

How it worksCoursesResearch CommunitiesBenefitsAbout Us
TermsPrivacyCookieGDPR

Contact Us

iman@honor.education

Follow Us




© 1Cademy 2026

We're committed to OpenSource on

Github