Skip to main content
QUICK REVIEW

[Paper Review] UER: An Open-Source Toolkit for Pre-training Models

Zhe Zhao, Hui Chen|arXiv (Cornell University)|Sep 12, 2019
Topic ModelingComputer Science22 references5 citations
TL;DR

UER is an open-source, modular PyTorch toolkit for pre-training diverse NLP models by assembling interchangeable components—encoders, targets, and fine-tuning strategies—enabling efficient implementation of state-of-the-art models. It achieves competitive or SOTA performance on downstream tasks using pre-trained models from its publicly available model zoo, including efficient alternatives to BERT with comparable or better accuracy.

ABSTRACT

Existing works, including ELMO and BERT, have revealed the importance of pre-training for NLP tasks. While there does not exist a single pre-training model that works best in all cases, it is of necessity to develop a framework that is able to deploy various pre-training models efficiently. For this purpose, we propose an assemble-on-demand pre-training toolkit, namely Universal Encoder Representations (UER). UER is loosely coupled, and encapsulated with rich modules. By assembling modules on demand, users can either reproduce a state-of-the-art pre-training model or develop a pre-training model that remains unexplored. With UER, we have built a model zoo, which contains pre-trained models based on different corpora, encoders, and targets (objectives). With proper pre-trained models, we could achieve new state-of-the-art results on a range of downstream datasets.

Motivation & Objective

  • To address the lack of a flexible, extensible framework for developing and deploying diverse pre-training models across varying NLP tasks and hardware constraints.
  • To enable researchers and practitioners to assemble custom pre-training models by combining modular components (encoder, target, fine-tuning strategy) on demand.
  • To build and maintain a publicly accessible model zoo with pre-trained models based on different corpora, encoders, and objectives for immediate downstream use.
  • To demonstrate that model performance can be significantly improved by selecting task-specific pre-training objectives and encoders, even with lighter architectures like 2-layer LSTM.
  • To provide a high-performance, distributed training-compatible toolkit that supports reproducibility and extensibility for both research and industrial applications.

Proposed method

  • UER is structured as a loosely coupled framework with four core components: subencoder, encoder, pre-training target, and downstream fine-tuning strategy, each with multiple plug-and-play modules.
  • The toolkit supports modular composition—users can mix and match different encoders (e.g., BERT-style Transformer, LSTM), objectives (e.g., MLM, NSP, CLS, language modeling), and fine-tuning approaches.
  • Pre-training is performed on large-scale, domain-specific corpora (e.g., Amazon reviews, Wikipedia, BookCorpus) using PyTorch with support for distributed training.
  • The framework provides clear, minimal-interface APIs to allow easy integration of new modules, enabling both reproduction of existing models (e.g., BERT) and development of novel architectures.
  • A model zoo is constructed using UER, containing pre-trained models with varying encoders, objectives, and corpora, all publicly available via GitHub.
  • Evaluation includes both reproducibility checks (matching HuggingFace and ERNIE baselines) and ablation studies on downstream tasks to assess impact of encoder and objective choice.

Experimental results

Research questions

  • RQ1Can a modular, open-source toolkit enable efficient and flexible implementation of diverse pre-training models without sacrificing performance?
  • RQ2To what extent can alternative pre-training objectives (e.g., CLS instead of NSP) improve performance on sentence-level classification tasks like sentiment analysis?
  • RQ3Can lightweight encoders such as 2-layer LSTM achieve performance comparable to BERT when pre-trained on domain-specific corpora with optimized objectives?
  • RQ4How does model selection—based on corpus, encoder, and objective—impact downstream performance across diverse NLP tasks?
  • RQ5Can a unified toolkit like UER support both SOTA performance and high training efficiency, especially in resource-constrained settings?

Key findings

  • UER successfully reproduces BERT and ERNIE performance on benchmark datasets, with results matching or exceeding those of HuggingFace and ERNIE implementations.
  • Pre-training on domain-specific corpora (e.g., Amazon reviews) significantly improves performance on sentiment analysis tasks compared to BERT-base Chinese, which is pre-trained on Wikipedia.
  • Using a CLS-based objective for sentence-level reviews outperforms MLM-only and NSP-based objectives, achieving 95.8% accuracy on the Chnsenticorp dataset.
  • A 2-layer LSTM encoder with pre-training on Amazon reviews achieves 94.5% accuracy on Chnsenticorp, outperforming the BERT-base Chinese baseline (94.3%) and demonstrating that efficiency and performance can coexist.
  • The model zoo built with UER enables users to select optimal pre-trained models for specific downstream tasks, leading to consistent improvements over generic pre-trained models.
  • UER supports distributed training and provides full reproducibility through documented scripts, enabling researchers to reproduce results with minimal setup.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.