Skip to content
Back to skills

Fisher Mask Search

ASecurity

Select Transformer heads and filters to prune using diagonal Fisher scores under a FLOPs budget.

  • 247 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 9, 2026
testingpythongo

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill fisher_mask_search --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Fisher Mask Search?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Fisher Mask Search
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-fisher-mask-search/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-fisher-mask-search)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: fisher_mask_search
description: Select Transformer heads and filters to prune using diagonal Fisher scores under a FLOPs budget.
---

# Fisher Mask Search

Use this skill when implementing post-training structured pruning for Transformers and you need the paper's first stage: a fast binary mask search from diagonal Fisher importance. Do not use it for unstructured weight pruning or when unit costs differ per individual head/filter without adapting the cost model.

## Inputs

- `head_scores`: nonnegative diagonal Fisher importance values for attention heads.
- `filter_scores`: nonnegative diagonal Fisher importance values for feed-forward filters.
- `head_cost`, `filter_cost`: positive per-unit costs.
- `budget`: maximum remaining cost.

## Outputs

- Binary head and filter masks where `1` is kept and `0` is pruned.
- Remaining cost, pruned Fisher loss, and selected kept counts.

## Workflow

1. Validate that scores are nonnegative and costs are positive.
2. Enumerate the number of remaining heads.
3. For each head count, keep the largest feasible number of filters.
4. Prune the least-important units of each type and score the candidate by pruned Fisher loss.
5. Return the minimum-loss feasible mask with deterministic tie breaking.

## Validation

Run `python tests/test_fisher_mask_search.py` or validate the skill tree with `validate_skill_tree.py --run-tests`.

Files in this skill

  • SKILL.md1.4 KB
  • scripts/fisher_mask_search.py1.9 KB
  • tests/test_budget_edge.py230 B
  • tests/test_fisher_mask_search.py386 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.