优化打包与打乱策略以提升生成式语言模型的性能
Refining Packing and Shuffling Strategies for Enhanced Performance in Generative Language Models
AI总结:
本研究针对自回归语言模型训练中的数据打包与打乱策略,探究不同原子大小对拼接、填充两种打包方式的影响,发现原子大小匹配最大序列长度时性能最优,填充法性能更高但计算效率更低,为训练策略选择提供依据。
摘要:
对词元进行打包与打乱是训练自回归语言模型(LM)时的常见做法,旨在防止过拟合并提升效率。通常,文档会被拼接成最大序列长度(MSL)的块,随后进行打乱。然而,将原子大小(即伴随随机打乱的每个数据块的长度)设置为MSL,可能会因不同文档的词元被打包进同一块而导致上下文不连贯。另一种方法是使用填充(padding)这一常见的数据打包策略,通过在每个被打乱的块中仅包含一份文档来避免上下文不连贯。为优化这两种打包策略(拼接与填充),我们研究了用于打乱的最优原子大小,并对比了它们的性能与效率。我们发现,将原子大小与MSL匹配可使两种打包方法(拼接和填充)的性能达到最优,且填充比拼接能得到更低的最终困惑度(更高的性能),但代价是需要更多训练步数且计算效率更低。这种权衡关系为语言模型训练中打包方法的选择提供了参考。
英文摘要:
Packing and shuffling tokens is a common practice in training auto-regressive language models (LMs) to prevent overfitting and improve efficiency. Typically documents are concatenated to chunks of maximum sequence length (MSL) and then shuffled. However setting the atom size, the length for each data chunk accompanied by random shuffling, to MSL may lead to contextual incoherence due to tokens from different documents being packed into the same chunk. An alternative approach is to utilize padding, another common data packing strategy, to avoid contextual incoherence by only including one document in each shuffled chunk. To optimize both packing strategies (concatenation vs padding), we investigated the optimal atom size for shuffling and compared their performance and efficiency. We found that matching atom size to MSL optimizes performance for both packing methods (concatenation and padding), and padding yields lower final perplexity (higher performance) than concatenation at the cost of more training steps and lower compute efficiency. This trade-off informs the choice of packing methods in training language models.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。