计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
dpo_sequence_logprob_accounting【效率与协作】Compute response-only sequence log probabilities for DPO by masking prompts and padding before summing token log probabilities.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this skill when converting model token scores into the log pi(y|x) values consumed by DPO. It is appropriate for full model recovery and for deterministic tests of the DPO objective. Do not use it to normalize preference records or to compute the DPO loss itself.
-100 for prompt and padding tokens.average flag.-100 so prompt and padding positions do not affect the response probability.Run:
python scripts/logprob_accounting.py --self-test
python tests/test_logprob_accounting.py
The script uses standard-library math and expects log-probability inputs for reduced tests. Full tensor implementations should preserve the same mask semantics.