Views
No views yet
[!CAUTION] ! Caution !The results are not directly comparable with baselines (MDLM, Duo, FLM, ...) due to tokenization and preprocessing differences used in the ELF paper.Specifically, ELF uses a custom preprocessed OpenWebText dataset (seeopenwebtext-t5). This is tokenized with the T5 tokenizer, not the GPT-2 tokenizer which is used in the standard setting in the literature. In addition, the paper's preprocessing pipeline includes a custom packing scheme with full details not disclosed in the paper.
This is an unofficial PyTorch reproduction of ELF: Embedded Language Flows. It is not affiliated with or endorsed by the paper authors. The official JAX/TPU implementation is at https://github.com/lillian039/ELF, and the official checkpoints are in HuggingFace atembedded-language-flows.This repository was developed using Claude Code.
| Metric | Paper (TPU v5p-64) | Reproduction (8× B200 DDP, Lightning) |
|---|---|---|
| Gen. PPL ↓ | 24.1 | 25.61 |
| Entropy ↑ | 5.15 | 5.20 |
| Epoch | Step | Gen. PPL | Entropy |
|---|---|---|---|
| 1 | 38 034 | 2.73¹ | 0.70¹ |
| 2 | 76 068 | 37.11 | 5.17 |
| 3 | 114 102 | 28.63 | 5.21 |
| 4 | 152 136 | 25.00 | 5.16 |
| 5 | 190 170 | 25.58 | 5.19 |
| 6 | 228 204 | 26.11 | 5.21 |
reproduction/elf_b-owt/eval1000/metrics.jsonl
and reproduction/elf_b-owt/per_epoch/metrics.jsonl.pytorch_lightning/: model, training
script (train_lightning.py), eval (eval_lightning.py), and
utilities. 8-GPU CUDA DDP via PyTorch Lightning.reproduction/elf_b-owt/: config snapshot, 1000 final
samples, and per-epoch samples. The
checkpoint is hosted separately (see Quickstart).1# 1. Environment (conda)
2conda env create -f environment.yml -n elf-pytorch && conda activate elf-pytorch
3
4# 2. Download the reproduced final EMA checkpoint (1.4 GB)
5pip install huggingface_hub
6huggingface-cli download Ugness/elf-torch last.ckpt \
7 --local-dir reproduction/elf_b-owt/
8
9# 3. Run the 1000-sample evaluation
10cd pytorch_lightning/
11torchrun --nproc_per_node=8 --master_port=29510 eval_lightning.py \
12 --config configs/training_configs/train_owt_ELF-B.yml \
13 --checkpoint_path ../reproduction/elf_b-owt/last.ckpt \
14 --num_samples 1000
15# Expected: Gen. PPL ≈ 25.6, sample entropy ≈ 5.20.checkpoints/.1# Example: pull epoch 4 ckpt.
2huggingface-cli download Ugness/elf-torch \
3 checkpoints/checkpoint_epoch03_step00152136.ckpt \
4 --local-dir reproduction/elf_b-owt/1cd pytorch_lightning/
2torchrun --nproc_per_node=8 --master_port=29501 train_lightning.py \
3 --config configs/training_configs/train_owt_ELF-B.ymlbroadcast_buffers=False. See pytorch_lightning/train_lightning.py.| Aspect | Paper | This reproduction |
|---|---|---|
| Hardware | TPU v5p-64 | 8× B200 DDP |
| Framework | JAX/Flax | PyTorch Lightning |
| Epochs | 5 | 6 (one extra to reach entropy ≈ 5.20) |
| Optimizer / objective | Muon + L2 denoise + CE decode (decoder_prob=0.2) | Unchanged |
| Schedule, noise scale, time schedule, SC, CFG | Unchanged | Unchanged |