Description
Return scaled query-key dot product.
Attention calculations distinguish query/key scores, head layouts and visibility masks. A dot-product term, head grouping or supplied Boolean mask describes one part of a model; it does not run attention, infer a positional schedule or establish the behavior of a complete implementation.
Return scaled query-key dot product.
When to use this tool
Use Attention Query Key Dot Scale Term when checking the stated attention coordinate, visibility, angle or head-layout convention.
How to use the tool and how it works
- Enter query, key. Follow any array-alignment requirements below. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read dot, scaled. Use the output convention below.
Return scaled query-key dot product. Require aligned nonempty vectors; dot is their inner product, scaled = dot/sqrt(vector length).1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| query | Query | Required. Array of finite number; maximum items 256. |
| key | Key | Required. Array of finite number; maximum items 256. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| dot | Dot | Required. Finite number. |
| scaled | Scaled | Required. Finite number. |
{
"input": {
"query": [
1,
2,
3,
4
],
"key": [
1,
0,
1,
0
]
},
"output": {
"dot": 4,
"scaled": 2
}
} Limitations and assumptions
- No softmax, mask, value aggregation or full attention head is evaluated.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Inspect the complete model configuration and implementation for positional schedules, masking, softmax and actual inference behavior.
References
Similar or alternative tools
- Alibi Attention One Distance Penalty
Return one ALiBi-style distance penalty.
- Logit Scale Temperature Composition Tool
Compose positive multiplicative logit scale and two temperatures before softmax.