Views
No views yet
sv, da, nb, nn, fi, is ↔ en), distilled from
Bifrost 1.2B via top-32 logit (KL)
distillation. ~⅓ the size of the teacher — the "flash" option when you want Nordic MT
cheap and quick.| Direction group | Flash 430M | Teacher 1.2B |
|---|---|---|
| English → Nordic | 53.1 | 57.4 |
| Nordic → English | 60.9 | 63.6 |
| Nordic ↔ Nordic | 50.7 | 54.5 |
| Overall | 54.5 | 58.1 |
| Dir | score | Dir | score | |
|---|---|---|---|---|
| en→sv | 61.5 | sv→en | 65.2 | |
| en→da | 62.2 | da→en | 66.0 | |
| en→nb | 55.6 | nb→en | 63.9 | |
| en→nn | 55.0 | nn→en | 67.5 | |
| en→fi | 42.7 | fi→en | 49.9 | |
| en→is | 41.8 | is→en | 52.9 |
model.safetensors with a self-contained pure-PyTorch
implementation in modeling_flash.py (no external deps beyond torch). The prompt is
a control-token format — [BOS] [<2{tgt}>] {source_ids} [<eos_src>] → generate until
[EOS]; decode only ids < 65000.1import torch, sentencepiece as spm
2from modeling_flash import NordicFlash
3sp = spm.SentencePieceProcessor(); sp.load("nordic_unigram_65k.model")
4LANG = {"en":65000,"sv":65001,"da":65002,"nb":65003,"nn":65004,"fi":65005,"is":65006}
5m = NordicFlash.from_checkpoint("model.safetensors", device="cuda")
6print(sp.decode(m.translate(sp.encode("Hello, how are you?", out_type=int), LANG["sv"])))
7# -> Hej, hur är du idag?trust_remote_code):1from transformers import AutoModelForCausalLM
2import torch, sentencepiece as spm
3sp = spm.SentencePieceProcessor(); sp.load("nordic_unigram_65k.model")
4m = AutoModelForCausalLM.from_pretrained(".", trust_remote_code=True, dtype=torch.bfloat16).cuda().eval()
5ids = [1, 65001] + sp.encode("Hello, how are you?", out_type=int) + [65007] # 65001=<2sv>
6out = m.generate(torch.tensor([ids]).cuda(), max_new_tokens=128, do_sample=False, eos_token_id=2)
7print(sp.decode([t for t in out[0, len(ids):].tolist() if t < 65000]))<2en>=65000, <2sv>=65001, <2da>=65002, <2nb>=65003,
<2nn>=65004, <2fi>=65005, <2is>=65006, <eos_src>=65007; [BOS]=1, [EOS]=2.
Run in bf16.[dynamic_conv, dynamic_conv, gqa]×6
pattern: data-dependent causal depthwise convolution (local mixing) interleaved with
grouped-query attention every 3rd layer (global mixing).nordic_unigram_65k SentencePiece).nordic_unigram_65k) developed by a collaborator; included here with
permission.1@misc{nodenestor_bifrost_flash_2026,
2 title = {Bifrost Flash 430M},
3 author = {Nilsson, Ludvig},
4 year = {2026},
5 howpublished = {\url{https://huggingface.co/NodeNestor/bifrost-flash-430m}},
6 note = {NodeNestor; distilled from Bifrost 1.2B}
7}