NLLB binary to English
binary-to-English text translator
2 min read
An experimental model by developer austinezernack that translates space-separated 8-bit binary code into plain English text (ASCII). Built on facebook/nllb-200-distilled-600M (620M parameters), it adds binary code as a new source language under the code qbn_Bits. Unlike standard language models that tend to guess words from context, this fine-tune was trained for strict character-by-character decoding. The author candidly notes that a single line of Python solves this in practice, yet the experiment clearly shows how architectural tweaks during training can force a transformer to act as an exact decoder.
Key features
- Binary code is integrated into the NLLB vocabulary as a separate language,
qbn_Bits, initialized with the mean embedding (vector representation) of the base model's 202 languages. - The breakthrough came from changing targets during the final 2,000 training steps: switching from standard subwords to one token per character boosted accuracy on random word strings from 70.6% to 99.6%.
- On a held-out test set of 1,500 lines, the model achieved 99.07% overall exact match accuracy with a character error rate of 0.03%.
- Training took 14,000 steps and ran entirely on a single consumer RTX 5060 GPU with 8 GB of VRAM.
What you can do
- Explore the author's code and training pipeline to experiment with adding synthetic or formal languages to multilingual Seq2Seq models.
- Test how transformers handle deterministic algorithmic tasks and character-level decoding without linguistic hallucinations.
- Use the weights as a starting base for further fine-tuning on other encoding formats or cryptographic puzzles.
Example
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
repo = "austinezernack/nllb-binary-to-english"
tok = AutoTokenizer.from_pretrained(repo, src_lang="qbn_Bits")
model = AutoModelForSeq2SeqLM.from_pretrained(repo)
bits = "01001000 01101001 00100000 01110100 01101000 01100101 01110010 01100101"
enc = tok([bits], return_tensors="pt")
out = model.generate(**enc, forced_bos_token_id=tok.convert_tokens_to_ids("eng_Latn"), num_beams=1)
print(tok.batch_decode(out, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0])
Read more
DetailsTest metrics (1,500 lines): 97.8% exact match on Wikipedia text, 99.6% on random words, and 99.8% on random ASCII characters.
Training: 14,000 steps, Adafactor optimizer, bf16, frozen embedding matrix (except for the
qbn_Bits row starting at step 4,000).Limitations: printable ASCII characters only (0x20–0x7E) with no UTF-8 or emojis, 8-bit groups strictly separated by a single space, length up to ~100 characters.
License: CC-BY-NC 4.0 (non-commercial use only, inherited from NLLB-200).










Comments