How ltgoslo/elc-bert works
ELC-BERT is a BabyLM language-model pretraining repository centered on variants of a transformer whose layers select weighted outputs from earlier layers. The documented workflow processes corpus text, creates or selects a tokenizer, caches tokenized data, then trains a configured model and saves checkpoints. The graph preserves the four model/trainer variants and training support modules. Source excerpts establish model behavior and training operations; unsampled preprocessing and tokenizer details are represented at their documented subsystem level.
Main entry points: train_elc_bert_base.py Base trainer · train_elc_bert_normalized.py Normalized trainer · train_elc_bert_weighted_output.py Weighted trainer · train_elc_bert_zero.py Zero trainer
Components 19
Corpus preparation
- Corpus processors
preprocess - Text normalization
preprocess/normalize.py
Tokenization data
- Tokenizer creation
tokenizers/create_tokenizer.py - Cached dataset
pre_training/cache_dataset.py
Pretraining runtime
- Model configs
configs - Masked dataset
pre_training/dataset.py - Config loader
pre_training/config.py - Base trainer
train_elc_bert_base.py - Normalized trainer
train_elc_bert_normalized.py - Weighted trainer
train_elc_bert_weighted_output.py - Zero trainer
train_elc_bert_zero.py - LAMB optimizer
pre_training/lamb.py - Training utilities
pre_training/utils.py - Saved checkpoint
train_elc_bert_base.py
ELC-BERT models
- Base ELC-BERT
models/model_elc_bert_base.py - Normalized ELC-BERT
models/model_elc_bert_normalized.py - Weighted-output ELC-BERT
models/model_elc_bert_weighted_output.py - Zero ELC-BERT
models/model_elc_bert_zero.py
Other components
- Model author
Connections 33
- Model author → Corpus processors: processes corpora
README.md - Corpus processors → Text normalization: normalizes text
preprocess/aochildes.py - Model author → Tokenizer creation: creates tokenizer
README.md - Model author → Cached dataset: caches dataset
README.md - Tokenizer creation → Cached dataset: provides vocabulary
README.md - Model author → Model configs: selects config
README.md - Model author → Base trainer: starts training
README.md - Model author → Normalized trainer: starts training
README.md - Model author → Weighted trainer: starts training
README.md - Model author → Zero trainer: starts training
README.md - Cached dataset → Masked dataset: loads cached text
README.md - Base trainer → Masked dataset: loads batches
train_elc_bert_base.py - Normalized trainer → Masked dataset: loads batches
train_elc_bert_normalized.py - Weighted trainer → Masked dataset: loads batches
train_elc_bert_weighted_output.py - Zero trainer → Masked dataset: loads batches
train_elc_bert_zero.py - Base trainer → Config loader: reads settings
train_elc_bert_base.py - Normalized trainer → Config loader: reads settings
train_elc_bert_normalized.py - Weighted trainer → Config loader: reads settings
train_elc_bert_weighted_output.py - Zero trainer → Config loader: reads settings
train_elc_bert_zero.py - Model configs → Config loader: configures model
README.md - Base trainer → Base ELC-BERT: runs model
train_elc_bert_base.py - Normalized trainer → Normalized ELC-BERT: runs model
train_elc_bert_normalized.py - Weighted trainer → Weighted-output ELC-BERT: runs model
train_elc_bert_weighted_output.py - Zero trainer → Zero ELC-BERT: runs model
train_elc_bert_zero.py - Base trainer → LAMB optimizer: updates weights
train_elc_bert_base.py - Normalized trainer → LAMB optimizer: updates weights
train_elc_bert_normalized.py - Weighted trainer → LAMB optimizer: updates weights
train_elc_bert_weighted_output.py - Zero trainer → LAMB optimizer: updates weights
train_elc_bert_zero.py - Base trainer → Training utilities: uses utilities
train_elc_bert_base.py - Normalized trainer → Training utilities: uses utilities
train_elc_bert_normalized.py - Weighted trainer → Training utilities: uses utilities
train_elc_bert_weighted_output.py - Zero trainer → Training utilities: uses utilities
train_elc_bert_zero.py - Base trainer → Saved checkpoint: saves state
train_elc_bert_base.py