Two-Stage Fine-Tuning for LLM-Based Machine Translation: A Practical Approach
This article describes a two-stage fine-tuning method for LLM-based machine translation. The first stage uses supervised fine-tuning (SFT) on a mix of synthetic and human-translated parallel data. The second stage uses reinforcement learning (RL) with QE and MQM reward models and PPO to align translations with human preferences. The article also covers the engineering and cloud infrastructure needed to train these models.
As large language models (LLMs) advance rapidly, machine translation has undergone a paradigm shift. Compared with traditional statistical machine translation and early neural machine translation, LLM-based translation shows clear advantages in understanding context, handling long texts, and maintaining semantic coherence. However, using an unoptimized base model directly for translation often produces stiff output, unnatural phrasing for the target language, or misreadings of context. To close the gap between translation that is merely possible and translation that is precise and natural, the industry has proposed a two-stage fine-tuning process. It improves the model step by step and substantially raises its translation capability.
1. The Core Idea of Two-Stage Fine-Tuning
The two-stage fine-tuning process separates the optimization of a translation model into two connected stages. The first stage is supervised fine-tuning (SFT), which teaches the base model professional translation knowledge and instruction-following ability. The second stage is reinforcement learning (RL), which uses reward signals to further align the model with human translation preferences. This improves how well translations fit their context and how natural they sound.
This staged approach avoids the optimization conflicts that arise when a single training stage has too many objectives. In the SFT stage, the model learns how to generate a standard translation from an input. In the RL stage, the model learns how to select and favor better expressions among multiple candidate translations.
2. First Stage: Supervised Fine-Tuning (SFT)
SFT is the foundation of the two-stage process. In this stage, the base model updates its parameters on a large set of high-quality parallel corpora, which adapts it to the specific translation task.
2.1 Mixed Data Construction Strategy
High-quality data is key to a successful SFT stage. A single data source rarely covers the full range of translation scenarios. This process combines synthetic data generated by large models with human-translated data:
- Synthetic data generation: A more capable multimodal or general-purpose large model generates large volumes of bilingual parallel corpora for specific domains, such as technology, law, and literature. Synthetic data is inexpensive and quick to obtain, and it can cover long-tail scenarios that are hard for human translators to reach.
- Human translation data: To ensure accuracy and natural phrasing, the training set must include a certain proportion of high-quality human translations. Human data serves as an anchor. It keeps the model from absorbing hallucinations or machine-translation-like phrasing from the synthetic data.
Mixing both sources expands the training set and increases diversity while maintaining quality. This helps the model build more reliable cross-lingual mappings.
2.2 Avoiding Catastrophic Forgetting During Training
When fine-tuning the base model on mixed data, developers need to watch for catastrophic forgetting. After learning the translation task, the model may lose its general language understanding. In practice, teams typically use a low learning rate, freeze some parameters, or apply parameter-efficient fine-tuning methods such as LoRA (Low-Rank Adaptation). These methods give the model translation capability while preserving the general generalization ability of the base model.
3. Second Stage: Reinforcement Learning (RL)
SFT enables the model to produce fluent translations. However, machine translation is fundamentally an open-ended generation task, and a single sentence often has several reasonable translations. SFT relies on one-to-one labeled data, so it struggles to teach the model to pick the most natural, context-appropriate option among several valid ones. This is why the RL stage matters.
3.1 Reward Model Design
In the RL stage, the key is a reward model that accurately reflects translation quality. Traditional literal-matching metrics such as BLEU cannot effectively measure fluency or semantic fidelity. The process therefore uses reference-free quality estimation (QE) and fine-grained automatic quality evaluation (MQM) as reward models:
- QE: Evaluates the source and target language pair directly, without a reference translation, to judge faithfulness and fluency. It suits real-time scoring of translations that the model generates during RL.
- MQM: Simulates the error annotation framework that professional human translators use. It applies fine-grained penalties for grammar errors, terminology errors, omissions, and other issues, then produces a composite quality score.
3.2 Policy Optimization Process
In this stage, the SFT model serves as the initial policy model. For each source sentence, the policy model generates candidate translations, and the reward model scores them. Using reinforcement learning algorithms such as Proximal Policy Optimization (PPO), the model adjusts its parameter distribution based on these scores. Translations with high scores become more likely, and translations with low scores become less likely.
This process moves the model beyond the single-answer constraint of SFT. It learns more flexible word choices and sentence restructuring in context, which produces translations that better match how people actually express ideas.
4. Engineering Practice and Infrastructure
Deploying the two-stage fine-tuning process in a production system requires strong engineering capability and compute infrastructure. The work includes large-scale data cleaning and preprocessing, distributed model training, and multi-stage pipeline scheduling.
On the compute and platform side, developers can build a training platform on general-purpose AI infrastructure such as Baidu AI Cloud. Its GPU compute clusters and container platform support multi-node distributed training. Its object storage and file storage systems help manage terabyte-scale mixed training data. Combined with a monitoring and alerting service, teams can track loss curves and reward curves for both the SFT and RL stages in real time, which helps keep training stable.
Below is a simplified pseudocode example of the two-stage fine-tuning pipeline:
# Stage 1: Supervised Fine-Tuning (SFT)base_model = load_base_model()mixed_dataset = load_data(synthetic_data_ratio=0.6, human_data_ratio=0.4)sft_model = supervised_finetune(model=base_model,dataset=mixed_dataset,learning_rate=2e-5,epochs=3)# Stage 2: Reinforcement Learning (RL)reward_model = load_qe_mqm_model() # Load the QE/MQM quality estimation reward modelpolicy_model = sft_modelreference_model = copy.deepcopy(sft_model) # Frozen reference modelrl_optimized_model = ppo_train(policy_model=policy_model,reference_model=reference_model,reward_model=reward_model,source_texts=val_sources,kl_penalty=0.1 # Controls how far the model can drift from the SFT model)
5. Summary
The two-stage fine-tuning process offers a clear and efficient path for optimizing LLM-based machine translation. The first stage, supervised fine-tuning on mixed synthetic and human data, builds a solid translation foundation. The second stage, reinforcement learning with reward mechanisms such as QE and MQM, adds deeper context understanding and preference alignment. For developers and enterprises, mastering this process and combining it with a capable cloud-native computing platform can help them build translation systems with lower resource consumption. The quality of these systems can rival or even surpass professional human translation.
