知识卡片
按长度分组减少无效补齐
将长度接近的样本分入同一批,可减少padding浪费,但会改变批次组成与顺序。应保留随机化与数据分布的考虑;缩短最大长度也可能截断关键任务或答案,不能只看显存收益。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
- · 微调
原书出处 · 1 处
- · 查看原书依据
group_by_length This is used to group examples that have similar lengths in the same batch, so that the padding tokens can be optimized. max_train_epochs Number of passes over the training dataset. This is usually set to less than five to prevent overfitting: max_grad_norm=2 group_by_length=True max_train_epochs=3 Parameter-Efficient Fine-Tuning After filling in the TrainingArguments, let’s next fill in parameters of the PEFT library. The PEFT library by
参考来源
- 位置:《Designing Large Language Model Applications》第06章《微调》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Designing Large Language Model Applications/_epub-src/OEBPS/ch06.html)
- 结论依据:摘录中关于按长度分组减少无效补齐的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。
- 原始内容:group_by_length This is used to group examples that have similar lengths in the same batch, so that the padding tokens can be optimized. max_train_epochs Number of passes over the training dataset. This is usually set to less than five to prevent overfitting: max_grad_norm=2 group_by_length=True max_train_epochs=3 Parameter-Efficient Fine-Tuning After filling in the TrainingArguments, let’s next fill in parameters of the PEFT library. The PEFT library by