Editing
Attention Mechanisms
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== <span style="color: #FFFFFF;">Remembering</span> == * '''Attention''' β A mechanism that computes a weighted combination of input elements, where weights represent how relevant each element is to the current computation. * '''Self-attention''' β Attention applied to a single sequence where each element attends to all other elements of the same sequence. * '''Cross-attention''' β Attention where queries come from one sequence and keys/values from another; used in encoder-decoder models. * '''Query (Q)''' β A vector representing "what I am looking for" at the current position. * '''Key (K)''' β A vector representing "what I offer" for each position in the sequence. * '''Value (V)''' β A vector representing "what I give if selected" for each position. * '''Attention weight''' β The scalar importance assigned to each key-value pair given the query; computed via softmax of scaled dot products. * '''Attention head''' β One parallel attention operation; multi-head attention runs H heads simultaneously. * '''Multi-head attention''' β Running H attention operations in parallel with different projections, then concatenating outputs. * '''Scaled dot-product attention''' β The standard attention formula: Attention(Q,K,V) = softmax(QKα΅/βd_k)V. * '''Causal (masked) attention''' β Self-attention where each position can only attend to positions before it; used in autoregressive decoders. * '''Positional encoding''' β Information added to embeddings indicating each token's position, since attention is permutation-invariant. * '''Attention sink''' β The empirical phenomenon where early tokens attract disproportionate attention mass in LLMs. * '''Flash Attention''' β A memory-efficient, hardware-optimized implementation of exact attention using tiling and recomputation. * '''Sparse attention''' β Attention variants that restrict which positions can attend to which, reducing O(nΒ²) complexity. </div> <div style="background-color: #006400; color: #FFFFFF; padding: 20px; border-radius: 8px; margin-bottom: 15px;">
Summary:
Please note that all contributions to BloomWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
BloomWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information