Skip to content

A simple implementation of BERT to imrpove our understanding.

License

Notifications You must be signed in to change notification settings

mrbesher/nanobert

Repository files navigation

NanoBERT

A simple implementation of BERT to imrpove our understanding and for fun.

Co-authors: Mounes Zaval, Zeynep Akkoc

Details

We implemented a simple minimalist BERT model with ALiBi. We coded a class that adds an MLM head and trained the model on an Arabic corpus treating each letter as a token.

Training over Epochs

Train and test loss and socre over epochs The graph above illustrates the train / test loss and scores of our NanoBERT model over 50 epochs. The decreasing trend in loss indicates the model's improving ability to predict masked tokens in the Quran corpus.

Usage

To train the model with the provided configurations, use the following command:

train.py \
--model_config_path configs/model_config.json \
--tokenizer_config_path configs/tokenizer_config.json \
--train_config_path configs/train_config.json \
--data_path data/quran.jsonl

This command specifies the paths to the model, tokenizer, and training configurations, as well as the data to be used for training. The model will be trained according to the specified configurations.

About

A simple implementation of BERT to imrpove our understanding.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages