Conceptual

Self-Attention Mechanism

Every position emits query, key, and value projections; each output is a softmax-weighted sum of all values, weighted by scaled query-key dot products. Any position can attend to any other in one step, at O(n^2) cost in sequence length.