Binarized Neural Machine Translation

Yichi Zhang, Ankush Garg, Yuan Cao, Łukasz Lew, Behrooz Ghorbani +2 more
2/9/2023
cs.CLcs.LG

No official code found. Best implementation: google/aqt (363 stars, Apache-2.0, last commit 2026-04-13).

Abstract

The rapid scaling of language models is motivating research using low-bitwidth quantization. In this work, we propose a novel binarization technique for Transformers applied to machine translation (BMT), the first of its kind. We identify and address the problem of inflated dot-product variance when using one-bit weights and activations. Specifically, BMT leverages additional LayerNorms and residual connections to improve binarization quality. Experiments on the WMT dataset show that a one-bit weight-only Transformer can achieve the same quality as a float one, while being 16x smaller in size. One-bit activations incur varying degrees of quality drop, but mitigated by the proposed architectural changes. We further conduct a scaling law study using production-scale translation datasets, which shows that one-bit weight Transformers scale and generalize well in both in-domain and out-of-domain settings. Implementation in JAX/Flax will be open sourced.

View on arXivView PDF

Code Implementations(1)

google/aqtCommunity100%
Apache-2.0
36333TeX, ShellDec 11, 20216 months agoApache-2.0

Similar Papers

Cite this paper

@article{zhang2023binarized,
  title  = {Binarized Neural Machine Translation},
  author = {Yichi Zhang and Ankush Garg and Yuan Cao and Łukasz Lew and Behrooz Ghorbani and Zhiru Zhang and Orhan Firat},
  year   = {2023},
  eprint = {2302.04907},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2302.04907v1},
  journal = {NEURIPS 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2302.04907.svg)](https://codeofpaper.com/paper/2302.04907)

Discussion