[Paper Review] Sockeye 3: Fast Neural Machine Translation with PyTorch
Sockeye 3 is a PyTorch-based neural machine translation toolkit that accelerates training and inference through optimized mixed-precision training, distributed data parallelism, and model quantization. It achieves up to 126% faster inference on GPUs and 292% faster on CPUs compared to other PyTorch implementations, while supporting advanced features like source/target prefixes, lexical shortlists, and formality/verbosity control for production and research use.
Sockeye 3 is the latest version of the Sockeye toolkit for Neural Machine Translation (NMT). Now based on PyTorch, Sockeye 3 provides faster model implementations and more advanced features with a further streamlined codebase. This enables broader experimentation with faster iteration, efficient training of stronger and faster models, and the flexibility to move new ideas quickly from research to production. When running comparable models, Sockeye 3 is up to 126% faster than other PyTorch implementations on GPUs and up to 292% faster on CPUs. Sockeye 3 is open source software released under the Apache 2.0 license.
Motivation & Objective
- To develop a faster, more scalable, and production-ready NMT toolkit based on PyTorch.
- To enable researchers to iterate quickly by streamlining the codebase and optimizing training and inference pipelines.
- To support advanced NMT features such as source and target prefixes, lexical shortlists, and hybrid decoders for fine-grained control.
- To bridge the gap between research innovation and production deployment through efficient, quantized, and distributed training.
- To provide a flexible, open-source framework for experimenting with formality and verbosity control in translation.
Proposed method
- Sockeye 3 uses PyTorch’s JIT compiler to trace and optimize static computation graphs for the encoder, decoder, and beam search, reducing dynamic control flow overhead.
- It implements distributed mixed-precision training using PyTorch’s DDP and AMP, enabling FP16/FP32 mixed precision and full FP16 (O2) mode for speed and memory efficiency.
- Data preparation is parallelized and sharded into binary format, enabling training on arbitrarily large datasets with fixed memory usage.
- Quantization is applied via PyTorch’s dynamic quantization (INT8) for CPU inference and FP16 casting for GPU inference to accelerate inference with minimal accuracy loss.
- Source prefixes are used to condition model outputs on formality or verbosity levels, enabling controllable generation without retraining.
- Greedy search is implemented as a lightweight alternative to beam search, reducing computational overhead while maintaining translation quality.
Experimental results
Research questions
- RQ1How can a PyTorch-based NMT toolkit achieve significantly faster training and inference throughput compared to existing implementations?
- RQ2To what extent can mixed-precision and distributed training improve scalability and efficiency in NMT without sacrificing model quality?
- RQ3Can source prefix conditioning effectively control output formality and verbosity in neural machine translation?
- RQ4How does quantization impact inference speed and memory footprint while preserving translation quality?
- RQ5What performance gains are achievable through optimized inference components like greedy search and model tracing?
Key findings
- Sockeye 3 achieves up to 126% faster inference on GPUs and up to 292% faster on CPUs compared to other PyTorch NMT implementations.
- Mixed-precision training on 8 GPUs yields 7.7× throughput speedup with 96.6% GPU efficiency, demonstrating strong scaling.
- Greedy search improves translation speed by 16% on GPUs and 6% on CPUs compared to beam search with beam size 1.
- INT8 quantization on CPUs increases inference speed from 2.6 to 4.5 sentences per second, with minimal BLEU score degradation.
- Formality-controlled models achieve 97.8% accuracy on formal translations and 45.0 BLEU on WMT test sets, showing high control fidelity.
- Verbosity control with length tokens and N-best re-ranking improves the final system ranking metric by up to 17.4 points (BERTScore × LC) on English-German translation.
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.