Safetensors
mpixel
pixel
mae
vit
tokenization-free
ilkerkesen commited on
Commit
41690db
·
verified ·
1 Parent(s): d642620

Upload folder using huggingface_hub

Browse files
Files changed (4) hide show
  1. README.md +53 -0
  2. config.json +33 -0
  3. model.safetensors +3 -0
  4. preprocessor_config.json +5 -0
README.md ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ datasets:
4
+ - HuggingFaceFW/fineweb
5
+ - HuggingFaceFW/fineweb-2
6
+ language:
7
+ - en
8
+ - uk
9
+ - zh
10
+ - hi
11
+ tags:
12
+ - pixel
13
+ - mae
14
+ - vit
15
+ - tokenization-free
16
+ ---
17
+ # MPIXEL
18
+
19
+ MPIXEL, introduced in [Scaling Multilingual Pretraining of Pixel Language Models](https://arxiv.org/abs/2610.29681), is a family of multilingual pixel language models, which operate on visually rendered text. Our main models, `mpixel-base` (86M parameters) and `mpixel-large` (307M parameters), are pretrained on sixteen languages that span ten writing systems. MPIXEL uses adaptive rendering: it renders text as grapheme bigrams by default, Chinese, Japanese and Korean text one character per patch, and Arabic and Hebrew text word by word.
20
+
21
+ This model is `mpixel-4s`. It follows the [pixel-m4](https://aclanthology.org/2025.emnlp-main.1504/) setup and is pretrained on the same four languages (English, Hindi, Chinese and Ukrainian), but its text rendering, rotary positional embeddings, data source and per-language data amount are matched to mpixel-base to remove confounding factors.
22
+
23
+ ## Basic usage
24
+ To use our models, please first install our [`mpixel` package](https://github.com/ilkerkesen/mpixel). Here is an example of loading a pretrained model and encoding input text:
25
+
26
+ ```python
27
+ from transformers import AutoModel
28
+ import mpixel.models.auto_register # registers MPIXEL with the Auto classes
29
+ from mpixel.processing import MPIXELProcessor
30
+ processor = MPIXELProcessor.from_pretrained("Team-PIXEL/mpixel-large")
31
+ model = AutoModel.from_pretrained("Team-PIXEL/mpixel-large")
32
+ inputs = processor(["Hello world!", "The quick brown fox jumps over the lazy dog."])
33
+ outputs = model(**inputs)
34
+ print(outputs.last_hidden_state.shape) # torch.Size([2, 513, 768])
35
+ ```
36
+
37
+ For further information, please take a look at our repository: [https://github.com/ilkerkesen/mpixel](https://github.com/ilkerkesen/mpixel).
38
+
39
+ ## Citation
40
+
41
+ If you find MPIXEL beneficial for your research, please cite it,
42
+
43
+ ```
44
+ @misc{kesen2026scalingmultilingualpretrainingpixel,
45
+ title={Scaling Multilingual Pretraining of Pixel Language Models},
46
+ author={Ilker Kesen and Jenny Kunz and Kasra Malihi and Desmond Elliott},
47
+ year={2026},
48
+ eprint={2610.29681},
49
+ archivePrefix={arXiv},
50
+ primaryClass={cs.CL},
51
+ url={https://arxiv.org/abs/2610.29681},
52
+ }
53
+ ```
config.json ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "MPIXELForPreTraining"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "decoder_hidden_size": 512,
7
+ "decoder_intermediate_size": 2048,
8
+ "decoder_num_attention_heads": 16,
9
+ "decoder_num_hidden_layers": 8,
10
+ "dtype": "float32",
11
+ "head_init": "pytorch",
12
+ "hidden_act": "gelu",
13
+ "hidden_dropout_prob": 0.1,
14
+ "hidden_size": 768,
15
+ "initializer_range": 0.02,
16
+ "intermediate_size": 3072,
17
+ "layer_norm_eps": 1e-12,
18
+ "mask_ratio": 0.25,
19
+ "max_num_patches": 512,
20
+ "model_type": "mpixel",
21
+ "norm_pix_loss": true,
22
+ "num_attention_heads": 12,
23
+ "num_channels": 3,
24
+ "num_hidden_layers": 12,
25
+ "patch_embedding_init": null,
26
+ "patch_size": 16,
27
+ "pooler_add_layer_norm": true,
28
+ "pooling_mode": "mean",
29
+ "qkv_bias": true,
30
+ "reference_compile": false,
31
+ "rope_theta": 160000.0,
32
+ "transformers_version": "4.57.3"
33
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:04483152d80e69994e327774c3a2b910d80c2a37515b8f12be655db02c3a7254
3
+ size 446661824
preprocessor_config.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "patch_size": 16,
3
+ "max_num_patches": 512,
4
+ "font_size": 12
5
+ }