Checklist / 检查清单
Question Description / 问题描述
I am currently using the Swift PT pre-training framework to pre-train a Qwen3-VL-2B model.
During inference/evaluation, I would like to leverage Swift's internal loss computation to obtain the loss value for each individual sample in the evaluation dataset. My goal is to analyze model behavior at the sample level and identify examples with particularly high or low loss.
At the moment, Swift reports only the average loss across the entire evaluation dataset. However, I need to generate a log containing the loss value for every sample.
Is there an existing configuration, callback, or recommended approach within Swift to record and export per-sample evaluation losses? If not, what would be the best way to modify the evaluation pipeline to achieve this?
Checklist / 检查清单
Question Description / 问题描述
I am currently using the Swift PT pre-training framework to pre-train a Qwen3-VL-2B model.
During inference/evaluation, I would like to leverage Swift's internal loss computation to obtain the loss value for each individual sample in the evaluation dataset. My goal is to analyze model behavior at the sample level and identify examples with particularly high or low loss.
At the moment, Swift reports only the average loss across the entire evaluation dataset. However, I need to generate a log containing the loss value for every sample.
Is there an existing configuration, callback, or recommended approach within Swift to record and export per-sample evaluation losses? If not, what would be the best way to modify the evaluation pipeline to achieve this?