ArabicTransformer small model (B6-6-6 with decoder)

# Paper : 

[ArabicTransformer: Efficient Large Arabic Language Model with Funnel Transformer and ELECTRA Objective](https://aclanthology.org/2021.findings-emnlp.108/)

# Abstract

Pre-training Transformer-based models such as BERT and ELECTRA on a collection of Arabic corpora, demonstrated by both AraBERT and AraELECTRA, shows an impressive result on downstream tasks. However, pre-training Transformer-based language models is computationally expensive, especially for large-scale models. Recently, Funnel Transformer has addressed the sequential redundancy inside Transformer architecture by compressing the sequence of hidden states, leading to a significant reduction in the pretraining cost. This paper empirically studies the performance and efficiency of building an Arabic language model with Funnel Transformer and ELECTRA objective. We find that our model achieves state-of-the-art results on several Arabic downstream tasks despite using less computational resources compared to other BERT-based models.

# Description 

This model was pre-trained on 44GB of Arabic corpora using [Funnel Transformer with ELECTRA objective](https://arxiv.org/abs/2006.03236). This model has more parameters (1.39x) than ELECTRA-base architecture while having similar or slightly larger inference and fine-tuning time. The model was pre-trained with significantly less resources than state-of-the-art models. 

# Results on Arabic TyDi QA

|     Model        | EM | F1 |
|------------------|----|----|
| AraBERT02-Large       | 73.72 | 86.03 |
| AraELECTRA-Base       | 74.91 | 86.68 |
| ArabicTransformer-Small  | 74.70 | 85.89 |
| ArabicTransformer-Base | 75.57   | 87.22   |
 

# Google Colab Examples

- Text Classification with ArabicTransformer with PyTorchXLA on TPU or with PyTorch on GPU (Better reproducibility but slower). [![Open In Colab][COLAB]](https://colab.research.google.com/github/salrowili/ArabicTransformer/blob/main/Examples/Text_Classification_with_ArabicTransformer_with_PyTorchXLA_on_TPU_or_with_PyTorch_on_GPU.ipynb) 

- Text Classification with ArabicTransformer and TPU and Keras API (Faster but reproducibility is not better than PyTorchXLA). 
[![Open In Colab][COLAB]](https://colab.research.google.com/github/salrowili/ArabicTransformer/blob/main/Examples/Text_Classification_with_ArabicTransformer_and_TPU_and_Keras_API.ipynb) 

- Question Answering with ArabicTransformer. 
[![Open In Colab][COLAB]](https://colab.research.google.com/github/salrowili/ArabicTransformer/blob/main/Examples/FineTuning_ArabicTransformers_on_TyDi_QA_and_Quran_QA_Dataset.ipynb)

[COLAB]: https://colab.research.google.com/assets/colab-badge.svg
# GitHub Page

https://github.com/salrowili/ArabicTransformer

# Acknowledgment

We would like to acknowledge the support we have from The TPU Research Cloud (TRC) team to grant us access to TPUv3 units.


```bibtex
@inproceedings{alrowili-shanker-2021-arabictransformer-efficient,
    title = "{A}rabic{T}ransformer: Efficient Large {A}rabic Language Model with Funnel Transformer and {ELECTRA} Objective",
    author = "Alrowili, Sultan  and
      Shanker, Vijay",
    booktitle = "Findings of the Association for Computational Linguistics: EMNLP 2021",
    month = nov,
    year = "2021",
    address = "Punta Cana, Dominican Republic",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2021.findings-emnlp.108",
    pages = "1255--1261",
    abstract = "Pre-training Transformer-based models such as BERT and ELECTRA on a collection of Arabic corpora, demonstrated by both AraBERT and AraELECTRA, shows an impressive result on downstream tasks. However, pre-training Transformer-based language models is computationally expensive, especially for large-scale models. Recently, Funnel Transformer has addressed the sequential redundancy inside Transformer architecture by compressing the sequence of hidden states, leading to a significant reduction in the pre-training cost. This paper empirically studies the performance and efficiency of building an Arabic language model with Funnel Transformer and ELECTRA objective. We find that our model achieves state-of-the-art results on several Arabic downstream tasks despite using less computational resources compared to other BERT-based models.",
}
```
{}
transformers pytorch funnel feature-extraction arxiv:2006.03236 endpoints_compatible region:us
TAGS
#transformers #pytorch #funnel #feature-extraction #arxiv-2006.03236 #endpoints_compatible #region-us 

ArabicTransformer small model (B6-6-6 with decoder)


Paper :
=======


ArabicTransformer: Efficient Large Arabic Language Model with Funnel Transformer and ELECTRA Objective


Abstract
========


Pre-training Transformer-based models such as BERT and ELECTRA on a collection of Arabic corpora, demonstrated by both AraBERT and AraELECTRA, shows an impressive result on downstream tasks. However, pre-training Transformer-based language models is computationally expensive, especially for large-scale models. Recently, Funnel Transformer has addressed the sequential redundancy inside Transformer architecture by compressing the sequence of hidden states, leading to a significant reduction in the pretraining cost. This paper empirically studies the performance and efficiency of building an Arabic language model with Funnel Transformer and ELECTRA objective. We find that our model achieves state-of-the-art results on several Arabic downstream tasks despite using less computational resources compared to other BERT-based models.


Description
===========


This model was pre-trained on 44GB of Arabic corpora using Funnel Transformer with ELECTRA objective. This model has more parameters (1.39x) than ELECTRA-base architecture while having similar or slightly larger inference and fine-tuning time. The model was pre-trained with significantly less resources than state-of-the-art models.


Results on Arabic TyDi QA
=========================


Model: AraBERT02-Large, EM: 73.72, F1: 86.03
Model: AraELECTRA-Base, EM: 74.91, F1: 86.68
Model: ArabicTransformer-Small, EM: 74.70, F1: 85.89
Model: ArabicTransformer-Base, EM: 75.57, F1: 87.22


Google Colab Examples
=====================


* Text Classification with ArabicTransformer with PyTorchXLA on TPU or with PyTorch on GPU (Better reproducibility but slower). [![Open In Colab](URL)](URL
* Text Classification with ArabicTransformer and TPU and Keras API (Faster but reproducibility is not better than PyTorchXLA).
[![Open In Colab](URL)](URL
* Question Answering with ArabicTransformer.
[![Open In Colab](URL)](URL


GitHub Page
===========


URL


Acknowledgment
==============


We would like to acknowledge the support we have from The TPU Research Cloud (TRC) team to grant us access to TPUv3 units.



TAGS
#transformers #pytorch #funnel #feature-extraction #arxiv-2006.03236 #endpoints_compatible #region-us 

passage: TAGS
#transformers #pytorch #funnel #feature-extraction #arxiv-2006.03236 #endpoints_compatible #region-us 
