Magic

Magic

Research update on compute-efficient pretraining and scaling to trillion-parameter models.

Frontier pretraining is said to be a big-lab-only game. We don’t have 100k chips yet, so there’s only one way: algorithmic efficiency. After compounding for … a while …, our pretraining recipe is now >10x more compute-efficient than that of leading open-weight base models.

We match DeepSeek V4 Pro Base using ~50x fewer FLOPs – that’s around half of GPT3’s pretraining compute, or ~$0.5M on GB200. We continued scaling 10x (~$4M) and meaningfully outperformed all publicly available open base models on perplexity evals. By the scaling laws in Figure 1, training a model this capable would cost >$100M under DeepSeek V4 Pro’s recipe (and this is ignoring how much data exists). Of course, we won’t stop scaling there.

We believe pretraining, agentic RL, and long-context are sufficient to build superhuman coding agents and automate AI R&D. We started with long-context. Today’s blog post is about pretraining.

Private Code Repos
Lower bits per byte is better. Training compute is in FLOPs on a logarithmic axis. The curve fits our current recipe; the dashed segment is a projection beyond the largest run.0.1850.2040.2230.2420.26110211022102310241025DeepSeek V4 Flash: 0.206 bpbDeepSeek V4 Pro: 0.202 bpbKimi K2: 0.205 bpbNemotron 3 Ultra: 0.203 bpbV5 e21: 0.246 bpbV5 e22: 0.222 bpbV5 e23: 0.202 bpbV5 e24: 0.194 bpb29xDSv4 Flash48xDSv4 Pro31xKimi K247xNemotron 3 Ultra
Heldout Research Papers
Lower bits per byte is better. Training compute is in FLOPs on a logarithmic axis. The curve fits our current recipe; the dashed segment is a projection beyond the largest run.0.360.410.460.520.5710211022102310241025DeepSeek V4 Flash: 0.415 bpbDeepSeek V4 Pro: 0.404 bpbKimi K2: 0.421 bpbNemotron 3 Ultra: 0.406 bpbV5 e21: 0.527 bpbV5 e22: 0.463 bpbV5 e23: 0.407 bpbV5 e24: 0.383 bpb24xDSv4 Flash45xDSv4 Pro41xKimi K235xNemotron 3 Ultra
Reasoning on heldout math problems
Lower bits per byte is better. Training compute is in FLOPs on a logarithmic axis. The curve fits our current recipe; the dashed segment is a projection beyond the largest run.0.530.640.760.870.9810211022102310241025DeepSeek V4 Flash: 0.710 bpbDeepSeek V4 Pro: 0.678 bpbKimi K2: 0.695 bpbNemotron 3 Ultra: 0.619 bpbV5 e21: 0.890 bpbV5 e22: 0.770 bpbV5 e23: 0.647 bpbV5 e24: 0.587 bpb72xDSv4 Flash127xDSv4 Pro58xKimi K215xNemotron 3 Ultra

6·N·D training FLOPs

Figure 1: Pretraining scaling laws against training compute, comparing to leading available open-weight base models. 

1

We measured bits-per-byte loss (a metric that normalizes out differences in tokenizers) on heldout data and fit a scaling law to project how much compute is needed to reach a given level of capability. Better training compute efficiency means stronger models at all budgets.

We evaluated the latest available open-weight base models2 from DeepSeek, Moonshot (Kimi), and NVIDIA. Base models for Claude, Gemini, GPT-n, and many others aren’t openly available, but Kimi K3 and Meta’s Muse Spark indicate a 2.5x and 3.3x gain over Kimi K2, respectively. We evaluated logprobs for open models in both vLLM and SGLang on both GB200 and GB300 and found issues with some backends in the process. For further confirmation, we partnered with Fireworks to verify baseline logprobs in their in-house inference engine. Since models can learn their training parser’s characteristics, we built our eval sets using a different parser/OCR than the one our pretraining pipeline uses.

Evaluating generalization

To measure generalization, we evaluated loss on heldout data (Figure 1). Our code evals consist of our own codebase and private codebases we acquired from other startups. For reasoning evals, we generated CoT and step-by-step walkthroughs to heldout, private math problems using Kimi K3 and filtered for correct answers. For text and research, we used recent, low-citation research papers. We removed vendored OSS code and any document with a matching 96-character window of normalized text or Jaccard similarity above a sensitive threshold compared to our training data.3

Evaluating knowledge

In addition to generalization, we are interested in testing our model’s knowledge in key domains to identify gaps in our dataset. For example, we can decompose our heldout research text eval set by subject.

Heldout Computer Science Papers
Lower bits per byte is better. Training compute is in FLOPs on a logarithmic axis. The curve fits our current recipe; the dashed segment is a projection beyond the largest run.0.370.430.480.540.5910211022102310241025DeepSeek V4 Flash: 0.450 bpbDeepSeek V4 Pro: 0.437 bpbKimi K2: 0.458 bpbNemotron 3 Ultra: 0.434 bpbV5 e21: 0.548 bpbV5 e22: 0.481 bpbV5 e23: 0.425 bpbV5 e24: 0.400 bpb62xDSv4 Flash120xDSv4 Pro108xKimi K269xNemotron 3 Ultra
Heldout Engineering Papers
Lower bits per byte is better. Training compute is in FLOPs on a logarithmic axis. The curve fits our current recipe; the dashed segment is a projection beyond the largest run.0.3590.4090.4580.5070.55610211022102310241025DeepSeek V4 Flash: 0.413 bpbDeepSeek V4 Pro: 0.403 bpbKimi K2: 0.421 bpbNemotron 3 Ultra: 0.405 bpbV5 e21: 0.517 bpbV5 e22: 0.456 bpbV5 e23: 0.405 bpbV5 e24: 0.383 bpb26xDSv4 Flash48xDSv4 Pro49xKimi K238xNemotron 3 Ultra
Heldout Math Papers
Lower bits per byte is better. Training compute is in FLOPs on a logarithmic axis. The curve fits our current recipe; the dashed segment is a projection beyond the largest run.0.320.370.430.480.5410211022102310241025DeepSeek V4 Flash: 0.365 bpbDeepSeek V4 Pro: 0.354 bpbKimi K2: 0.367 bpbNemotron 3 Ultra: 0.360 bpbV5 e21: 0.492 bpbV5 e22: 0.426 bpbV5 e23: 0.367 bpbV5 e24: 0.342 bpb12xDSv4 Flash21xDSv4 Pro16xKimi K222xNemotron 3 Ultra
Heldout Physics Papers
Lower bits per byte is better. Training compute is in FLOPs on a logarithmic axis. The curve fits our current recipe; the dashed segment is a projection beyond the largest run.0.380.430.490.540.6010211022102310241025DeepSeek V4 Flash: 0.433 bpbDeepSeek V4 Pro: 0.422 bpbKimi K2: 0.440 bpbNemotron 3 Ultra: 0.425 bpbV5 e21: 0.552 bpbV5 e22: 0.487 bpbV5 e23: 0.431 bpbV5 e24: 0.406 bpb16xDSv4 Flash29xDSv4 Pro29xKimi K224xNemotron 3 Ultra

6·N·D training FLOPs

Figure 2: Effective-compute per research area. 

By collecting granular buckets of content (e.g. documentation of a particular software tool or key papers in alignment research) we can get even more precise signals. Unlike for our generalization eval, we don’t want to fully remove much of this information (e.g. key papers in a field) from the pretraining corpus, but we still need to avoid rewarding sequence memorization4. To do this, we reworded/summarized these documents using a third-party frontier LLM. To avoid overfitting to granular evals, we created and evaluated them once per model generation; the ones below were made last week.

Magic’s goal is to build the best model for coding and autonomous AI R&D. To intentionally balance data mixing trade-offs, we also evaluate domains we deprioritize (e.g. facts about notable people, local news, or sports/events).

Our recipe vs.

effective-compute multiplier vs. best open model per eval

Eval multipliers are ranked within each panel on a logarithmic axis. Values above 1 favor our current recipe; values below 1 favor the baseline.0.01x0.1x1x10x100xSWE & AI R&DSWEAI R&D0.01x0.1x1x10x100xLocal news, world knowledge & lawLocal newsWorld knowledgeLaw

Figure 3: Effective-compute multiplier across domains. 

We fit scaling laws on eval sets across 167 domains and show compute efficiency gains per dataset.

No shortcuts

In late 2024, we trained a small dense model with an architecture designed for very long context windows. Our initial pretraining scale-ups kept blowing up in a wide variety of ways. We learned quickly that we had to build a stable foundation first. Smooth convergence, low-precision training quality equivalent to FP32, fast and stable infra, correct hyperparameter scaling rules. And most importantly: hunt the bugs.

Once we had that in place, we needed to find enough compute efficiency improvements to close the gap to the frontier with less compute. We had a few big bets to start with, but our progress ended up being the multiplicative result of tens of changes across model architecture, optimizer, training objective, and data curation.

NanoGPT speedruns provide a fast feedback cycle to evaluate new ideas, but we found that many things that improve tiny models don’t improve big models. Similarly, we found that some features present in most LLMs can be deleted without harming large scale performance.

To evaluate each model, optimizer, or data change, we train 3 models spanning 2 orders of magnitude of compute. We consider a change worth keeping if its power law fit suggests it will help at scale. Every few weeks, we scaled up to 1/10th of our hero scale and every few months we ran a full-scale hero run (V3, V4, V5 in Figure 4).

Compute efficiency relative to V2, with competitor reference lines.1x10x100x1000xV2Late ’24V3Early ’26V4July ’26V5Sep ’26Compute efficiencyvs. our V2Nemotron 3 · 24xKimi K2 · 10xDSv4 Pro · 5.6xx1.9x11x24505x vs V2
Figure 4: Acceleration of our pretraining research progress. 

To sanity check how pretraining loss translates to post-RL performance, we ran a short math RL run with a 16k CoT budget (Figure 5). All of our RL starts directly from the base model without SFT or distillation.

Math pass rate over RL training compute, with competitor reference lines.0%25%50%75%100%0.01%0.1%1%10%100%RL compute (as % of the model’sown pretraining FLOPs)Pass rateGPT-6 Astra · 100%Claude 5.1 · 98%Muse Spark 1.3 · 88%Gemini 3.8 · 83%Kimi K3 · 75%Grok 4.6 · 71%DSv4 Pro · 65%Inkling · 50%Qwen 3.8 · 45%GLM-5.3 · 45%Nemotron 3 · 27%V5 (e24) · 72%V5 (e23) · 31%
Figure 5: Pass@1 on heldout competition math problems during low-compute RL. 

5 FLOPs are 6·N·D, as in Figure 1.

What’s next

Our pretraining and long-context work is now quite mature. We’ll now scale long-horizon RL, training agents to keep learning after deployment through long-context. We’re also putting significant work towards alignment training techniques that present robust theoretical properties. And last but not least, we look forward to releasing the thing!

Concrete problems we’re tackling include:

  • Exploration and credit assignment in long-horizon RL (and systems work to scale up).
  • Alignment training against narrowly elicited latent knowledge.6
  • Further improvements to pretraining.

We are likely the smallest team in the world training trillion parameter models. The impact a single person with strong judgement can have has never been higher. If you want to help build aligned superintelligence, consider joining.

Source link

Share:

Atbildēt

3 latest news
Magic

Magic

Research update on compute-efficient pretraining and scaling to trillion-parameter models. Frontier pretraining is said to be a big-lab-only game. We don’t have 100k chips yet,

Read More »
News Archives
On Key

Related Posts

Magic

Magic

Research update on compute-efficient pretraining and scaling to trillion-parameter models. Frontier pretraining is said to be a big-lab-only game. We don’t have 100k chips yet,