[Paper Review] s2s-ft: Fine-Tuning Pretrained Transformer Encoders for Sequence-to-Sequence Learning
This paper introduces s2s-ft, a toolkit that fine-tunes pretrained bidirectional Transformers (e.g., BERT, RoBERTa, UniLM) for sequence-to-sequence generation tasks using three novel fine-tuning strategies: causal, masked, and pseudo-masked fine-tuning. By leveraging unified self-attention masks and shared model parameters, s2s-ft achieves state-of-the-art performance on abstractive summarization and question generation across monolingual and multilingual benchmarks, outperforming larger models like T5-11B and PEGASUS.
Pretrained bidirectional Transformers, such as BERT, have achieved significant improvements in a wide variety of language understanding tasks, while it is not straightforward to directly apply them for natural language generation. In this paper, we present a sequence-to-sequence fine-tuning toolkit s2s-ft, which adopts pretrained Transformers for conditional generation tasks. Inspired by UniLM, we implement three sequence-to-sequence fine-tuning algorithms, namely, causal fine-tuning, masked fine-tuning, and pseudo-masked fine-tuning. By leveraging the existing pretrained bidirectional Transformers, experimental results show that s2s-ft achieves strong performance on several benchmarks of abstractive summarization, and question generation. Moreover, we demonstrate that the package s2s-ft supports both monolingual and multilingual NLG tasks. The s2s-ft toolkit is available at https://github.com/microsoft/unilm/tree/master/s2s-ft.
Motivation & Objective
- To address the challenge of adapting pretrained bidirectional Transformers, such as BERT, for sequence-to-sequence generation tasks where their bidirectional attention mechanism is not directly suitable.
- To unify encoding and decoding within a single Transformer architecture to reduce the discrepancy between pre-training and fine-tuning objectives.
- To develop a flexible, open-source toolkit that enables fine-tuning of existing pretrained models for diverse conditional generation tasks, including abstractive summarization and question generation.
- To demonstrate the effectiveness of the approach on both monolingual and multilingual generation tasks using models like XLM-RoBERTa.
- To show that strong performance can be achieved without task-specific pre-training or large-scale model retraining, by leveraging existing pretrained models with minimal architectural changes.
Proposed method
- The s2s-ft toolkit uses a unified Transformer architecture where both source and target sequences are packed into a single input sequence with special tokens [CLS], [SEP], and [SOS] to denote sequence boundaries.
- It applies task-specific self-attention masks to restrict attention: source tokens attend bidirectionally, while target tokens attend only to earlier target tokens and source tokens, enabling autoregressive generation.
- Causal fine-tuning shifts target positions to enable autoregressive prediction via left-to-right attention, similar to causal language modeling.
- Masked fine-tuning randomly masks target tokens during training and predicts them, minimizing the mismatch between pre-training (masked language modeling) and fine-tuning.
- Pseudo-masked fine-tuning inserts a pseudo-mask token for each target token, assigning them the same position embeddings, combining benefits of causal and masked training.
- The toolkit is built on HuggingFace Transformers and supports both monolingual and multilingual models, including RoBERTa and XLM-RoBERTa, for zero-shot or few-shot adaptation.
Experimental results
Research questions
- RQ1Can pretrained bidirectional Transformers like BERT be effectively fine-tuned for sequence-to-sequence generation without architectural redesign?
- RQ2How do different fine-tuning strategies—causal, masked, and pseudo-masked—compare in performance on abstractive summarization and question generation tasks?
- RQ3Can off-the-shelf pretrained models, including multilingual ones like XLM-RoBERTa, achieve strong performance on multilingual generation tasks using s2s-ft?
- RQ4Does the unified modeling approach in s2s-ft reduce the domain gap between pre-training and fine-tuning, leading to better generalization?
- RQ5Can s2s-ft achieve state-of-the-art results without task-specific pre-training or massive model retraining?
Key findings
- s2s-ft with UniLMv2-LARGE achieves 27.12 ROUGE-L on XSum and 54.25 ROUGE-L on CNN/DailyMail, outperforming larger models like T5-11B and PEGASUS.
- s2s-ft with RoBERTa-LARGE achieves 26.82 ROUGE-L on XSum and 53.92 ROUGE-L on CNN/DailyMail, demonstrating strong performance with a base-size model.
- On multilingual abstractive summarization, s2s-ft with XLM-RoBERTa-LARGE achieves 58.09 ROUGE-L on Chinese Gigaword and 55.04 ROUGE-L on French Gigaword, surpassing XLM and XNLG baselines.
- For Chinese question generation, s2s-ft with XLM-RoBERTa-LARGE achieves 28.49 BLEU-4 and 52.94 METEOR, outperforming XLM and XNLG.
- The pseudo-masked fine-tuning method consistently achieves the best performance across all benchmarks, indicating its effectiveness in balancing pre-training and fine-tuning objectives.
- The toolkit enables strong zero-shot and few-shot performance on multilingual tasks, showing that multilingual pretrained models can be effectively repurposed for generation with minimal adaptation.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.