Skip to content
Back to skills

Pplm Latent Perturbation

ASecurity

Use when a PPLM-style controller must perturb latent/logit state at inference time with attribute and KL losses while freezing the base model.

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

Security analysis

A100/100

Scanned September 9, 2026

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

Installs into .claude/skills of the current project.

Are you the author of Pplm Latent Perturbation?

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

Security grade badge for Pplm Latent Perturbation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-pplm-latent-perturbation/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-pplm-latent-perturbation)

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

SKILL.md
---
name: pplm_latent_perturbation
description: Use when a PPLM-style controller must perturb latent/logit state at inference time with attribute and KL losses while freezing the base model.
---

# PPLM Latent Perturbation

Use this skill to implement the core PPLM inference-time update.

## Inputs
- Base next-token logits or latent state.
- Attribute loss function.
- Step size, iteration count, KL scale.

## Outputs
- Perturbed probability distribution.
- Trace with before/after loss, KL, and perturbation values.

## Workflow
1. Copy the base logits/state and keep it immutable.
2. Initialize a perturbation at zero.
3. Iteratively estimate the gradient of attribute loss plus KL-to-base penalty.
4. Update only the perturbation.
5. Return the final distribution and trace proving the target probability changed.

## Validation
Run `python tests/test_latent_perturbation.py`.

## Limitations
Reduced proxy implementations must declare that they are not full GPT-2 345M reproduction.

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…