Training and Deploying MPT: Lessons Learned in Large Scale LLM Development

mosaicml · Tech · 2023 · source Agentic: no · promotional bias: low · source-backed · extracted with prompt 0.5.6 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Open-source LLM training operations

MosaicML wanted to train commercially usable open-source MPT models while proving that large language model training could be planned, budgeted, evaluated, and operated more economically than many practitioners assumed.

Constraints:

Architecture

MosaicML trained MPT decoder-only transformer models from scratch using its own optimized architecture and training platform. The lifecycle covered problem definition, scaling-law compute budgeting, evaluation planning, data preparation, distributed training, fault tolerance, fine-tuning, and variants such as chat, code, and long-context models.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  planning_and_evaluation_process["Planning and evaluation process"] --> compute_budgeting_process["Compute budgeting process"]
  planning_and_evaluation_process --> training_data_pipeline["Training data pipeline"]
  compute_budgeting_process --> distributed_training_platform["Distributed training platform"]
  training_data_pipeline --> distributed_training_platform
  distributed_training_platform --> fault_tolerance_operations["Fault tolerance operations"]
  distributed_training_platform --> mpt_model_family["MPT model family"]
  mpt_model_family --> evaluation_suite["Evaluation suite"]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Planning and evaluation process Defines whether an LLM is necessary and which metrics matter. Compute budgeting process, Training data pipeline
Compute budgeting process Uses scaling laws to estimate feasible training budgets. Planning and evaluation process, Distributed training platform
Training data pipeline Prepares data for pretraining and fine-tuning. Distributed training platform
Distributed training platform Runs MPT model training and tests MosaicML's infrastructure. Training data pipeline, MPT model family, Fault tolerance operations
Fault tolerance operations Manage failures during expensive large-scale runs. Distributed training platform
MPT model family Provides pretrained and specialized variants including 7B, 30B, chat, and long-context models. Distributed training platform, Evaluation suite
Evaluation suite Measures benchmarks and qualitative behavior. MPT model family

Data flow

The team defines the model goal and evaluation criteria, budgets compute with scaling laws, prepares pretraining data, runs distributed pretraining from randomized weights, fine-tunes variants for tasks like chat or code, and uses benchmarks plus informal vibe checks to assess behavior.

3 supporting quotes
“Key insights cover the full LLMOps lifecycle including planning and evaluation criteria, compute budgeting using scaling laws, data preparation best practices”summary, stated
“For MPT, MosaicML chose to start from scratch with their own optimized architecture, using randomized weights.”summary, stated
“They pre-trained and fine-tuned the model but did not apply RLHF.”summary, stated

Why this architecture

MosaicML trained MPT both to provide permissive open models and to battle-test the training platform, so the architecture emphasizes end-to-end LLMOps discipline rather than a single model artifact.

“MosaicML's motivation for training MPT was threefold: to provide the community with high-quality open-source models with commercially permissive licenses”summary, stated
“and to battle-test their training platform.”summary, stated

Models used: MPT-7B · MPT-30B · MPT chat-tuned variant · MPT long-context variants

Scale

Alternatives considered (roads not taken)

Use existing APIs or open-source models

Rejected because: Organizations may need custom models for privacy, quality, cost, or latency reasons.

“The presentation opens by framing why organizations would want to train their own LLMs rather than using existing APIs or open-source models.”summary, stated

Apply RLHF to MPT

Rejected because: MosaicML pre-trained and fine-tuned MPT but did not apply RLHF.

“They pre-trained and fine-tuned the model but did not apply RLHF.”summary, stated

Train before defining evaluation criteria

Rejected because: The presentation stresses evaluation planning before committing expensive compute.

“The presentation emphasizes that rigorous planning is essential before committing millions of dollars to training runs.”summary, stated

Patterns

eval-driven-development (training planning)

MosaicML emphasized defining evaluations before expensive LLM training runs.

“Establishing evaluation criteria: Using the example of building a coding assistant, relevant evaluations would include HumanEval”summary, stated

fine-tuning-adaptation (model variants)

MPT used pretraining and fine-tuning to produce general and specialized model variants.

“Pre-training from scratch: Self-supervised learning on large token counts to build general capabilities and knowledge”summary, stated
“• Instruction fine-tuning: Supervised training to teach specific behaviors and response patterns”summary, stated

durable-execution (training operations)

The case highlights distributed training infrastructure and fault tolerance as core lifecycle concerns.

“distributed training infrastructure, fault tolerance at scale, and organizational processes for managing expensive training runs.”summary, stated

Tradeoffs

Train MPT from scratch.

Chose Own optimized architecture and randomized weights over Continued pretraining from another base model.

Rationale: This tested MosaicML's platform and produced commercially permissive open-source models.

“For MPT, MosaicML chose to start from scratch with their own optimized architecture, using randomized weights.”summary, stated

Use both formal evals and vibe checks.

Chose Benchmarks plus conversational qualitative tests over Formal metrics alone.

Rationale: Model quality includes capabilities that are not captured by one benchmark.

“Vibe checks: Beyond formal metrics, MosaicML uses conversational testing with fun prompts like "If you were an AI model, what would you name yourself?" and the "banana bread test" where they actually cook recipes generated by the model and evaluate the results.”summary, stated

Gotchas (what bit them)

Training an LLM may not be necessary.

Root cause: Smaller models or alternative approaches can solve some problems with less complexity.

Resolution: Define the problem clearly and question the need for an LLM before training.

“Defining the problem clearly: The presenter stresses questioning whether an LLM is even necessary. If a smaller model or alternative approach can solve the problem, that's preferable given the complexity of LLM training.”summary, stated

Fine-tuning data licensing can limit commercial usability.

Root cause: The chat-tuned variant used Alpaca data generated by ChatGPT.

Resolution: Track dataset licensing separately from model technical quality.

“a chat-tuned version using the Alpaca dataset (though this version is not commercially licensable due to the ChatGPT-generated training data).”summary, stated

Evaluation

MosaicML planned evaluations up front, used benchmarks such as HumanEval for coding use cases, and supplemented with qualitative vibe checks.

Metrics: MPT-7B pretraining cost approximately 250,000. · Practitioner expectations were 500K-$1M+. · Model variants included MPT-7B, MPT-30B, 8K, and 64K context models.

“Establishing evaluation criteria: Using the example of building a coding assistant, relevant evaluations would include HumanEval (a code generation benchmark), in-context learning evaluations, and custom evaluations for specific capabilities.”summary, stated
“MosaicML uses conversational testing with fun prompts like "If you were an AI model, what would you name yourself?"”summary, stated

Outcomes

The case reports MPT-7B pretraining around 250,000 and variants including MPT-30B and 64K context models.

“MosaicML (now part of Databricks) shares practical lessons learned from training their open-source MPT (MosaicML Pretrained Transformer) models at scale.”summary, stated