Efficient Machine Translation with Model Pruning and Quantization
Paper · 2021 · Maximiliana Behnke, Nikolay Bogoychev, Alham Fikri Aji et al.
Summary
A translation system can produce good sentences and still be too slow to serve an interactive request or too large to distribute conveniently. Edinburgh’s submission to the WMT 2021 efficiency task treats these as distinct problems in machine translation. The task asks systems to translate from English into German and measures how they handle a large collection of sentences as well as requests that arrive individually. The authors test ways to reduce the work of decoding, the step that produces the translation, and ways to reduce the space needed to store the trained system. The experiments show that a technique can help with one of these goals while doing little for another.
The authors first train smaller student networks on translations generated by stronger teachers. The students use Transformer encoders and simpler recurrent decoders. For their CPU systems, the authors also narrow the output vocabulary during decoding, remove groups of weights so that parts of the encoder become smaller, and use 8-bit integers for selected matrix multiplications. The two pruning methods make different choices about what to remove. One preserves nearly all of the attention structure and mainly cuts feedforward computation. The other removes much more from attention and generally gives up more translation quality to gain speed. On WMT21, the paper reports that pruning makes the tested systems 1.2–1.7× faster at a cost of 0.6–1.3 BLEU. With quantization as well, the reported gains are 1.9–2.7×, with losses of 0.9–1.7 BLEU against the original unpruned, unquantized students.
The GPU experiments show how much the result depends on the decoding software and hardware. The authors implement integer decoding with GPU tensor cores, but their optimized half-precision floating-point implementation runs faster throughout the tested batch-size sweep. They also try a separate form of compression that represents weights with 4-bit codes on disk. In the 4-bit experiment, the 12-1.base student goes from 195MB to 25MB and from 28.3 to 27.7 BLEU on the WMT21 test set. The decoder expands the weights back to full floating-point precision for inference, so this experiment demonstrates a storage saving.
The paper’s results trace several ways to trade translation quality for efficiency. Structured pruning and integer arithmetic help the tested CPU systems decode faster. Fine-tuning after quantization can recover some of the quality lost along the way, with the amount of recovery depending on the student and the metric. The smallest stored systems come from a different path, using 4-bit weights in students whose structure has been retained. The GPU sweep adds a practical constraint to all of these findings. An arithmetic format has to save enough work in the complete decoder to pay for any conversions it introduces.
Deep dive: Efficient Machine Translation with Model Pruning and Quantization
Edinburgh’s WMT study tests how pruning and quantization affect translation quality, CPU and GPU speed, and the size of stored systems. · about 31 minutes to read
The problem and its context
Why the task separates latency from throughput
A translation service may receive a large body of text at once, or it may receive a sentence whose translation has to be returned before another arrives. Both services do the same linguistic job. They offer different opportunities for sharing work across requests. When many sentences are available together, a decoder can process them in batches and keep more of the hardware occupied. When there is a single sentence waiting, the time spent on that sentence determines when the next request can begin. The authors frame their submission around the quality and speed tradeoffs in these settings.
The efficiency task gives each setting 1 million lines of raw English, with a maximum of 150 space-separated words per line. For throughput, the system gets the input directly. For latency, it receives a sentence, returns its translation, and then receives the next sentence. The CPU tracks use multiple cores for throughput and a single core for latency. There are GPU tracks for both conditions. These rules matter when reading the experiments. A decoder that processes a large batch rapidly can make excellent use of a throughput assignment while leaving open how quickly it would return an individual result.
The task also looks beyond time. The organizers measure translation quality with BLEU, along with the size of the trained system, the size of its Docker image, and memory consumption. These measurements answer different questions. The trained parameter file is part of what has to be distributed. The container carries the software environment as well. Memory use concerns what must be resident while the application runs. The authors’ compression experiments make the distinction concrete because the format used to store the weights can differ from the format used to multiply them.
Where the computation goes
The students are built around a Transformer encoder. The encoder reads the source sentence and produces representations that the decoder uses when generating the target sentence. In the encoder, attention lets positions in the sentence draw on information from other positions. An attention layer divides part of this work among separate heads, each with its own projections. Feedforward layers apply learned transformations to the representations at individual positions. Both parts involve matrix operations, so the width of a projection or feedforward layer affects the work it takes to translate.
Generation creates a further cost on the decoder side. At an output step, the system has to assign scores to candidate target tokens. If it computes scores across the full vocabulary, the output projection is a large matrix multiplication. The authors point to this operation when explaining their CPU submission. A reduced set of candidate words can shorten the calculation if the implementation takes advantage of the smaller output. A GPU implementation may respond differently to the same change because its matrix operations and their surrounding overhead behave differently.
These are distinct places to intervene. A smaller student reduces the starting amount of computation. Pruning can change the dimensions of a trained student. A shortlist changes how much of the output projection is used when decoding a sentence. Quantization changes the numerical representation of weights or intermediate values. The paper brings these choices together because the shared task measures the behavior of a complete system. Each change still has to be understood at the point where it acts.
The techniques that preceded the submission
The authors build on Edinburgh’s previous efficiency submission. The earlier work already supplied a starting point for integer decoding, and the current paper follows its general approach to 8-bit quantization. The authors also draw on prior work using teacher-generated translations to train smaller students. That strategy is known as sequence-level knowledge distillation. The teachers supply entire translations, giving the students complete example outputs to learn from. Earlier work discussed in the paper examines fully synthetic data, which gives the authors a reason to compare several ways of assembling a distillation corpus.
The choice of a simpler recurrent decoder and the use of a vocabulary shortlist also come from earlier machine translation research. The shortlist draws on word alignments between the source and target languages. Those alignments give the decoder a way to prioritize plausible target tokens using the sentence it is translating. Frequent target tokens add a general set of choices even when the alignment evidence for a particular source word offers a narrower selection.
For pruning, the paper describes earlier findings that a trained Transformer can lose some attention heads and still translate, and that encouraging sparsity during training may be less damaging than removing components after training. The authors also cite their earlier group-lasso work, which compared pruning with training the resulting architecture directly. This study extends the pruning experiments across attention and feedforward blocks in the encoder and puts the resulting students through an efficiency comparison.
The distinction between groups of weights and individual weights is central to that comparison. Setting a weight to zero changes what the network computes. If the decoder still calls a dense matrix multiplication with the same dimensions, that zero can occupy the same place in the calculation as any other number. Removing a whole row, column, or head can allow the implementation to call a smaller operation. The practical problem is therefore to find trained components that can be removed together and still leave a useful translation system. Storage compression raises a related question about numerical representation, which the earlier work on logarithmic quantization addresses by storing weights with a compact set of codes.
The method, step by step
From teacher translations to smaller students
The authors’ starting point is Edinburgh’s system for the WMT 2021 news task. They train large Transformers for English-to-German and German-to-English translation. The directions are both useful for constructing training examples because the team has text that can be translated forward into German or backward into English. The teacher training procedure uses corpus filtering, back-translation, and fine-tuning. The paper names SentencePiece as the tool used for the shared 32K vocabulary. Sharing the vocabulary means that the systems use the same inventory of tokens, the units in which the input and output are represented.
Sequence-level distillation turns the teachers’ predictions into sentence pairs for training. A forward translation supplies a German output for an English input. A backward translation supplies an English input for a German sentence. The paper also uses backward-forward data. In that route, a backward translation supplies the source sentence and the forward teacher translates it again, leaving both sides synthetic. What distinguishes these sources is the origin of the sentence on each side of the pair. From the student’s perspective, each route supplies an input with a corresponding output to imitate.
Producing a sentence pair is followed by filtering. The authors first apply handcrafted cleaning rules to the synthesized data. They then use KenLM to score the generated side by cross-entropy per word. Cross-entropy here reflects how readily a language predictor accounts for the words in a sentence. Expressing it per word lets the filtering step assess a sentence without taking its total length as the score. The paper says the authors remove the bottom 5% under this filtering criterion. The loss used for that filter concerns the generated text. It gives the authors a way to screen synthetic sentences before the student learns from them.
The team considers several training sets. The broadest includes parallel data and all the synthetic data derived from monolingual text, including the backward-forward version. A narrower version keeps the monolingual variants with a single translation direction and leaves out the fully synthetic pairs. The most restricted variant uses parallel data only. The baseline architecture comparison uses students trained with the full collection. That distinction matters because the training procedure describes choices for which the paper presents different amounts of numerical evidence.
The students use the teachers’ vocabulary. For validation, the authors take the sentences in the English–German WMT test sets from 2015–2019 whose originals were in English. They use BLEU on that validation material to decide when training has stopped improving. A run ends after 20 consecutive validations without an improvement. Apart from the stated departures, the paper uses Marian’s default Transformer-base training settings. Marian is also the translation framework the authors modify for decoding.
From teacher translations to efficient student decoding
The steps in order.
This flow brings together the branches studied in the paper. For the CPU speed experiments, the authors can prune a student and then quantize it. For the storage experiments, they apply logarithmic quantization to students that retain their original structure. The GPU speed sweep tests execution formats through its own decoding implementation. These paths share the general goal of efficient translation, but the ordering of operations is specific to the result being tested.
Building the student and narrowing the vocabulary
Each student has a Transformer encoder and a decoder based on a Simpler Simple Recurrent Unit, or SSRU. A recurrent decoder carries a state from one output step to the next, so it can use information from the part of the translation already generated. The SSRU is the simpler recurrent design adopted from the earlier work cited in the paper. Students vary in encoder and decoder depth, embedding width, and the dimensions of their attention and feedforward layers. An embedding is the vector representation used for a token. A feedforward dimension determines the width of the intermediate representation inside that part of an encoder block.
The named configurations make those changes concrete. The 12-1.large, 12-1.base, 12-1.tiny, and 12-1.micro students have 12 encoder layers and 1 decoder layer. The tiny and micro variants both use an embedding dimension of 256 and an attention dimension of 256. Their feedforward dimensions differ. The tiny variant uses 1536, while the micro variant uses 1024. This makes them useful starting points for pruning comparisons because the smaller feedforward layer in micro is already a deliberate architectural choice. The paper also evaluates tied configurations and a group using the usual attention projection shape. Tying means sharing weights across parts of the architecture that would otherwise have separate parameters.
Some students keep the total attention projection width fixed even as the embedding width changes. The paper writes the modified matrix shape as follows.
(dₑₘᵦ, nₕₑₐ𝒹 × dₕₑₐ𝒹)
The pair gives the matrix’s row and column dimensions in the paper’s notation. The symbol dₑₘᵦ is the embedding dimension. The symbol nₕₑₐ𝒹 is the number of attention heads, and dₕₑₐ𝒹 is the dimension assigned to each head. The multiplication sign combines the head count and per-head width to give the full width of the attention projection. Each student has 8 heads per layer, and the modified-attention students use a per-head dimension of 32.
The ordinary projection shape used for comparison is the following.
(dₑₘᵦ, dₑₘᵦ)
Here dₑₘᵦ is again the embedding dimension. Both entries in the pair are the same, so the width of this projection follows the embedding width. With the modified shape, the head count and the per-head width determine the second dimension. This gives the authors another way to vary the cost of an attention layer when comparing students.
The lexical shortlist acts later, as the decoder selects target tokens. The alignment-based part takes the top 50 most probable matches. A second part takes the top 50 most frequent items in the target vocabulary. The decoder uses the union of these sets, so a frequent token that is also proposed by the alignment component appears as a single candidate. The shortlist is used to reduce the cost of the output projection in the CPU systems. The GPU experiments omit it after the authors find that it brings no performance gain in their implementation.
Making the matrices smaller through pruning
A pruned parameter is one that is removed from the computation. The authors want that removal to change the shapes of operations, so they encourage whole groups to become dispensable. They use group lasso, which adds a penalty to training based on groups of weights. The groups define the granularity of the decision. Penalizing the whole submatrix for an attention head encourages that entire head to become a candidate for removal. Penalizing rows and columns can shrink the matrices along finer boundaries.
The two settings are called head-lasso and rowcol-lasso. Both act on attention and feedforward layers in the encoder. In the head-lasso attention setting, the group penalty acts directly on the submatrix for a head. The row-and-column setting acts on connections organized as matrix rows and columns. It also removes a head when at least half of its connections are dead, meaning that the pruning procedure has made them inactive. A useful way to read the distinction is to track the removal decision. The first setting asks about the head as a unit. The second starts with its connections and can ultimately remove the head as a consequence.
The authors use the same regularization setting for both methods.
λ = 0.5
The symbol λ controls the strength of the pruning regularization. The paper fixes it at 0.5 for both grouping schemes. This holds the reported setting constant when comparing their behavior. Each grouping scheme still penalizes different collections of weights.
The procedure starts with 50k updates of pretraining. The students then undergo 150k updates with regularization. An update is a step that changes the learned parameters during training. After the regularization stage, the authors slice the matrices, physically removing the selected groups. Training then continues until convergence. The sequence matters. The system has already learned to translate before pruning pressure is applied, and it has a further chance to adapt after the matrices have become smaller.
The paper carries this procedure out on the 12-1.tiny and 12-1.micro students. These trials keep the encoder and decoder families the same while examining two starting feedforward widths. The amount removed is reported separately for attention and feedforward layers. This makes the pruning percentages useful for understanding what a label such as head-lasso actually did in a run. A head-based regularizer can leave most attention in place even while the same overall procedure takes substantial capacity out of the feedforward layers.
Calibrating 8-bit arithmetic
An 8-bit integer representation can hold a limited range of values. The authors use the range [−127, 127] and scale the original values into it. For parameter matrices, they can compute the scaling factor ahead of time using the maximum absolute value. Parameters are already available when the system is prepared for inference. Activations, the intermediate values produced while translating, depend on the sentence and therefore vary between decoding runs.
The previous efficiency submission computed a scale for an activation as it was needed. In this paper, the authors move the choice of scale offline. They decode WMT16-20 material, collect statistics for each activation tensor, and use those statistics to fix its production scale. A tensor here is an array of intermediate numerical values. The scale recorded for an individual observed instance is as follows.
α(Aᵢ) = 127 / max(|Aᵢ|)
The symbol A denotes the activation tensor being calibrated, and Aᵢ is the instance observed at index i during calibration. The vertical bars apply absolute value to the tensor entries, and max selects the largest of those magnitudes. The number 127 is the positive endpoint of the integer interval. The function α gives the scaling factor. The quotient expresses how much to scale that observed instance so that its largest magnitude reaches the endpoint.
The authors combine the scales observed during calibration as follows.
α(A) = μ({α(Aᵢ)}) + 1.1 × σ({α(Aᵢ)})
On the left, α(A) is the scale assigned to tensor A for production. On the right, the braces collect the scales α(Aᵢ) from the calibration instances. The symbol μ denotes the mean across those scales. The symbol σ denotes their standard deviation, which measures how widely the observed values vary. The factor 1.1 multiplies that standard deviation before it is added to the mean. Each chosen scale is stored with the trained system so the decoder can reuse it.
Choosing the scale offline and converting incoming activations during decoding are separate operations. The software description still places activation conversion before a matrix multiplication. The fixed factor removes the need to gather fresh scaling statistics at that point. The activation values themselves arrive with the computation and still have to be converted to integers. This distinction also matters on GPU, where the authors point to activation conversion as a possible reason the integer implementation falls behind half precision.
The paper focuses integer arithmetic on general matrix multiplication, abbreviated GEMM. It keeps the attention computation in fp32, the paper’s name for full floating-point precision in this comparison. The authors explain that both inputs to the relevant attention multiplication would need runtime conversion. That differs from operations where one input is a learned weight matrix that can be prepared offline. The selective use of integer arithmetic therefore follows the cost of preparing the operands as well as the cost of multiplying them.
Compressing the stored weights with logarithmic codes
The 4-bit route expresses weights using 16 quantization centers. A quantization center is a value that a stored code can stand for. Several originally distinct weights can be assigned to the same center, which is how a short code can represent a set of more precise values. The paper describes the centers with a logarithmic form.
S × 2ᵏ
The symbol S is the scaling factor. The number 2 is the base, and k is the exponent used to specify a center. Changing k changes the power of 2, and multiplying by S places the centers on the scale of the weights in the system. The paper gives the form of the centers and the size of the codebook, with the scale chosen to minimize mean squared error between quantized weights and their original values. Mean squared error averages squared discrepancies, so larger discrepancies contribute more strongly to the objective.
The authors apply this quantization to layers other than the bias terms. A bias is an offset added to the result of a multiplication. The intended benefit of the compact representation is a smaller file. The hardware in the experiment lacks native execution for this 4-bit scheme, so the decoder restores the weights to fp32 for inference. The 4-bit number describes the representation on disk, and fp32 describes how the system carries out the translation after restoration.
For these storage-focused tests, the authors choose students that have not been pruned. They say those students gave a better balance between stored size and translation quality than the pruned candidates. The paper’s structure thus pairs the speed-oriented integer experiment with pruned students and the storage-oriented logarithmic experiment with intact students. Both paths quantize, but each gives up precision for a different practical objective.
Adapting the students after quantization
Quantization substitutes a restricted set of values for the weights the system learned in its original precision. The authors observe that this substitution can reduce translation quality, especially for smaller networks. They fine-tune after applying quantization, training with the quantized weights so that the student can adapt to the representation in which it will be used. In the 4-bit experiment, this still matters even though decoding uses fp32. Expanding a code into floating point preserves the value represented by the code, so the decoder still works with the weights that the quantization procedure selected.
The authors report that reducing the learning rate to 0.0001 gives better quality. The learning rate controls how large a training adjustment can be. For 4-bit quantization, they also find it helpful to double the warm-up duration, the initial part of training during which the learning rate is raised toward its intended level. The table for 4-bit storage includes fine-tuning in every quantized row. The table for 8-bit execution instead shows results before and after that additional training, which makes it possible to see its effects separately.
Turning the changes into CPU and GPU implementations
Most of the CPU integer matrix multiplications use intgemm, including the shortened output projection. The parameter matrices are converted offline. The CPU decoder converts activations as needed, using the offline scale for the activations described in the quantization method. On the intgemm path, it combines conversion of the result with nearby operations so that the intermediate can be processed as it is produced.
dequantize(σ(A × B + bias))
Here A and B are the matrix operands in the GEMM. The multiplication sign represents the matrix product. The term bias is the offset added to that product, and the plus sign represents its addition. The symbol σ here denotes the activation function, which transforms the result before it is passed onward. In the calibration formula, σ denotes standard deviation. The outer operation, dequantize, converts the result back to fp32. On this software path, the paper specifies ReLU as the supported activation. Applying the operations as a stream saves an intermediate round trip to memory.
Pruning makes some matrices irregular in shape, and the authors report that Intel’s DNNL performs better than intgemm for those shapes. DNNL lacks the combined streaming path for dequantization, bias addition, and activation in the authors’ implementation. This is a concrete example of how pruning changes a software decision. The smaller matrix calls can be advantageous while also taking the decoder onto a different library path. The eventual runtime includes both effects.
For the CPU_ALL throughput track, the authors vary how processes and threads are assigned and settle on 4 processes with 9 threads per process. They split the input into 4 pieces and translate them in parallel. A mini-batch is a group of sentences processed together. They choose a mini-batch size of 32 after finding that mini-batch size makes little difference in this configuration. Each process is assigned to its own set of sequential cores and to the corresponding socket’s memory domain using numactl. The outputs are then put back together. The authors leave the available hardware threads unused and say that their existing threads already saturate the computation. For the latency submissions, the relevant batch sizes are set to one.
On GPU, the authors start from the Marian development branch and test their own optimizations. They use CUTLASS to explore tensor cores, specialized hardware for the matrix calculations at issue. Tensor cores are enabled for the fp16 experiments, where fp16 is the half-precision floating-point format used by the decoder. The authors also implement 8-bit integer decoding along lines similar to the CPU path. The two GPU formats must therefore be judged as complete decoder implementations. The time to convert data and the time to carry out the multiplication both contribute to what the benchmark measures.
Experiments and results
Evaluation sets, metrics, and baselines
The shared task uses an Intel Ice Lake system for CPU evaluation and a single A100 for GPU evaluation. Its scoring includes translation quality, speed, size on disk, container size, and memory use. The paper’s detailed tables address specific parts of this evaluation. The student architectures and quantization tests give translation scores on WMT20 and WMT21. The pruning table specifies a single CPU core with a mini-batch of 32 for its timing. The GPU implementation sweep uses an RTX 3090 and material from the previous WNGT competition. Each setup answers a different performance question.
BLEU is an automatic quality score based on comparing the system’s output with reference translations. Higher values indicate stronger agreement under that metric. The student tables also give COMET as a second automatic quality score. The paper reports both for the architecture, pruning, and storage comparisons. These columns can move differently, so the reported metric is part of any conclusion about a quality gain or loss. The complete runtime in seconds is a separate measurement, for which a lower value is better.
The teachers have their own news-task results. With multiple references and scoring by the organizers, the teachers obtain 29.90 BLEU on the English-to-German WMT 2021 test and 51.78 BLEU on the German-to-English test. The architecture table gives the English-to-German teacher ensemble as a baseline for the students, with 38.3 BLEU on WMT20 and 28.8 on WMT21. The paper identifies the multiple-reference organizer scores and the table scores separately. The English-to-German teacher row in the architecture table is the corresponding baseline for interpreting the student rows there.
Starting points before pruning and quantization
The unpruned student comparison shows how much performance varies with architecture even before changing numerical precision. On WMT21, 12-1.large scores 28.7 BLEU and 47.7 COMET, with a decoding time of 92.2 seconds. The 12-1.base student scores 28.2 BLEU and 44.1 COMET on the same test set and takes 38.9 seconds. Their parameter counts are 130.5M and 51.1M respectively. These are different operating points from the start, even though both belong to the family with the same layer counts and modified attention shape.
The smaller 12-1.tiny and 12-1.micro students both score 27.6 BLEU on WMT21. They differ in WMT21 COMET, at 41.9 for tiny and 40.2 for micro, and in baseline decoding time, at 19.2 and 17.1 seconds respectively. Their WMT20 BLEU scores are also separated, at 36.1 for tiny and 35.4 for micro. The smaller feedforward starting point gives micro a shorter runtime on WMT21 in this comparison. The equality in WMT21 BLEU describes one test and one metric.
Depth and weight sharing give the authors other operating points. The 8-4.tied.tiny student scores 27.8 BLEU and 43.9 COMET on WMT21 and takes 30.4 seconds. The 6-2.tied.tiny student produces 27.4 BLEU and 42.1 COMET there and takes 18.6 seconds. In the ordinary-attention group, 6-2.base gives 28.7 WMT21 BLEU at 56.2 seconds, while 6-2.tiny gives 27.4 WMT21 BLEU at 19.2 seconds. These configurations differ along several architectural dimensions. The table establishes the quality and runtime of complete starting systems for the later comparisons.
CPU speed after pruning and 8-bit quantization
The pruning table takes the unpruned, unquantized 12-1.tiny and 12-1.micro students as baselines. For each student it then reports a head-based and a row-and-column sequence of changes. The timings come from single-core decoding at a mini-batch size of 32, and the pruning discussion describes the comparison on WMT21. The chart follows the 12-1.tiny row-and-column sequence. The last stage includes adaptation after quantization, so the minimum runtime and the final quality-oriented checkpoint can be read separately.
Single-core decoding time for 12-1.tiny settings on WMT21
Row-and-column pruning reduces decoding time, with a further gain from integer quantization.
The numbers
| System or setting | seconds |
|---|---|
| Unpruned and unquantized student | 19.2 |
| Row-and-column pruning | 11.6 |
| Row-and-column pruning with 8-bit quantization (this paper) | 6.9 |
| Row-and-column pruning with 8-bit quantization and fine-tuning | 7.1 |
For this student, the corresponding WMT21 BLEU sequence is 27.6 for the baseline, 26.3 after row-and-column pruning, 25.6 with quantization added, and 26.0 after fine-tuning. The WMT21 COMET sequence is 41.9, 34.2, 28.7, and 31.3 at those stages. The experiment makes the cost of the speed gain visible. Pruning alone changes the quality scores, and quantization produces another drop. Fine-tuning recovers part of both WMT21 scores while leaving the student in the same general runtime range as its quantized predecessor.
Head-based pruning offers another point on the curve. For 12-1.tiny, the head-based pruned student takes 14.5 seconds and scores 27.0 BLEU on WMT21. Its 8-bit version takes 9.3 seconds and scores 26.2. After fine-tuning, the time stays at 9.3 seconds and BLEU reaches 26.7. A reader selecting between these settings would be comparing configurations with different amounts of retained computation as well as different observed translation quality.
Across the pruned students on WMT21, the authors summarize the runtime gain as 1.2–1.7× at a cost of 0.6–1.3 BLEU. They report a 1.9–2.7× speed gain with 8-bit quantization added, accompanied by a loss of 0.9–1.7 BLEU compared with the unpruned, unquantized baselines. These ranges describe the tradeoff the authors report for this family of students. The table gives the individual stages, including the scores directly after conversion and those after further training.
Disk size after 4-bit compression
The storage experiment has its own unquantized baselines and compares each against a version with 4-bit weights and fine-tuning. The baseline quality scores here come from the storage table. For 12-1.tiny, for instance, the WMT21 BLEU entry in that table is 28.0. The architecture table’s entry under the same student name belongs to its comparison and is 27.6. Reading the paired values within the storage table keeps the compression contrast on the terms the authors report.
Parameter file size for 12-1.base in the WMT20 and WMT21 compression evaluation
Logarithmic quantization makes the stored student substantially smaller.
The numbers
| System or setting | MB |
|---|---|
| Unquantized 12-1.base | 195 |
| 4-bit 12-1.base with fine-tuning (this paper) | 25 |
The 12-1.base student’s BLEU scores go from 37.1 to 36.3 on WMT20 and from 28.3 to 27.7 on WMT21. WMT21 COMET goes from 45.1 to 43.2. The 12-1.tiny student moves from 85MB to 11MB, with WMT21 BLEU changing from 28.0 to 27.6 and WMT21 COMET from 42.5 to 38.3. The tied student in this test, 8-4.tied.tiny, goes from 69MB to 9MB, while its WMT21 BLEU moves from 27.5 to 26.4 and its WMT21 COMET from 43.6 to 38.2.
This experiment demonstrates a substantial reduction in the stored weight files. The authors describe the compression as making the stored system 8x smaller. The individual file sizes show the scale of that result for different students. The baseline and quantized variants use fp32 for inference in this experiment after the compressed weights have been expanded. The paired size and quality values thus characterize storage compression with a quality cost.
GPU throughput and execution format
For its GPU sweep, the paper uses the group’s previous submission system and 1 million sentences from the earlier WNGT competition. It compares the Marian development master branch with the authors’ branch, using fp32 and fp16 for both and adding the authors’ 8-bit integer tensor-core implementation. The batch sizes run from 32 to 1132. The chart shows the time for the full input on the RTX 3090 at the largest tested mini-batch size. It is a comparison of throughput implementations within the sweep.
RTX 3090 decoding time on the previous WNGT input at mini-batch size 1132
The authors’ half-precision decoder is fastest in this comparison.
The numbers
| System or setting | seconds |
|---|---|
| Marian master fp32 | 277 |
| Marian master fp16 | 216 |
| Authors’ branch fp32 | 135 |
| Authors’ branch fp16 (this paper) | 116 |
| Authors’ branch 8-bit integer | 119 |
At a mini-batch size of 32, the authors’ branch takes 740 seconds in fp32, 731 in fp16, and 732 in 8-bit integers. At a mini-batch size of 512, the corresponding times are 147, 127, and 133 seconds. The overall change with batch size is substantial. In this sweep, the full input finishes sooner when many sentences can be processed together. The authors’ fp16 implementation remains ahead of their integer implementation throughout the table.
The GPU table reports BLEU of 33.47 for master fp32 and 33.43 for master fp16. On the authors’ branch the entries are 33.48 for fp32, 33.42 for fp16, and 33.26 for 8-bit integers. These values accompany the sweep on the previous WNGT material. They give the quality context for comparing implementations in addition to time. The reported GPU outcome is therefore a preference for the optimized fp16 path on this test, where it provides the lowest elapsed time in the sweep.
What the ablations show
The grouping rule changes where capacity is removed
The clearest controlled comparison is between the two pruning rules applied to the same starting architectures. With 12-1.tiny, head-based pruning removes 3% of attention and 75% of feedforward parameters in the pruning table’s respective sparsity columns. The row-and-column rule gives 68% attention sparsity and 73% feedforward sparsity. The amount of feedforward pruning is similar, while the amount of attention pruned differs sharply. The row-and-column configuration is faster and scores lower on both WMT21 quality metrics. This comparison suggests a role for the additional attention reduction in the observed tradeoff, within a procedure that also changes the actual groups of weights removed.
For 12-1.micro, head-based pruning again gives 3% sparsity in attention, with 72% in the feedforward layers. Row-and-column pruning gives 60% attention sparsity and 59% feedforward sparsity. Here the row-and-column setting removes proportionally more attention and less feedforward capacity than the head-based setting. It still produces the shorter runtime, 12.0 seconds against 14.1 seconds. Its WMT21 BLEU is 26.4 compared with 26.7 for head-based pruning, and the WMT21 COMET entries are 35.1 and 35.4.
The distribution of the removed weights is as important to interpreting these rows as the label of the regularizer. In both students, a procedure that groups attention by whole heads leaves nearly all of that part of the encoder intact under the reported setting. It gains speed while doing most of its removal in the feedforward layers. In the row-and-column runs, the smaller attention computation accompanies a further runtime gain and lower quality scores. These are observations about the training and slicing procedures together. The comparisons do not isolate the cost or function of an individual head.
Quantization and adaptation can be read as successive changes
In the 12-1.micro head-based sequence, moving from the pruned student to its integer version changes WMT21 BLEU from 26.7 to 26.0 and WMT21 COMET from 35.4 to 31.2. Runtime moves from 14.1 to 9.2 seconds. The fine-tuning stage then brings WMT21 BLEU to 26.5 and COMET to 33.3, while the runtime stays at 9.2 seconds. This is a case where the additional training recovers part of the quality at the same reported speed. It illustrates the distinction between changing the numerical representation and adapting the weights to it.
The 12-1.tiny head-based sequence has a different response. Fine-tuning after integer conversion raises WMT21 BLEU from 26.2 to 26.7, while WMT21 COMET moves from 33.6 to 33.0. On WMT20, it raises BLEU from 33.9 to 34.1 and COMET from 38.8 to 39.8. The fine-tuning intervention can therefore look beneficial under one quality measurement and less beneficial under another, even with the same student. Reporting just the restored BLEU would miss that behavior.
The 12-1.tiny row-and-column sequence gives a further example of split dependence. After conversion, fine-tuning lifts WMT21 BLEU from 25.6 to 26.0, whereas WMT20 BLEU is 32.9 at both stages. WMT20 COMET goes from 33.7 to 35.7 and WMT21 COMET from 28.7 to 31.3. The quality changes are a property of the adapted systems and their evaluation. The capacity removed by pruning remains the same in the reported sparsity columns.
The authors also observe that a smaller student tends to suffer more when quantized. The table gives examples consistent with this, including the head-based variants on WMT20. Before integer conversion, the tiny variant scores 34.7 BLEU and the micro variant 34.6. After conversion, they score 33.9 and 33.4 respectively. That comparison supports the author’s concern about small starting systems while leaving room for the differences across pruning rules, splits, and metrics visible elsewhere in the table.
GPU results depend on the branch as well as the precision
The GPU sweep holds the decoding workload fixed while varying the batch size and implementation. The comparison between master fp32 and the authors’ fp32 branch shows that the branch itself matters. At a mini-batch of 128 the two take 475 and 261 seconds, respectively. Within the authors’ branch at the same batch size, fp16 takes 246 seconds and integer decoding takes 261 seconds. The speed of the optimized decoder therefore has a software baseline as well as a numerical baseline.
The precision comparison within the authors’ branch is the relevant one for their tensor-core question. At a mini-batch of 256, their fp16 path takes 160 seconds and the integer path takes 169 seconds. At 1024 the times are 117 and 120 seconds. The results favor half precision over integer decoding at both of those settings and throughout the sweep. The authors suggest that the cost of converting activations before the integer operations explains the outcome. The table measures the total time for the workload, so it supports the ranking of the implementations directly. It leaves the proposed explanation as a plausible account of where the time goes.
Some experimental choices have less direct evidence
The paper describes training-data variants but gives no matched score series that changes only the corpus composition. Its baseline architecture table uses the complete synthetic collection. The description establishes what data the team considered and which training choice was used for those baselines. Estimating the contribution of backward-forward examples independently would require a comparison with the narrower training sets under the same architectural and evaluation conditions.
The storage table similarly combines logarithmic quantization with fine-tuning in its compressed entries. The paired rows quantify what happens when that recipe is applied. They give the storage size and the resulting translation scores. The table cannot isolate how much score was lost at the moment of conversion, how much was regained during fine-tuning, or how much the warm-up change contributed. The CPU table provides the stronger stage-by-stage evidence for adaptation after quantization.
Limitations
Limits the authors identify
The authors say the scale of the task kept them from searching the pruning hyper-parameters on a grid. They use λ = 0.5 for both regularizers and compare their behavior with that choice. The settings are consequently evidence about how the methods operate under the reported procedure. Different strengths of regularization could change where and how much each method prunes. The paper leaves the best attainable balance for either grouping rule open.
The latency systems receive limited tuning specific to that task. The authors say that setting the batch size to one was their latency-specific adjustment. Their experiments thus explore more of the room for improving throughput than they do the design of a decoder optimized for individual requests. The detailed CPU timings at mini-batch size 32 describe batched work on a single core. In the latency task, the decoder would have to return the current sentence before it could receive the next one.
The authors also identify limits of the hardware and software paths they used. The 4-bit representation is a storage format in their experiments because the hardware does not provide native operations for that route. The weights are expanded to fp32 to translate. In CPU decoding, the DNNL path used for irregular matrices lacks the same streaming combination available on their intgemm path. On GPU, the authors could find no tested configuration in which their tensor-core integer decoder surpassed their optimized fp16 decoder. They attribute that result tentatively to the extra work of converting activations. The experiment establishes an outcome for their implementation and sweep.
Limits visible in the comparisons
The translation direction investigated by the efficiency task is English to German under the WMT news constraints. German-to-English teacher scores enter the story because backward generation is part of the training procedure. The detailed student results concern the English-to-German direction and the listed test material. The paper gives no basis for estimating the same quality and runtime changes in another direction, domain, or vocabulary setting.
Some architecture comparisons change depth, width, attention shape, or weight sharing together. They show the measured behavior of the complete students. They are limited as evidence about the independent effect of any one architectural choice. The pruning comparisons narrow the starting point by using the same tiny or micro student for the two rules, but the resulting sparsity patterns differ in several respects. Timing also depends on which software kernels handle the resulting matrix shapes. A percentage of parameters pruned is therefore an incomplete description of the change that produces the reported time.
The detailed GPU sweep is on the RTX 3090 with previous competition material, whereas the WMT shared-task GPU evaluation uses an A100. The paper also gives shared-task criteria such as container size and memory use without detailed results for each entry on all those measures. Its tables support conclusions about the workloads and metrics they name. They give a less complete view of the resource profile of each submitted configuration, including what happens to working memory after compressed weights are expanded.
Quality is measured here with automatic scores. This is sufficient to show the changes in BLEU and COMET that accompany faster decoding or smaller files. The paper gives no detailed breakdown of the translation errors that cause those changes, and the table shows that the metrics can move in different directions after fine-tuning. A small aggregate change leaves open which kinds of sentences or linguistic distinctions are most affected. The reported scores are also point estimates, so the paper does not quantify how much they might vary across repeated training runs.
Finally, the scoring contexts deserve to remain attached to the numbers. The teacher scores from the organizers use multiple references. The baseline architecture and storage tables give different values for some identically named students, and the paper does not give a detailed account of those differences. The paired comparisons within each table are the direct evidence. In particular, the 4-bit experiment answers how much smaller its selected starting systems became and how their own scores changed under the compression recipe.
What came after
The later papers that cite this study span distillation, the design of a translation system, and evaluation of smaller systems under quantization. Their titles establish those subjects and the language pairs where named. A citation establishes that the earlier paper appears in the later work’s discussion or references. It supplies limited evidence about the specific parts of the submission that the later authors adopted or tested.
LaMini-LM moves the setting for distillation from teacher-generated translation pairs to large-scale instruction data. Its title describes a collection of distilled systems. The connection is the use of distillation to produce a new system for a different setting. Edinburgh’s students learn from complete teacher-generated translations, while the later paper identifies instructions as the basis of its distillation work. The citation alone leaves the role of Edinburgh’s training or compression procedure unspecified. LaMini-LM: A Diverse Herd of Distilled Models from Large-Scale Instructions
Charles Translator describes a translation system for Ukrainian and Czech. It places the citation in a system-building context involving a different language pair from the English-to-German efficiency task. The earlier paper offers examples of how to vary a decoder and measure a tradeoff, but the citation gives no detail about whether Charles Translator uses the same pruning groups, student design, or execution formats. Charles Translator: A Machine Translation System between Ukrainian and Czech
The English-to-Portuguese study names system scale and quantization as explicit dimensions of its translation evaluation. This is the most direct overlap with the comparison in Edinburgh’s paper between different student sizes and different numerical representations. The later evaluation concerns a different language pair and frames the question around small language systems. Its title and citation establish the continuity of the question, with the particular formats, experimental outcomes, and use of Edinburgh’s methods left unspecified. Evaluating Small Language Models for English-to-Portuguese Translation: Impact of Model Scale and Quantization
Cite
Cite as Maximiliana Behnke, Nikolay Bogoychev, Alham Fikri Aji, Kenneth Heafield, Graeme Nail, Qianqian Zhu, Svetlana Tchistiakova, Jelmer van der Linde, Pinzhen Chen, Sidharth Kashyap and Roman Grundkiewicz. 2021. Efficient Machine Translation with Model Pruning and Quantization. Proceedings of the Sixth Conference on Machine Translation.
@inproceedings{behnke2021efficient,
title = {{Efficient Machine Translation with Model Pruning and Quantization}},
author = {Maximiliana Behnke, Nikolay Bogoychev, Alham Fikri Aji, Kenneth Heafield, Graeme Nail, Qianqian Zhu, Svetlana Tchistiakova, Jelmer {van der Linde}, Pinzhen Chen, Sidharth Kashyap and Roman Grundkiewicz},
booktitle = {Proceedings of the Sixth Conference on Machine Translation},
year = {2021},
url = {https://aclanthology.org/2021.wmt-1.74/}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/behnke-2021-efficient-machine-translation-model-pruning/