From Evaluation to Optimisation: Hierarchy-Aware Training Signals for CWE Prediction in Python
Testing three delivery mechanisms–supervised fine-tuning, a dual-head classification loss, and reinforcement learning with a dense reward derived from the normalised penalty finds that supervised approaches consistently regress below the zero-shot baseline under distribution shift, while GRPO succeeds and generalises across independent training seeds.