针对时间和内存受限GPU服务上重型长文本分类的Transformer简单技巧
Simple Hack for Transformers against Heavy Long-Text Classification on a Time- and Memory-Limited GPU Service
AI总结:
本研究针对印尼语长文本分类,提出在有限GPU资源下通过去除停用词等简单技巧,结合动态HPO,用更少token实现更优性能。
摘要:
许多NLP研究者依赖免费计算服务(如Google Colab)来微调其Transformer模型,这导致在长文本分类中,由于方法具有二次复杂度且需要更大的资源,超参数优化(HPO)受到限制。在印尼语中,关于使用Transformer进行长文本分类的研究很少,大多数仅使用少量数据且未报告任何HPO。在本研究中,我们使用18k篇新闻文章,基于分词器的输出长度,调查推荐使用哪些预训练模型。然后,我们比较了一些缩短和丰富序列的技巧,包括去除停用词、标点符号、低频词和重复词。为了公平比较,我们提出并运行了一种高效且动态的HPO程序,该程序可以在有限资源上逐步进行,且不需要长时间运行的优化库。使用找到的最佳技巧,我们比较了512、256和128个token的长度。我们发现,去除停用词同时保留标点符号和低频词是最佳技巧。我们的一些设置设法使用更小的128或256个首token超越取512个首token,这些较小的token数能够表示相同的信息,同时需要更少的计算资源。这些发现可以帮助开发者在有限资源下高效地追求模型的最佳性能。
英文摘要:
Many NLP researchers rely on free computational services, such as Google Colab, to fine-tune their Transformer models, causing a limitation for hyperparameter optimization (HPO) in long-text classification due to the method having quadratic complexity and needing a bigger resource. In Indonesian, only a few works were found on long-text classification using Transformers. Most only use a small amount of data and do not report any HPO. In this study, using 18k news articles, we investigate which pretrained models are recommended to use based on the output length of the tokenizer. We then compare some hacks to shorten and enrich the sequences, which are the removals of stopwords, punctuation, low-frequency words, and recurring words. To get a fair comparison, we propose and run an efficient and dynamic HPO procedure that can be done gradually on a limited resource and does not require a long-running optimization library. Using the best hack found, we then compare 512, 256, and 128 tokens length. We find that removing stopwords while keeping punctuation and low-frequency words is the best hack. Some of our setups manage to outperform taking 512 first tokens using a smaller 128 or 256 first tokens which manage to represent the same information while requiring less computational resources. The findings could help developers to efficiently pursue optimal performance of the models using limited resources.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。