Abstract
PARAGEN is a PyTorch-based NLP toolkit for further development on parallel generation. PARAGEN provides thirteen types of customizable plugins, helping users to experiment quickly with novel ideas across model architectures, optimization, and learning strategies. We implement various features, such as unlimited data loading and automatic model selection, to enhance its industrial usage. ParaGen is now deployed to support various research and industry applications at ByteDance. PARAGEN is available at https://github.com/bytedance/ParaGen.
Introduction
Modern Natural Language Processing (NLP) has seen significant success with autoregressive models like GPT, which generate text sequentially, token by token. While highly accurate, this sequential nature introduces computational bottlenecks, particularly in real-time applications. Parallel generation (or non-autoregressive generation) offers a solution by producing entire sequences simultaneously, achieving massive speedups for latency-sensitive tasks.
However, existing frameworks such as FairSeq or HuggingFace Transformers were primarily designed for autoregressive workflows. Implementing parallel generation in these toolkits often requires complex "hacks" to accommodate specialized training strategies (e.g., glancing training) or non-standard decoding algorithms (e.g., noisy parallel decoding). PARAGEN addresses these challenges by treating parallel-specific requirements as first-class citizens within a modular, plugin-based architecture.
System Architecture and Methods
PARAGEN is built on a redesigned architecture centered around four primary functional blocks: Data Retrieval, Neural Network, Process Scheduler (Training/Inference), and Task.
Key Design Principles
- Separation of Model and Generator: A critical innovation in PARAGEN is the decoupling of the learnable neural network (
Model) from the inference logic (Generator). This allows researchers to implement complex, gradient-free decoding algorithms—such as beam search or mask-predict—without cluttering the core training code. - Modular Plugin System: The toolkit offers thirteen types of customizable plugins. This modularity extends to data sampling, learning rate scheduling, and optimization, allowing for rapid experimentation with novel ideas.
- Industrial-Grade Data Handling: To support large-scale industrial datasets, PARAGEN includes a
StreamingDataLoader. This component enables "unlimited" data loading from disk with constant memory consumption, preventing I/O bottlenecks during training. - Efficiency Integrations: PARAGEN natively integrates with LightSeq for high-performance training and inference, and supports HuggingFace for seamless access to pre-trained weights.
Experimental Evaluation
The versatility of PARAGEN was evaluated across a diverse set of standard NLP benchmarks, including machine translation, summarization, question answering, and general language understanding.
Machine Translation
The toolkit was tested on WMT14 (English-German, English-French) and IWSLT14 (German-English) datasets. PARAGEN's implementation of the Glancing Transformer (GLAT) achieved competitive results, reaching 24.58 BLEU on WMT14 En-De with checkpoint averaging. The toolkit also supports multilingual pre-training, as demonstrated by mBART results across various language pairs.
Summarization and Understanding
Beyond translation, PARAGEN demonstrated strong performance in abstractive summarization. BART-base models trained within the toolkit achieved 42.49 Rouge-1 on the XSum dataset. For general language understanding, the toolkit successfully reproduced BERT pre-training from scratch on custom datasets, achieving an accuracy of 93.00 on the SST-2 benchmark within the GLUE suite.
Conclusion
PARAGEN provides a robust, modular foundation for the development and deployment of parallel generation models. By decoupling training from inference and providing a flexible plugin system, it streamlines the research-to-production pipeline for high-speed sequence generation. Future work will focus on expanding the plugin ecosystem and exploring parallel generation in non-text modalities such as image and speech synthesis.
Summary updated