attention-variants-from-papers

attention-variants-from-papers is a skill for Claude Code, Codex from benchflow-ai/skillsbench. It costs 41 tokens per session (532 once invoked), scanned A, original, Apache-2.0.

A guide for adding a new attention mechanism from a research paper to a transformer, a model architecture commonly used for language tasks. It explains how to preserve the surrounding module's expected inputs, outputs, masks, positions, and cached data.

In plain words
What is it for?
Use it to translate paper equations into code, track tensor shapes, add branches or gates, test numerical behavior, and place the new attention block into a transformer.
Why use it?
Research papers often describe the idea without spelling out every tensor size or software boundary. This helps prevent shape errors and behavior changes when replacing an existing attention block.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to translate paper equations into code, track tensor shapes, add branches or gates, test numerical behavior, and place the new attention block into a transformer.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/benchflow-ai/skillsbench/attention-variants-from-papers
About the project

SkillsBench is a benchmark for measuring how effectively AI agents use modular skills—folders containing instructions, scripts, and resources—to complete specialized tasks. It helps researchers and developers evaluate both skill quality and agent behavior, including tasks that require combining multiple skills. The catalogue’s skills and instructions are evaluated as part of this workflow.

benchflow-ai/skillsbench · 1,764 stars · on GitHub · skillsbench.ai

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add benchflow-ai/skillsbench --skill attention-variants-from-papers
Clone the repo
git clone --depth 1 https://github.com/benchflow-ai/skillsbench

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for attention-variants-from-papers

README.md
[![agentmods](https://agentmods.dev/badge/skills/benchflow-ai/skillsbench/attention-variants-from-papers/github.svg)](https://agentmods.dev/skills/benchflow-ai/skillsbench/attention-variants-from-papers)
Your own site
<a href="https://agentmods.dev/skills/benchflow-ai/skillsbench/attention-variants-from-papers"><img src="https://agentmods.dev/badge/skills/benchflow-ai/skillsbench/attention-variants-from-papers/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for attention-variants-from-papers

Your own site · 80×15
<a href="https://agentmods.dev/skills/benchflow-ai/skillsbench/attention-variants-from-papers"><img src="https://agentmods.dev/badge/skills/benchflow-ai/skillsbench/attention-variants-from-papers.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 532 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00041 $0.00532
Opus 5 $0.00020 $0.00266
Sonnet 5 $0.00008 $0.00106
Haiku 4.5 $0.00004 $0.00053

Measured 13d ago against content hash d9b08a7127b6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

attention-variants-from-papers scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 13d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

tasks-extra/diff-transformer_impl/environment/skills/attention-variants-from-papers/SKILL.md · 41 lines

How it starts

The opening of the file, as written. The whole thing — 41 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Attention Variants from Papers

Use 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.

Workflow

  1. Read the paper for invariants, not names. Use paper-to-implementation.md to extract the external contract, the changed computation, and the training-time constraints.
  2. Build a shape ledger before coding. Use shape-ledger.md to track projections, head grouping, branch count, and output width.
  3. Choose the mechanism pattern. Use mechanism-patterns.md for subtractive attention, branch mixing, learned gates, and extra normalization.
  4. Preserve the module boundary. Keep the same input and output shape, mask semantics, positional encoding flow, and cache behavior unless the task explicitly changes them.
  5. Validate in layers. Start with random-tensor smoke tests, then compare against a baseline attention path. Use stability-and-validation.md.
  6. Integrate into the stack last. Swap the new module into one transformer block, verify the residual path, then roll it through the full model. Use transformer-integration.md.

Checklist

  • extract the paper's invariants before writing code
  • account for every reshape, branch, and repeat in a shape ledger
  • preserve output width at concatenation or output projection
  • apply masks and positional terms at the intended stage
  • confirm random smoke tests stay finite
  • compare unchanged behaviors against a baseline attention implementation

Reference Map

Read the full file on GitHub · 41 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 13d ago First seen · 41 lines · 41 tokens per session scan A d9b08a7127b6

Subscribe to this mod's changes

attention-variants-from-papers is a skill published in the GitHub repository benchflow-ai/skillsbench (1,764 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 41 tokens to every session and 532 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.