Skip to content
Back to skills

Gedi Posterior

ASecurity

Compute GeDi generative-discriminator class posteriors from control and anti-control log probabilities using stable Bayes-rule normalization.

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

Security analysis

A100/100

Scanned September 9, 2026

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

Installs into .claude/skills of the current project.

Are you the author of Gedi Posterior?

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

Security grade badge for Gedi Posterior
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-gedi-posterior/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-gedi-posterior)

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

SKILL.md
---
name: gedi_posterior
description: Compute GeDi generative-discriminator class posteriors from control and anti-control log probabilities using stable Bayes-rule normalization.
---

# GeDi Posterior

## When to use
Use this skill when implementing or checking GeDi-style controlled generation or training and you have class-conditional sequence log probabilities for desired and undesired control codes. Do not use it for ordinary discriminative classifiers that do not compare generative likelihoods.

## Inputs
- Per-class sequence or token log probabilities.
- Sequence length for length normalization.
- Optional class biases/log priors.
- `alpha` normalization scale.

## Outputs
- Stable posterior probabilities over classes.
- Desired-class probability and diagnostic logits.

## Workflow
1. Sum token log probabilities per class if token-level values are provided.
2. Normalize each class log-likelihood by `alpha / length`.
3. Add class bias terms.
4. Apply stable log-softmax; for binary cases, sigmoid of the logit difference is equivalent.
5. Use the returned posterior as input to decoding or discriminative training.

## Validation
Run:

```bash
python tests/test_posterior.py
```

## Limitations
This skill computes the GeDi posterior only. It does not run a language model, tokenize text, or select next tokens.

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.