Skip to content

Main content

Attention Query Key Dot Scale Term Tool

Scaled dot-product attention logit before masking or softmax; key dimension determines the square-root scale.

Loading tool…

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

  1. Enter query, key. Follow any array-alignment requirements below. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. 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 fieldMeaning and unitsAccepted input
queryQueryRequired. Array of finite number; maximum items 256.
keyKeyRequired. Array of finite number; maximum items 256.
Output fieldInterpretationReturned shape
dotDotRequired. Finite number.
scaledScaledRequired. Finite number.
json
{
  "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

  1. Calculation and input contract: artificial-intelligence/attention-query-key-dot-scale-term — tool.io

Similar or alternative tools