xtuner icon indicating copy to clipboard operation
xtuner copied to clipboard

LengthGroupedSampler会导致loss周期性振荡

Open KooSung opened this issue 1 year ago • 1 comments

SFT InternVL2 时发现使用LengthGroupedSampler loss曲线会周期性振荡,使用DefaultSampler不会有这个问题。请问这是什么原因呢? 类似的问题 image

KooSung avatar Jul 09 '24 04:07 KooSung

这是因为他的长度分组设置。他会先设置一个桶大小,然后将数据长度从大到小进行排序,依次放入桶里面。然后再桶和桶之间打乱顺序。这就会导致这个现象。和你的数据分布也有点关系

hhaAndroid avatar Jul 09 '24 08:07 hhaAndroid