Skip to content
Back to skills

Prompt Training Loop

ASecurity

Optimize only universal visual prompt parameters while frozen model components remain unchanged.

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

Works with

  • cli

Security analysis

A100/100

Scanned September 9, 2026

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

Installs into .claude/skills of the current project.

Are you the author of Prompt Training Loop?

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

Security grade badge for Prompt Training Loop
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-prompt-training-loop/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-prompt-training-loop)

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

SKILL.md
---
name: prompt_training_loop
description: Optimize only universal visual prompt parameters while frozen model components remain unchanged.
---

# Frozen-Model Prompt Training Loop

Use this skill when a recovery or implementation must demonstrate the paper's central adaptation mechanism: the model is frozen and only a shared visual prompt is optimized with cross-entropy. It is not for fine-tuning, linear probing, or per-image adversarial perturbation.

## Inputs
- A frozen model or differentiable proxy that maps prompted examples to logits.
- Prompt parameters initialized once for the task.
- Training examples and labels.
- Learning-rate and step-count settings.

## Outputs
- Updated prompt parameters.
- A trace containing loss before and after optimization.
- Invariant checks showing frozen weights did not change.

## Workflow
1. Evaluate the unprompted or initial-prompt loss.
2. Compute cross-entropy gradients with respect to prompt parameters only.
3. Apply SGD or a recorded optimizer update to the prompt.
4. Re-evaluate loss and task metric.
5. Record `params_before`, `params_after`, `loss_before`, `loss_after`, and frozen-parameter checks.

## Validation
A tiny logistic proxy test verifies that one or more prompt updates reduce loss and leave frozen weights unchanged.

## Limitations
The helper script is intentionally scalar and lightweight for deterministic validation. Real CLIP recovery can replace the gradient provider while preserving the same contracts.

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…