blog.dopana

Back

Build Foundation Models From Scratch#

Want to train an LLM from scratch? Marin is a research program, software platform, and community for the R&D of foundation models — covering the entire pipeline from data curation to evaluation.

[!NOTE] “I am not afraid of storms, for I am learning how to sail my ship.” — Louisa May Alcott. Marin is committed to open development — every step from raw data to final model is documented.

What Is Marin?#

ComponentDescription
Data curationCollection, transformation, filtering
TokenizationTokenizer training and optimization
PretrainingFoundation model training
PosttrainingFine-tuning, RLHF
EvaluationBenchmark and assessment

Delphi — Scaling Suite#

Delphi is Marin’s open scaling suite:

  • Scaling recipe — Maps compute budgets to model configurations
  • Checkpoints — Available on Hugging Face
  • Scaling law — Predicts big models from small ones
3e18 → 1e23 FLOPs
text

Example#

from marin.execution.step_runner import StepRunner
from marin.experiment.train import train_lm

nano_tinystories_model = train_lm(
    name="checkpoints/marin-nano-tinystories",
    model=llama_nano,
    datasets={tinystories_tokenized: 1.0},
    batch_size=4,
    seq_len=2048,
    num_train_steps=100,
)

StepRunner().run([lower(nano_tinystories_model)])
python

Conclusion#

Marin is opening up foundation model building for every researcher. With open development and thorough documentation, it’s a framework worth learning.

🔗 Repository: github.com/marin-community/marin