BERT Diagrams Public
BERT Diagrams Public
(NAACL 2019)
T[CLS] T1 T2 T3 T4 T5 T6 T7 T[SEP]
… … … … … … … … …
E[CLS] E1 E2 E3 E4 E5 E6 E7 E[SEP]
Token
[CLS] At11 At22 At33 t4
[SEP] Bt51 Bt62 t7 [SEP]
Embeddings
Segment
+ + + + + + + + +
EA EA EA EA EA EA EA EA EA
Embeddings
Position
+ + + + + + + + +
P0 P1 P2 P3 P4 P5 P6 P7 P8
Embeddings
By Jimmy Lin ([email protected]), released under Creative Commons Attribution 4.0 International (CC BY 4.0): https://creativecommons.org/licenses/by/4.0/
Illustration of BERT, showing composition of input embeddings. Redrawn from Devlin et al. (NAACL 2019)
T[CLS] T1 T2 T3 T4 T5 T6 T7 T[SEP]
E[CLS] E1 E2 E3 E4 E5 E6 E7 E[SEP]
Token
[CLS] At11 At22 At33 t4
[SEP] Bt51 Bt62 t7 [SEP]
Embeddings
Segment
+ + + + + + + + +
EA EA EA EA EA EA EA EA EA
Embeddings
Position
+ + + + + + + + +
P0 P1 P2 P3 P4 P5 P6 P7 P8
Embeddings
By Jimmy Lin ([email protected]), released under Creative Commons Attribution 4.0 International (CC BY 4.0): https://creativecommons.org/licenses/by/4.0/
Illustration of BERT for single-sentence classification tasks. Redrawn from Devlin et al. (NAACL 2019)
Class Label
… … … … … … … … …
Sentence
By Jimmy Lin ([email protected]), released under Creative Commons Attribution 4.0 International (CC BY 4.0): https://creativecommons.org/licenses/by/4.0/
Illustration of BERT for single-sentence classification tasks. Redrawn from Devlin et al. (NAACL 2019)
Class Label
Sentence
By Jimmy Lin ([email protected]), released under Creative Commons Attribution 4.0 International (CC BY 4.0): https://creativecommons.org/licenses/by/4.0/
Illustration of BERT for single-sentence sequence labeling tasks. Redrawn from Devlin et al. (NAACL 2019)
O O B-PER O O O
… … … … … … … … …
Sentence
By Jimmy Lin ([email protected]), released under Creative Commons Attribution 4.0 International (CC BY 4.0): https://creativecommons.org/licenses/by/4.0/
Illustration of BERT for single-sentence sequence labeling tasks. Redrawn from Devlin et al. (NAACL 2019)
O O B-PER O O O
Sentence
By Jimmy Lin ([email protected]), released under Creative Commons Attribution 4.0 International (CC BY 4.0): https://creativecommons.org/licenses/by/4.0/
Illustration of BERT for two-sentence classification tasks. Redrawn from Devlin et al. (NAACL 2019)
Class Label
… … … … … … … … …
Sentence 1 Sentence 2
By Jimmy Lin ([email protected]), released under Creative Commons Attribution 4.0 International (CC BY 4.0): https://creativecommons.org/licenses/by/4.0/
Illustration of BERT for two-sentence classification tasks. Redrawn from Devlin et al. (NAACL 2019)
Class Label
Sentence 1 Sentence 2
By Jimmy Lin ([email protected]), released under Creative Commons Attribution 4.0 International (CC BY 4.0): https://creativecommons.org/licenses/by/4.0/
Illustration of BERT for two-sentence sequence labeling tasks. Redrawn from Devlin et al. (NAACL 2019)
Start/End Span
… … … … … … … … …
Question Candidate
By Jimmy Lin ([email protected]), released under Creative Commons Attribution 4.0 International (CC BY 4.0): https://creativecommons.org/licenses/by/4.0/
Illustration of BERT for two-sentence sequence labeling tasks. Redrawn from Devlin et al. (NAACL 2019)
Start/End Span
Question Candidate
By Jimmy Lin ([email protected]), released under Creative Commons Attribution 4.0 International (CC BY 4.0): https://creativecommons.org/licenses/by/4.0/