executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
residual_joint_modelCompute residual EBM sequence scores and normalized importance weights from fixed LM proposal log probabilities and scalar energies.
Independent GitHub snapshot · Automated classification · Original documentation governs
Use this skill when implementing a residual energy-based text model where a fixed locally normalized language model proposes whole continuations and a sequence-level energy model corrects their probabilities.
Do not use this skill to train the base language model, normalize token-level vocabulary distributions, or read the original paper repository. It only handles sequence-level residual scoring and candidate-set normalization.
prefix: context shared by all candidate continuations.candidates: records with id, text, optional lm_logprob, and required energy.joint: rank by lm_logprob - energy.energy: rank by -energy when proposal log probabilities are unavailable.joint_logscore when lm_logprob is present.exp(-energy).lm_logprob - energy.-energy.Run:
python scripts/residual_joint.py --demo
python -m pytest tests
The tests verify exact score arithmetic, stable normalization, and deterministic selection.
Candidate-set normalization is not the full partition function over all text. It is valid as proposal-sample reweighting evidence or as a reduced proxy, not as a full perplexity claim unless the proposal sample size and estimator protocol match the paper target.