File size: 16,873 Bytes
28571f1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
---
datasets:
- multimolecule/genbank
library_name: multimolecule
license: agpl-3.0
mask_token: <mask>
pipeline_tag: fill-mask
tags:
- Biology
- DNA
- dna
widget:
- example_title: tumor protein p53
  mask_index: 14
  mask_index_1based: 15
  masked_char: A
  output:
  - label: GCC
    score: 0.046856
  - label: TCC
    score: 0.034778
  - label: CACC
    score: 0.034686
  - label: TGCC
    score: 0.034373
  - label: TC
    score: 0.020678
  pipeline_tag: fill-mask
  sequence_type: DNA
  task: fill-mask
  text: ACTCCCCTGCCCTC<mask>ACAAGATGTTTTGCCAACTGGCCAAGACCTGCCCTGTGCAGCTGTGGGTTGATTCCACACCCCCGCCCGGCACCCGCGTCCGCGCCATGGCCATCTACAAGCAGTCACAGCACATGACGGAGGTTGTGAGGCGCTGCCCCCACCATGAGCGCTGCTCAGATAGCGATGG
- example_title: BRCA1 DNA repair associated
  mask_index: 10
  mask_index_1based: 11
  masked_char: A
  output:
  - label: GAAATG
    score: 0.384974
  - label: GAAAAAAA
    score: 0.185107
  - label: GAAAATT
    score: 0.091941
  - label: GCAATT
    score: 0.076877
  - label: GAAAATG
    score: 0.07223
  pipeline_tag: fill-mask
  sequence_type: DNA
  task: fill-mask
  text: TCATTGGAAC<mask>GAAAGAAATGGATTTATCTGCTCTTCGCGTTGAAGAAGTACAAAATGTCATTAATGCTATGCAGAAAATCTTAGAGTGTCCCATCTGG
- example_title: hemoglobin subunit beta
  mask_index: 12
  mask_index_1based: 13
  masked_char: A
  output:
  - label: TGTT
    score: 0.025346
  - label: TGA
    score: 0.02065
  - label: CAA
    score: 0.017773
  - label: CTT
    score: 0.016384
  - label: GTT
    score: 0.015401
  pipeline_tag: fill-mask
  sequence_type: DNA
  task: fill-mask
  text: CATTTGCTTCTG<mask>CACAACTGTGTTCACTAGCAACCTCAAACAGACACCATGGTGCATCTGACTCCTGAGGAGAAGTCTGCCGTTACTGCCCTGTGGGGCAAGGTGAACGTGGATGAAGTTGGTGGTGAGGCCCTGGGCAGG
- example_title: CF transmembrane conductance regulator
  mask_index: 11
  mask_index_1based: 12
  masked_char: A
  output:
  - label: CTA
    score: 0.023278
  - label: TGA
    score: 0.017978
  - label: GTGA
    score: 0.015395
  - label: GAA
    score: 0.015331
  - label: GAAGA
    score: 0.012243
  pipeline_tag: fill-mask
  sequence_type: DNA
  task: fill-mask
  text: ACTTCACTTCT<mask>ATGGTGATTATGGGAGAACTGGAGCCTTCAGAGGGTAAAATTAAGCACAGTGGAAGAATTTCATTCTGTTCTCAGTTTTCCTGGATTATGCCTGGCACCATTAAAGAAAATATCATCTTTGGTGTTTCCTATGATGAATATAGATACAGAAGCGTCATCAAAGCATGCCAACTAGAAGAG
- example_title: telomerase reverse transcriptase
  mask_index: 19
  mask_index_1based: 20
  masked_char: A
  output:
  - label: GGAGCC
    score: 0.060274
  - label: CGAGG
    score: 0.055727
  - label: GGGAA
    score: 0.054949
  - label: GAGC
    score: 0.044957
  - label: CGGAA
    score: 0.038146
  pipeline_tag: fill-mask
  sequence_type: DNA
  task: fill-mask
  text: CGCGGGGGTGGCCGGGGCC<mask>GGGCTTCCCACGTGCGCAGCAGGACGCAGCGCTGCCTGAAACTCGCGCCGCGAGGAGAGGGCGGGGCCGCGGAAAGGAAGGGGAGGGGCTGGGAGGGCCCGGAGGGGGCTGGGCCGGGGACCCGGGAGGGGTCGGGACGGGGCGGGGTCCGCGCGGAGGAGGCGGAGCTGGAAGGTGAAGGGGCAGGACGGGTGCCCGGGTCCCCAGTCCCTCCGCCACGTGGGAAGCGCGGTCCTGGGCGTCTGTGCCCGCGAATCCACTGGGAGCCCGGCCTGGCCCCGACAGCGCAGCTGCTCCGGGCGGACCCGGGG
- example_title: KRAS proto-oncogene
  mask_index: 10
  mask_index_1based: 11
  masked_char: A
  output:
  - label: TATA
    score: 0.039074
  - label: TATAAA
    score: 0.036387
  - label: TA
    score: 0.029847
  - label: TATAA
    score: 0.028697
  - label: TGA
    score: 0.018409
  pipeline_tag: fill-mask
  sequence_type: DNA
  task: fill-mask
  text: GCCTGCTGAA<mask>ATGACTGAATATAAACTTGTGGTAGTTGGAGCTGGTGGCGTAGGCAAGAGTGCCTTGACGATACAGCTAATTCAGAATCATTTTGTGGACGAATATGATCCAACAATAGAG
- example_title: prion protein (Kanno blood group)
  mask_index: 21
  mask_index_1based: 22
  masked_char: A
  output:
  - label: CGG
    score: 0.092979
  - label: CTCC
    score: 0.049605
  - label: GTCC
    score: 0.034976
  - label: CAGG
    score: 0.027379
  - label: CGCC
    score: 0.025038
  pipeline_tag: fill-mask
  sequence_type: cDNA
  task: fill-mask
  text: ATGGCGAACCTTGGCTGCTGG<mask>TGCTGGTTCTCTTTGTGGCCACATGGAGTGACCTGGGCCTCTGC
- example_title: interleukin 10
  mask_index: 11
  mask_index_1based: 12
  masked_char: A
  output:
  - label: CACA
    score: 0.089619
  - label: TCTT
    score: 0.058608
  - label: TGAA
    score: 0.039673
  - label: CAGA
    score: 0.039484
  - label: TCAA
    score: 0.034905
  pipeline_tag: fill-mask
  sequence_type: cDNA
  task: fill-mask
  text: ATGCACAGCTC<mask>GCACTGCTCTGTTGCCTGGTCCTCCTGACTGGGGTGAGGGCC
- example_title: Zaire ebolavirus
  mask_index: 11
  mask_index_1based: 12
  masked_char: A
  output:
  - label: GCAATT
    score: 0.245573
  - label: GAAATG
    score: 0.23112
  - label: GTCCTT
    score: 0.125824
  - label: GTCCAA
    score: 0.109987
  - label: GAAAATT
    score: 0.070866
  pipeline_tag: fill-mask
  sequence_type: cDNA
  task: fill-mask
  text: AATGTTCAAAC<mask>CTTTGTGAAGCTCTGTTAGCTGATGGTCTTGCTAAAGCATTTCCTAGCAATATGATGGTAGTCACAGAGCGTGAGCAAAAAGAAAGCTTATTGCATCAAGCATCATGGCACCACACAAGTGATGATTTTGGTGAGCATGCCACAGTTAGAGGGAGTAGCTTTGTAACTGATTTAGAGAAATACAATCTTGCATTTAGATATGAGTTTACAGCACCTTTTATAGAATATTGTAACCGTTGCTATGGTGTTAAGAATGTTTTTAATTGGATGCATTATACAATCCCACAGTGTTAT
- example_title: SARS coronavirus
  mask_index: 14
  mask_index_1based: 15
  masked_char: A
  output:
  - label: TCTTTT
    score: 0.029207
  - label: TATC
    score: 0.027219
  - label: CATC
    score: 0.014813
  - label: CCTTTT
    score: 0.012734
  - label: CATTTT
    score: 0.011283
  pipeline_tag: fill-mask
  sequence_type: cDNA
  task: fill-mask
  text: ATGTTTATTTTCTT<mask>TTATTTCTTACTCTCACTAGTGGTAGTGACCTTGACCGGTGCACCACTTTTGATGATGTTCAAGCTCCTAATTACACTCAACATACTTCATCTATGAGGGGGGTTTACTATCCTGATGAAATTTTTAGATCAGACACTCTTTATTTAACTCAGGATTTATTTCTTCCATTTTATTCTAATGTTACAGGGTTTCATACTATTAATCATACGTTTGACAACCCTGTCATACCTTTTAAGGATGGTATTTATTTTGCTGCCACAGAGAAATCAAATGTTGTCCGTGGTTGGGTTTTTGGTTCTACCATGAACAACAAGTCACAGTCGGTGATTATTATTAACAATTCTACTAATGTTGTTATACGAGCATGTAACTTTGAATTGTGTGACAACCCTTTCTTTGCTGTTTCTAAACCCATGGGTACACAGACACATACTATGATATTCGATAATGCATTTAAATGCACTTTCGAGTACATATCT
- example_title: insulin
  mask_index: 12
  mask_index_1based: 13
  masked_char: A
  output:
  - label: CGTCC
    score: 0.573751
  - label: CGAGG
    score: 0.135812
  - label: GCCAGG
    score: 0.060897
  - label: CGTCA
    score: 0.032261
  - label: GCCACA
    score: 0.025581
  pipeline_tag: fill-mask
  sequence_type: cDNA
  task: fill-mask
  text: ATGGCCCTGTGG<mask>TGCGCCTCCTGCCCCTGCTGGCGCTGCTGGCCCTCTGGGGACCTGACCCAGCCGCAGCCTTTGTGAACCAACACCTGTGCGGCTCACACCTGGTGGAAGCTCTCTACCTAGTGTGCGGGGAACGAGGCTTCTTCTACACACCCAAGACCCGCCGGGAGGCAGAGGACCTGCAGGTGGGGCAGGTGGAGCTGGGCGGGGGCCCTGGTGCAGGCAGCCTGCAGCCCTTGGCCCTGGAGGGGTCCCTGCAGAAGCGTGGCATTGTGGAACAATGCTGTACCAGCATCTGCTCCCTCTACCAGCTGGAGAACTACTGCAACTAG
- example_title: cyclin dependent kinase inhibitor 2A
  mask_index: 18
  mask_index_1based: 19
  masked_char: A
  output:
  - label: GCGG
    score: 0.469999
  - label: CGCC
    score: 0.130437
  - label: CGCA
    score: 0.092787
  - label: GCGGCGG
    score: 0.084631
  - label: TCGG
    score: 0.063294
  pipeline_tag: fill-mask
  sequence_type: cDNA
  task: fill-mask
  text: ATGGAGCCGGCGGCGGGG<mask>GCAGCATGGAGCCTTCGGCTGACTGGCTGGCCACGGCCGCGGCCCGGGGTCGGGTAGAGGAGGTGCGGGCGCTGCTGGAGGCGGGGGCGCTGCCCAACGCACCGAATAGTTACGGTCGGAGGCCGATCCAGGTCATGATGATGGGCAGCGCCCGAGTGGCGGAGCTGCTGCTGCTCCACGGCGCGGAGCCCAACTGCGCCGACCCCGCCACTCTCACCCGACCCGTGCACGACGCTGCCCGGGAGGGCTTCCTGGACACGCTGGTGGTGCTGCACCGGGCCGGGGCGCGGCTGGACGTGCGCGATGCCTGGGGCCGTCTGCCCGTGGACCTGGCTGAGGAGCTGGGCCATCGCGATGTCGCACGGTACCTGCGCGCGGCTGCGGGGGGCACCAGAGGCAGTAACCATGCCCGCATAGATGCCGCGGAAGGTCCCTCAGACATCCCCGATTGA
- example_title: human papillomavirus type 16 E6
  mask_index: 10
  mask_index_1based: 11
  masked_char: A
  output:
  - label: GAGA
    score: 0.026885
  - label: CACA
    score: 0.023989
  - label: GAAA
    score: 0.019737
  - label: CAA
    score: 0.018905
  - label: CAAA
    score: 0.015072
  pipeline_tag: fill-mask
  sequence_type: cDNA
  task: fill-mask
  text: ATGCACCAAA<mask>GAGAACTGCAATGTTTCAGGACCCACAGGAGCGACCCAGAAAGTTACCACAGTTATGCACAGAGCTGCAAACAACTATACATGATATAATATTAGAATGTGTGTACTGCAAGCAACAGTTACTGCGACGTGAGGTATATGACTTTGCTTTTCGGGATTTATGCATAGTATATAGAGATGGGAATCCATATGCTGTATGTGATAAATGTTTAAAGTTTTATTCTAAAATTAGTGAGTATAGACATTATTGTTATAGTTTGTATGGAACAACATTAGAACAGCAATACAACAAACCGTTGTGTGATTTGTTAATTAGGTGTATTAACTGTCAAAAGCCACTGTGTCCTGAAGAAAAGCAAAGACATCTGGACAAAAAGCAAAGATTCCATAATATAAGGGGTCGGTGGACCGGTCGATGTATGTCTTGTTGCAGATCATCAAGAACACGTAGAGAAACCCAGCTGTAA
---

# DNABERT-2

Pre-trained model on multi-species genome using a masked language modeling (MLM) objective.

## Disclaimer

This is an UNOFFICIAL implementation of the [DNABERT-2: Efficient Foundation Model and Benchmark for Multi-Species Genomes](https://openreview.net/forum?id=oMLQB4EZE1) by Zhihan Zhou, et al.

The OFFICIAL repository of DNABERT-2 is at [MAGICS-LAB/DNABERT_2](https://github.com/MAGICS-LAB/DNABERT_2).

> [!TIP]
> The MultiMolecule team has confirmed that the provided model and checkpoints are producing the same intermediate representations as the original implementation.

**The team releasing DNABERT-2 did not write this model card for this model so this model card has been written by the MultiMolecule team.**

## Model Details

DNABERT-2 is a [bert](https://huggingface.co/google-bert/bert-base-uncased)-style model pre-trained on a large corpus of multi-species genome sequences in a self-supervised fashion. This means that the model was trained on the raw nucleotides of DNA sequences only, with an automatic process to generate inputs and labels from those texts. Please refer to the [Training Details](#training-details) section for more information on the training process.

### Model Specification

<table>
<thead>
  <tr>
    <th>Num Layers</th>
    <th>Hidden Size</th>
    <th>Num Heads</th>
    <th>Intermediate Size</th>
    <th>Num Parameters (M)</th>
    <th>FLOPs (G)</th>
    <th>MACs (G)</th>
    <th>Max Num Tokens</th>
  </tr>
</thead>
<tbody>
  <tr>
    <td>12</td>
    <td>768</td>
    <td>12</td>
    <td>3072</td>
    <td>117.07</td>
    <td>125.83</td>
    <td>62.92</td>
    <td>512</td>
  </tr>
</tbody>
</table>

### Links

- **Code**: [multimolecule.dnabert2](https://github.com/DLS5-Omics/multimolecule/tree/master/multimolecule/models/dnabert2)
- **Data**: [GenBank](https://www.ncbi.nlm.nih.gov/genbank)
- **Paper**: [DNABERT-2: Efficient Foundation Model and Benchmark for Multi-Species Genomes](https://openreview.net/forum?id=oMLQB4EZE1)
- **Developed by**: Zhihan Zhou, Yanrong Ji, Weijian Li, Pratik Dutta, Ramana V Davuluri, Han Liu
- **Model type**: [BERT](https://huggingface.co/google-bert/bert-base-uncased) - [MosaicBERT](https://huggingface.co/mosaicml/mosaic-bert-base)
- **Original Repository**: [zhihan1996/DNABERT-2-117M](https://huggingface.co/zhihan1996/DNABERT-2-117M)

## Usage

The model file depends on the [`multimolecule`](https://multimolecule.danling.org) library. You can install it using pip:

```bash
pip install multimolecule
```

### Direct Use

#### Masked Language Modeling

You can use this model directly with a pipeline for masked language modeling:

```python
import multimolecule  # you must import multimolecule to register models
from transformers import pipeline

predictor = pipeline("fill-mask", model="multimolecule/dnabert2")
output = predictor("ATCG<mask>TGCA")
```

### Downstream Use

#### Extract Features

Here is how to use this model to get the features of a given sequence in PyTorch:

```python
from multimolecule import DnaBert2Model
from transformers import AutoTokenizer


tokenizer = AutoTokenizer.from_pretrained("multimolecule/dnabert2")
model = DnaBert2Model.from_pretrained("multimolecule/dnabert2")

text = "ATCGATCGATCGATCG"
input = tokenizer(text, return_tensors="pt")

output = model(**input)
```

#### Sequence Classification / Regression

> [!NOTE]
> This model is not fine-tuned for any specific task. You will need to fine-tune the model on a downstream task to use it for sequence classification or regression.

Here is how to use this model as backbone to fine-tune for a sequence-level task in PyTorch:

```python
import torch
from multimolecule import DnaBert2ForSequencePrediction
from transformers import AutoTokenizer


tokenizer = AutoTokenizer.from_pretrained("multimolecule/dnabert2")
model = DnaBert2ForSequencePrediction.from_pretrained("multimolecule/dnabert2")

text = "ATCGATCGATCGATCG"
input = tokenizer(text, return_tensors="pt")
label = torch.tensor([1])

output = model(**input, labels=label)
```

#### Token Classification / Regression

> [!NOTE]
> This model is not fine-tuned for any specific task. You will need to fine-tune the model on a downstream task to use it for token classification or regression.

Here is how to use this model as backbone to fine-tune for a nucleotide-level task in PyTorch:

```python
import torch
from multimolecule import DnaBert2ForTokenPrediction
from transformers import AutoTokenizer


tokenizer = AutoTokenizer.from_pretrained("multimolecule/dnabert2")
model = DnaBert2ForTokenPrediction.from_pretrained("multimolecule/dnabert2")

text = "ATCGATCGATCGATCG"
input = tokenizer(text, return_tensors="pt")
label = torch.randint(2, (len(text), ))

output = model(**input, labels=label)
```

#### Contact Classification / Regression

> [!NOTE]
> This model is not fine-tuned for any specific task. You will need to fine-tune the model on a downstream task to use it for contact classification or regression.

Here is how to use this model as backbone to fine-tune for a contact-level task in PyTorch:

```python
import torch
from multimolecule import DnaBert2ForContactPrediction
from transformers import AutoTokenizer


tokenizer = AutoTokenizer.from_pretrained("multimolecule/dnabert2")
model = DnaBert2ForContactPrediction.from_pretrained("multimolecule/dnabert2")

text = "ATCGATCGATCGATCG"
input = tokenizer(text, return_tensors="pt")
label = torch.randint(2, (len(text), len(text)))

output = model(**input, labels=label)
```

## Training Details

DNABERT-2 used Masked Language Modeling (MLM) as the pre-training objective: taking a sequence, the model randomly masks 15% of the tokens in the input then runs the entire masked sentence through the model and has to predict the masked tokens. This is comparable to the Cloze task in language modeling.

### Training Data

The DNABERT-2 model was pre-trained on multi-species genome sequences from [GenBank](https://www.ncbi.nlm.nih.gov/genbank).
The dataset encompasses genomes from 135 species, spread across 6 categories. In total, the dataset includes 32.49 billion nucleotide bases, nearly 12 times the volume of the human genome dataset.
All sequences with `N` are excluded, retaining only sequences that consist of `A`, `T`, `C`, and `G`.

DNABERT-2 uses Byte Pair Encoding (BPE) tokenization with a vocabulary size of 4096. This replaces the k-mer tokenization used in the original DNABERT, providing improved computational and sample efficiency.

### Training Procedure

#### Preprocessing

DNABERT-2 used masked language modeling (MLM) as the pre-training objective. The masking procedure is similar to the one used in BERT:

- Mask rate: 15%
- Replacement: `<mask>` for 80% of masked tokens
- Replacement: random token for 10% of masked tokens
- Replacement: unchanged token for 10% of masked tokens

#### Pre-training

The model was trained on 8 NVIDIA RTX 2080Ti GPUs.

- Batch size: 4,096
- Steps: 500,000
- Optimizer: AdamW(β1=0.9, β2=0.98, ε=1e-6)
- Learning rate: 5e-4
- Learning rate warm-up: 30,000 steps
- Learning rate scheduler: Linear
- Minimum learning rate: 0
- Weight decay: 1e-5

## Citation

```bibtex
@inproceedings{zhou2024dnabert,
  title={{DNABERT}-2: Efficient Foundation Model and Benchmark For Multi-Species Genomes},
  author={Zhihan Zhou and Yanrong Ji and Weijian Li and Pratik Dutta and Ramana V Davuluri and Han Liu},
  booktitle={The Twelfth International Conference on Learning Representations},
  year={2024},
  url={https://openreview.net/forum?id=oMLQB4EZE1}
}
```

> [!NOTE]
> The artifacts distributed in this repository are part of the MultiMolecule project.
> If MultiMolecule supports your research, please cite the MultiMolecule project as follows:

```bibtex
@software{chen_2024_12638419,
  author    = {Chen, Zhiyuan and Zhu, Sophia Y.},
  title     = {MultiMolecule},
  doi       = {10.5281/zenodo.12638419},
  publisher = {Zenodo},
  url       = {https://doi.org/10.5281/zenodo.12638419},
  year      = 2024,
  month     = may,
  day       = 4
}
```

## Contact

Please use GitHub issues of [MultiMolecule](https://github.com/DLS5-Omics/multimolecule/issues) for any questions or comments on the model card.

Please contact the authors of the [DNABERT-2 paper](https://openreview.net/forum?id=oMLQB4EZE1) for questions or comments on the paper/model.

## License

This model implementation is licensed under the [GNU Affero General Public License](license.md).

For additional terms and clarifications, please refer to our [License FAQ](license-faq.md).

```spdx
SPDX-License-Identifier: AGPL-3.0-or-later
```