Skip to content
Back to skills

Gedi Guided Decoding

ASecurity

Reweight base language-model token probabilities with GeDi posteriors and apply GeDi cumulative-mass filtering for controlled decoding.

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

Security analysis

A100/100

Scanned September 9, 2026

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

Installs into .claude/skills of the current project.

Are you the author of Gedi Guided Decoding?

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

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

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

SKILL.md
---
name: gedi_guided_decoding
description: Reweight base language-model token probabilities with GeDi posteriors and apply GeDi cumulative-mass filtering for controlled decoding.
---

# GeDi Guided Decoding

## When to use
Use this skill when candidate next-token base log probabilities and GeDi desired-class posteriors are available and you need to produce a guided token distribution or greedy token choice.

## Inputs
- Candidate token strings or ids.
- Base LM next-token log probabilities.
- Desired-class posterior probabilities from a GeDi posterior computation.
- Steering weight `omega`.
- Cumulative-mass threshold `rho`.

## Outputs
- Guided probabilities.
- Retained-token mask after posterior sorting/filtering.
- Selected token for greedy decoding.

## Workflow
1. Compute guided logits as `base_logprob + omega * log(posterior)`.
2. Normalize the logits with log-sum-exp.
3. Sort tokens by GeDi posterior descending.
4. Keep the smallest prefix whose guided probability mass is at least `rho`.
5. Renormalize retained probabilities and select greedily unless sampling is explicitly requested.

## Validation
Run:

```bash
python tests/test_decoding.py
```

## Limitations
This skill does not compute posteriors or call a model; it consumes already-computed candidate posteriors.

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…