Run2 simpo loss implementation
Implements the SimPO loss function using stable log-probability operations in the specified trainer file.From its SKILL.md
npx -y skills add cxcscmu/SkillLearnBench --skill run2_simpo_loss_implementationAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
SKILL.md
0.6 KB, 130 tokens by cl100k_base, as published. Nobody here has run it
- Open
/root/SimPO/scripts/simpo_trainer.py. - Locate the
simpo_lossmethod within theSimPOTrainerclass. - Implement the formula: $L_{SimPO} = -\log(\sigma(\beta(\log \pi_\theta(y_w|x) - \log \pi_\theta(y_l|x)) - \gamma))$.
- Ensure all tensor operations explicitly cast inputs to
torch.float32to maintain precision parity with the unit test's fixed tensors. - Use
torch.nn.functional.logsigmoidor stable subtraction to prevent overflow during exponentiation.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.