|
--- |
|
tags: |
|
- dna |
|
- human_genome |
|
--- |
|
|
|
# GENA-LM (BigBird-base T2T) |
|
|
|
GENA-LM (BigBird-base T2T) is a transformer masked language model trained on human DNA sequence. GENA-LM (BigBird-base T2T) follows BigBird architecture. |
|
|
|
Differences between GENA-LM (BigBird-base T2T) and DNABERT: |
|
- BPE tokenization instead of k-mers; |
|
- input sequence size is about 24000 nucleotides (4096 BPE tokens) compared to 510 nucleotides of DNABERT; |
|
- pre-training on T2T vs. GRCh38.p13 human genome assembly. |
|
|
|
Source code and data: https://github.com/AIRI-Institute/GENA_LM |
|
|
|
## Examples |
|
|
|
### Load pre-trained model |
|
```python |
|
from transformers import AutoTokenizer, BigBirdForMaskedLM |
|
|
|
tokenizer = AutoTokenizer.from_pretrained('AIRI-Institute/gena-lm-bigbird-base-t2t') |
|
model = BigBirdForMaskedLM.from_pretrained('AIRI-Institute/gena-lm-bigbird-base-t2t') |
|
``` |
|
|
|
|
|
### How to load the model to fine-tune it on classification task |
|
```python |
|
from transformers import AutoTokenizer, BigBirdForSequenceClassification |
|
|
|
tokenizer = AutoTokenizer.from_pretrained('AIRI-Institute/gena-lm-bigbird-base-t2t') |
|
model = BigBirdForSequenceClassification.from_pretrained('AIRI-Institute/gena-lm-bigbird-base-t2t') |
|
``` |
|
|
|
## Model description |
|
GENA-LM (BigBird-base T2T) model is trained in a masked language model (MLM) fashion, following the methods proposed in the BigBird paper by masking 15% of tokens. Model config for `gena-lm-bigbird-base-t2t` is similar to the `google/bigbird-roberta-base`: |
|
|
|
- 4096 Maximum sequence length |
|
- 12 Layers, 12 Attention heads |
|
- 768 Hidden size |
|
- sparse config: |
|
- block size: 64 |
|
- random blocks: 3 |
|
- global blocks: 2 |
|
- sliding window blocks: 3 |
|
- 32k Vocabulary size, tokenizer trained on DNA data. |
|
|
|
We pre-trained `gena-lm-bigbird-base-t2t` using the latest T2T human genome assembly (https://www.ncbi.nlm.nih.gov/assembly/GCA_009914755.3/). The data was augmented by sampling SNPs human mutations. Pre-training was performed for 1,070,000 iterations with batch size 256. |
|
|