Skip to content
Back to skills

Cad Logit Adjustment

ASecurity

Apply the Context-aware Decoding contrastive logit formula and report mechanism diagnostics for recovery experiments.

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

Security analysis

A100/100

Scanned September 9, 2026

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

Installs into .claude/skills of the current project.

Are you the author of Cad Logit Adjustment?

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

Security grade badge for Cad Logit Adjustment
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-cad-logit-adjustment/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-cad-logit-adjustment)

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

SKILL.md
---
name: cad_logit_adjustment
description: Apply the Context-aware Decoding contrastive logit formula and report mechanism diagnostics for recovery experiments.
---

# CAD Logit Adjustment

Use this skill for the paper's core next-token transformation: `adjusted = (1 + alpha) * logits(context, query, prefix) - alpha * logits(query, prefix)`. It does not construct prompts or score final answers.

## Inputs
- Context-conditioned logits as a token-to-score mapping.
- Query-only/prior logits as a token-to-score mapping.
- `alpha`, usually `0.5` for summarization or `1.0` for knowledge-conflict tasks.

## Outputs
Adjusted logits over the shared vocabulary plus diagnostics: alpha, regular argmax, prior argmax, adjusted argmax, and whether CAD changed the selected token.

## Workflow
1. Verify identical vocabularies.
2. Compute the CAD formula for each token.
3. Preserve logits without softmax unless probabilities are requested downstream.
4. Report argmax diagnostics for mechanism checks.

## Validation
Run `tests/test_logit_adjustment.py` or Distiller validation.

## Limitations
This script works on one decoding step; generation loops should call it repeatedly with updated prefixes.

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…