Classification tasks in NLP are typically addressed by selecting a pre-trained language model (PLM) from a model hub, and fine-tuning it for the task at hand. However, given the very large number of PLMs that are currently available, a practical challenge is to determine which of them will perform best for a specific downstream task. With this paper, we introduce TransformerRanker, a lightweight library that efficiently ranks PLMs for classification tasks without the need for computationally costly fine-tuning. Our library implements current approaches for transferability estimation (LogME, H-Score, kNN), in combination with layer aggregation options, which we empirically showed to yield state-of-the-art rankings of PLMs (Garbas et al., 2024). We designed the interface to be lightweight and easy to use, allowing users to directly connect to the HuggingFace Transformers and Dataset libraries. Users need only select a downstream classification task and a list of PLMs to create a ranking of likely best-suited PLMs for their task. We make TransformerRanker available as a pip-installable open-source library https://github.com/flairNLP/transformer-ranker.
翻译:自然语言处理中的分类任务通常通过从模型库中选择一个预训练语言模型,并针对当前任务进行微调来解决。然而,鉴于当前可用的预训练语言模型数量庞大,一个实际挑战是如何确定其中哪一个模型在特定下游任务上表现最佳。本文介绍TransformerRanker,这是一个轻量级库,能够高效地为分类任务对预训练语言模型进行排序,而无需进行计算成本高昂的微调。我们的库实现了当前的可迁移性估计方法(LogME、H-Score、kNN),并结合了层聚合选项,我们通过实证研究表明这些方法能够产生最先进的预训练语言模型排序结果(Garbas等人,2024年)。我们将接口设计得轻量且易于使用,允许用户直接连接到HuggingFace Transformers和Dataset库。用户只需选择一个下游分类任务和一个预训练语言模型列表,即可生成针对其任务最可能适合的预训练语言模型排序。我们将TransformerRanker作为可通过pip安装的开源库提供:https://github.com/flairNLP/transformer-ranker。