Skip to content

Main content

Attention Mask Visible Key Count Tool

Count one supplied boolean attention-mask row under an explicit visibility convention.

Loading tool…

Description

Count visible and hidden keys under explicit mask polarity.

Attention masks mark which query-to-key relationships are visible. Implementations can use opposite Boolean polarities, so true need not always mean allowed. A mask share depends on the chosen row or head and its denominator; an empty selection has no defined share rather than proving that attention is absent.

Count visible and hidden keys under explicit mask polarity.

When to use this tool

Use Attention Mask Visible Key Count when checking the stated attention coordinate, visibility, angle or head-layout convention.

How to use the tool and how it works

  1. Enter mask, trueMeansVisible. 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 visibleKeys, hiddenKeys. Use the output convention below.

Count visible and hidden keys under explicit mask polarity. visibleKeys counts entries equal to trueMeansVisible, hiddenKeys subtracts visible from total.1

Input fieldMeaning and unitsAccepted input
maskMaskRequired. Array of boolean; maximum items 256.
trueMeansVisibleTrue interprets true mask entries as visible; false interprets false entries as visible.Required. Boolean.
Output fieldInterpretationReturned shape
visibleKeysVisible KeysRequired. Safe integer.
hiddenKeysHidden KeysRequired. Safe integer.
json
{
  "input": {
    "mask": [
      true,
      false,
      true
    ],
    "trueMeansVisible": true
  },
  "output": {
    "visibleKeys": 2,
    "hiddenKeys": 1
  }
}

Limitations and assumptions

  • An empty mask returns two zero counts; no sequence bounds, causal layout or attention computation is validated.
  • 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.

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-mask-visible-key-count — tool.io

Similar or alternative tools