attention-variants-from-papers
Agent skill frombenchflow-ai/skillsbench
Implement paper-defined attention variants by extracting mechanism invariants, mapping tensor shapes, preserving module interfaces, validating numerical behavior, and integrating the custom attention into an existing transformer stack.
How to install attention-variants-from-papers
install attention-variants-from-papers
# install the skillsbench pack with the skills CLI
npx skills add benchflow-ai/skillsbench# or add only this skill to Claude Code: copy the folder
tasks-extra/diff-transformer_impl/environment/skills/attention-variants-from-papers/
# into
~/.claude/skills/attention-variants-from-papers/ (all projects)
.claude/skills/attention-variants-from-papers/ (one project)
tasks-extra/diff-transformer_impl/environment/skills/attention-variants-from-papers/SKILL.md
Apache-2.0Full file1# Attention Variants from Papers23Use this skill when a paper changes how attention scores, branches, normalization, or head sharing work, but the module still needs to behave like a drop-in transformer attention block.45## Workflow671. Read the paper for invariants, not names.8 Use [paper-to-implementation.md](references/paper-to-implementation.md) to extract the external contract, the changed computation, and the training-time constraints.92. Build a shape ledger before coding.10 Use [shape-ledger.md](references/shape-ledger.md) to track projections, head grouping, branch count, and output width.113. Choose the mechanism pattern.12 Use [mechanism-patterns.md](references/mechanism-patterns.md) for subtractive attention, branch mixing, learned gates, and extra normalization.134. Preserve the module boundary.14 Keep the same input and output shape, mask semantics, positional encoding flow, and cache behavior unless the task explicitly changes them.155. Validate in layers.16 Start with random-tensor smoke tests, then compare against a baseline attention path. Use [stability-and-validation.md](references/stability-and-validation.md).176. Integrate into the stack last.18 Swap the new module into one transformer block, verify the residual path, then roll it through the full model. Use [transformer-integration.md](references/transformer-integration.md).1920## Checklist2122- extract the paper's invariants before writing code23…
Excerpt shown under the repository's Apache-2.0 license.
