Skip to content
Back to skills

Pplm Attribute Objectives

ASecurity

Compute PPLM-style bag-of-words or linear-classifier attribute losses and gradients for controlled generation.

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

Security analysis

A100/100

Scanned September 9, 2026

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

Installs into .claude/skills of the current project.

Are you the author of Pplm Attribute Objectives?

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

Security grade badge for Pplm Attribute Objectives
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-pplm-attribute-objectives/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-pplm-attribute-objectives)

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

SKILL.md
---
name: pplm_attribute_objectives
description: Compute PPLM-style bag-of-words or linear-classifier attribute losses and gradients for controlled generation.
---

# PPLM Attribute Objectives

Use this skill when implementing or validating Plug and Play Language Model control objectives. It is appropriate when a fixed language model distribution must be steered toward a topic, sentiment, or toxicity-related attribute without changing model weights.

## Inputs
- `tokens`: vocabulary strings aligned with logits.
- `logits`: numeric next-token logits or a perturbable logit proxy.
- `target_words`: bag-of-words target tokens, or `classifier_weights` for a linear classifier proxy.

## Outputs
- Attribute loss where lower is better.
- Gradient over logits for minimization.
- Diagnostics including target probability mass.

## Workflow
1. Convert logits to a stable softmax distribution.
2. For bag-of-words control, sum probability mass assigned to target words.
3. Return `-log(target_mass)` as the loss and the analytic gradient with respect to logits.
4. Treat missing target words as an explicit contract error rather than silently succeeding.

## Validation
Run `python tests/test_attribute_objectives.py` from this skill directory, or validate through the Distiller skill-tree validator.

## Limitations
This deterministic helper validates the PPLM objective interface; it is not a full neural discriminator or GPT-2 forward pass.

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.