text
0 memberslucid.models.textText model families — Phase 4 of the model zoo.
Houses BERT / GPT / GPT-2 / RoFormer and the shared base config /
activation alias. Positional-encoding primitives (RoPE, sinusoidal PE) live
in lucid.nn — text families just import them from there.
Model Families
BERT
25 memberslucid.models.text.bertDevlin, Jacob, et al. "BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding." Proceedings of NAACL-HLT, 2019, pp. 4171–4186.
BERT — Bidirectional Encoder Representations from Transformers — is a transformer encoder pre-trained on two unsupervised objectives over raw text:
GPT
11 memberslucid.models.text.gptRadford, Alec, et al. "Improving Language Understanding by Generative Pre-Training." OpenAI Technical Report, 2018.
GPT — Generative Pre-Training — is a decoder-only transformer trained on an autoregressive (causal) language-modelling objective. Given a token sequence , the network factorises the joint distribution left-to-right and maximises
GPT-2
17 memberslucid.models.text.gpt2Radford, Alec, et al. "Language Models are Unsupervised Multitask Learners." OpenAI Technical Report, 2019.
GPT-2 retains GPT-1's decoder-only causal-LM objective
RoFormer
13 memberslucid.models.text.roformerSu, Jianlin, et al. "RoFormer: Enhanced Transformer with Rotary Position Embedding." Neurocomputing, vol. 568, 2024, article 127063.
RoFormer replaces BERT's absolute (learned) position embedding with Rotary Position Embedding (RoPE) — a position-encoding scheme that injects relative-position information multiplicatively inside attention rather than additively at the input.
Transformer
11 memberslucid.models.text.transformerVaswani, Ashish, et al. "Attention Is All You Need." Advances in Neural Information Processing Systems, 2017, pp. 5998–6008.
The Transformer replaces the recurrence of RNN-based seq2seq models with scaled dot-product attention, enabling fully parallel sequence processing. For query/key/value matrices , , and , attention is