界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
开发与工程 · SKILL.md

fudge_logit_rescoring

fudge_logit_rescoring

【开发与工程】Apply the FUDGE decoding rule by combining base candidate logits with future-discriminator probabilities and renormalizing.

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: fudge_logit_rescoring description: Apply the FUDGE decoding rule by combining base candidate logits with future-discriminator probabilities and renormalizing.

FUDGE Logit Rescoring

Use this skill when a base autoregressive generator supplies candidate next-token logits and a future discriminator can score each candidate-extended prefix. The skill implements logit' = base_logit + strength * log P(attribute | prefix+candidate).

Inputs

  • prefix_tokens.
  • Mapping of candidate token to base logit.
  • Mapping/callable of candidate token to future probability.
  • Optional strength, top_k, and clipping epsilon.

Outputs

  • Normalized probabilities over retained candidates.
  • Audit trace with base logit, future probability, future log score, adjusted logit, and final probability.

Workflow

  1. Restrict to top-k base candidates if requested.
  2. Score each extended prefix with the future discriminator.
  3. Clip probabilities for numerical safety.
  4. Add future log scores to base logits.
  5. Softmax over retained candidates.
  6. Inspect the audit trace before claiming FUDGE was used.

Validation

Run python tests/test_rescoring.py.

Limitations

This helper does not load a language model. It is a deterministic FUDGE rescoring kernel.

我的收藏