Architecture
Tokens are embedded (word and character), a sentence encoder adds context, and every task has its own decoder [Manjavacas et al. 2019; PyTorch Lightning] .
Embedding
A character BiRNN encodes each word: its last hidden state is the word vector and its per-character states are what the lemma decoder attends over. A word embedding can be concatenated. Alternatives for the source encoder: byt5 (frozen ByT5 [Xue et al. 2022]
) and soter (the T5 approach).
Sentence encoder
A bidirectional LSTM/GRU over the sentence turns word vectors into contextual vectors. It is optional.
Lemma decoders
Select with decoder: in the task.
decoder: | Idea |
|---|---|
attentional | character seq2seq with attention [Bahdanau et al. 2015] |
advanced_attentional | adds a copy / pointer-generator distribution, source-conditioned init and scheduled sampling [See et al. 2017; Bengio et al. 2015] |
levenshtein | parallel edit-based decoder [Gu et al. 2019] |
masked | non-autoregressive mask-and-refine decoder with a length head [Ghazvininejad et al. 2019] |
t5 | small Transformer decoder over per-byte encoder states [Raffel et al. 2020] |
Attentional and copy decoder
Masked decoder
Levenshtein decoder
T5 decoder
See T5 decoders.
Token-level heads
POS and morphology use a linear softmax on the word vector (or contextual vector).
Training defaults
bf16 [Micikevicius et al. 2018] , AdamW [Loshchilov & Hutter 2019] or Ranger [Zhang et al. 2019; Liu et al. 2020] , label smoothing 0.1 [Szegedy et al. 2016] , early stopping on dev lemma accuracy.