Skip to content
Back to skills

Progressive Lora Pruning Loop

ASecurity

Run LoRAPrune's iterative LoRA optimization, moving-average importance update, and progressive structured mask schedule.

  • 247 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 9, 2026
testingpythongobash

Security analysis

A100/100

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

Scanned September 9, 2026

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

Installs into .claude/skills of the current project.

Are you the author of Progressive Lora Pruning Loop?

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

Security grade badge for Progressive Lora Pruning Loop
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-progressive-lora-pruning-loop/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-progressive-lora-pruning-loop)

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: progressive_lora_pruning_loop
description: Run LoRAPrune's iterative LoRA optimization, moving-average importance update, and progressive structured mask schedule.
---

# Progressive LoRA Pruning Loop

Use this skill when recovering or implementing the central LoRAPrune algorithm after you have a LoRA-guided element importance function and a structured group masker. Do not use it as evidence for LoRAPrune unless it performs an actual optimizer step on LoRA parameters and records a trace.

## Inputs

- Calibration examples `(x, y)` or equivalent model batches.
- Frozen base weights or module `W0`.
- Trainable LoRA matrices `B` and `A`.
- Learning rate, iteration count, moving-average coefficient, and target structured sparsity.

## Outputs

- Updated LoRA parameters.
- Final group mask and per-iteration mask history.
- Training trace with loss before/after, raw group scores, moving-average scores, and prune count.
- Validator-compatible `params_before`, `params_after`, and `optimizer_step_executed` fields.

## Workflow

1. Start with all groups retained and moving-average scores initialized to zero.
2. For each calibration step, compute masked LoRA predictions and loss.
3. Backpropagate or analytically compute gradients only for LoRA parameters.
4. Compute LoRA-guided importance and aggregate it by structured group.
5. Update `Gbar_t = lambda * Gbar_{t-1} + (1-lambda) * Ghat_t`.
6. Apply an optimizer update to `A` and `B`.
7. Increase the prune count according to the progressive schedule and update the group mask.
8. Save enough trace data to prove the recurrence, optimizer change, and nondecreasing sparsity.

## Validation

The included deterministic tests run a tiny regression loop and check optimizer execution, monotonic pruning, and the moving-average recurrence.

```bash
python /share/project/yuyang/workspace/Paper2Skills/Distiller/skills/module-to-skill/scripts/validate_skill_tree.py <this_skill_dir> --run-tests
```

## Limitations

The script uses a small list-based linear model for bounded recovery. For real LLMs, replace the analytic gradient code with framework autograd while retaining the same trace fields and LoRA-only-gradient boundary.

Files in this skill

  • SKILL.md2.1 KB
  • scripts/group_pruning.py2.6 KB
  • scripts/lora_importance.py2.6 KB
  • scripts/progressive_loop.py3.8 KB
  • tests/test_no_prune_edge.py597 B
  • tests/test_progressive_loop.py1 KB

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.