Upload README.md with huggingface_hub
Browse files12345678910---tags:- model_hub_mixin- pytorch_model_hub_mixin---This model has been pushed to the Hub using the [PytorchModelHubMixin](https://huggingface.co/docs/huggingface_hub/package_reference/mixins#huggingface_hub.PyTorchModelHubMixin) integration:- Code: [More Information Needed]- Paper: [More Information Needed]- Docs: [More Information Needed]123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106---language:- arlicense: apache-2.0tags:- mamba- state-space-model- arabic- masked-language-modeling- bidirectionaldatasets:- wikimedia/wikipedia- uonlp/CulturaXpipeline_tag: fill-mask---# AraSSM-baseAraSSM is a bidirectional state-space (Mamba) encoder pretrained from scratch for Arabic viamasked language modeling. It is, to our knowledge, the first bidirectional Mamba/SSM encoderpretrained specifically for Arabic, and was trained entirely on four consumer-grade NVIDIA RTX2080Ti GPUs (11GB) rather than an accelerator cluster.## Model descriptionEach AraSSM layer runs a forward and a backward selective-scan (Mamba) mixer over the sameinput and merges the two outputs, giving the model full bidirectional context while keeping$O(L)$ complexity in sequence length $L$, instead of the $O(L^2)$ complexity of self-attention.| | ||---|---|| Layers | 12 || Hidden size ($d_{\text{model}}$) | 512 || State dimension | 16 || Parameters | ~105M || Max sequence length | 512 || Vocabulary size | 64,000 |## TokenizerAraSSM uses the existing **AraBERTv02 tokenizer**([`aubmindlab/bert-base-arabertv02`](https://huggingface.co/aubmindlab/bert-base-arabertv02))rather than a custom-trained one. This tokenizer was not trained as part of this work; it isreused as-is, both to decouple corpus preprocessing from tokenizer choice and to keep resultscomparable to AraBERT-family baselines that use the same vocabulary. All credit for thetokenizer belongs to its original authors.## Training dataAraSSM is pretrained on a cleaned, deduplicated corpus of approximately 80GB of Arabic text(79.6GB train / 0.4GB validation), combining Arabic Wikipedia and the Arabic portion ofCulturaX. Documents are stripped of diacritics and URLs, filtered for length and Arabic-scriptratio, chunked to at most 400 words, and deduplicated at the chunk level with a Bloom filter.## Training procedure- Objective: standard BERT-style masked language modeling (15% masking, 80/10/10 split)- Optimizer: AdamW, lr 3e-4, weight decay 0.01, 10,000 warmup steps, linear decay- Precision: fp16 (Turing GPUs do not support accelerated bf16)- Effective batch size: 256 (batch size 8 x grad accumulation 8 x 4 GPUs)- Compute: 4x RTX 2080Ti, ~960 GPU-hours (~10 days)## How to useAraSSM is a custom architecture (not a native `transformers` model class), so loading itrequires the model code from the project repository:```pythonfrom huggingface_hub import PyTorchModelHubMixinfrom models.mamba import MambaForMaskedLM # from the AraSSM repositoryclass HubMambaForMaskedLM(MambaForMaskedLM, PyTorchModelHubMixin):passmodel = HubMambaForMaskedLM.from_pretrained("aliane29/arassm-base")from transformers import AutoTokenizertokenizer = AutoTokenizer.from_pretrained("aliane29/arassm-base")```## Intended useThis is a pretrained encoder intended to be fine-tuned on downstream Arabic NLU tasks(classification, token classification, extractive question answering), similarly to how aBERT-family encoder is used. It has not been fine-tuned for any specific task in this repository.## Limitations- Pretrained on Modern Standard Arabic and web text (Wikipedia + CulturaX); performance ondialectal Arabic is not evaluated.- Maximum sequence length is 512 tokens.- Trained on a fixed, publicly available compute budget (4 consumer GPUs); larger-scaleTransformer baselines were pretrained on substantially larger accelerator-cluster budgets.## CitationIf you use this model, please cite:```bibtex@misc{arassm2026,title = {AraSSM: A Bidirectional State-Space Encoder for Arabic Masked Language Modeling},author = {Aliane, Ahmed Amine and Aliane, Hassina and Semmar, Nasredine},year = {2026},note = {Preprint}}```
README.md+102-6