Simple Hack for Transformers against Heavy Long-Text Classification on a Time- and Memory-Limited GPU Service
Not on the map. Why?
Abstract (arXiv)
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.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 21 of its 36 references that are in the map. First posted on arXiv 19 Mar 2024.
Builds on
21 of 36 references.
References · 21
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2019DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lightercited by 4,243
- 2019Unsupervised Cross-lingual Representation Learning at Scalecited by 3,907
- 2020Longformer: The Long-Document Transformercited by 3,362
- 2019ALBERT: A Lite BERT for Self-supervised Learning of Language Representationscited by 2,772
- 2019Optuna: A Next-generation Hyperparameter Optimization Frameworkcited by 2,455
- 2020Efficient Transformers: A Surveycited by 784
- 2021Nystr"omformer: A Nystr"om-Based Algorithm for Approximating Self-Attentioncited by 468
- 2019How to Fine-Tune BERT for Text Classification?cited by 409
- 2021Hyperparameter Optimization: Foundations, Algorithms, Best Practices and Open Challengescited by 143
- 2020Hyper-Parameter Optimization: A Review of Algorithms and Applicationscited by 114
9 more
- 2019Hierarchical Transformers for Long Document Classificationcited by 103
- 2023XLM-V: Overcoming the Vocabulary Bottleneck in Multilingual Masked Language Modelscited by 88
- 2022NusaX: Multilingual Parallel Sentiment Dataset for 10 Indonesian Local Languagescited by 67
- 2022One Country, 700+ Languages: NLP Challenges for Underrepresented Languages and Dialects in Indonesiacited by 65
- 2020IndoLEM and IndoBERT: A Benchmark Dataset and Pre-trained Language Model for Indonesian NLPcited by 57
- 2022Efficient Classification of Long Documents Using Transformerscited by 30
- 2018IndoSum: A New Benchmark Dataset for Indonesian Text Summarizationcited by 13
- 2022Which Student is Best? A Comprehensive Knowledge Distillation Exam for Task-Specific BERT Modelscited by 5
- 2021Indonesia's Fake News Detection using Transformer Networkcited by 2
Built on by
Not cited yet.