Skip to content
ImagineWorld

Cost, Time, and Risk

node_idnode-book_llm-systems-engineering_module-11-cost-time-and-risk
node_typechapter-node
schema_profileworld.chapter_node.v1
statusactive
entropyhigh
manifoldworld
domainimagineworld.net
authorityinforms
layercorpus
chapter_num11
chapter_titleCost, Time, and Risk
governed_byCORPUS
constitutional_citationCONSTITUTION
local graph

Teams that begin a project without a grounded view of costs in money and calendar time tend to encounter the same problems in the same order, and they tend to be surprised by them at the same stage. This module offers an thorough account of what each of the three development pathways introduced earlier demands, so that planning can begin from a position of clarity. The intent is descriptive, helping you see the shape of the cost landscape and the categories of risk that apply to your chosen approach. Hardware specifics are addressed in the module that follows, while the deeper economics of full-scale pretraining are examined later in the book.

How Costs Differ Across the Three Pathways

Section titled “How Costs Differ Across the Three Pathways”

The three development pathways differ from one another along resource dimensions that matter to planning.

Fine-tuning a capable base model on a curated dataset can be accomplished on a single high-memory accelerator in many cases, with total expenses measured in tens or hundreds of dollars when parameter-efficient methods are used.

Continued pretraining sits at a higher tier, requiring larger compute allocations because the corpus is bigger and the training run is longer, and because the goal of integrating new knowledge demands sustained gradient updates across many billions of tokens.

Training a model from scratch occupies an entirely different cost regime, with published estimates for frontier-class runs reaching into the millions of dollars in compute alone.

The differences across pathways correspond to different categories of expense. Fine-tuning is dominated by the cost of curating high-quality examples and the engineer time spent iterating on prompt formats. Continued pretraining moves the dominant cost toward data acquisition and cleaning, since domain corpora must be assembled and validated before training can begin. Training from scratch also increases a third category of expense, namely the staffing and infrastructure overhead required to operate a distributed training system reliably for weeks at a time. Strubell and colleagues documented how the energy and financial footprint of large training runs grew sharply as model sizes increased, with the most demanding configurations producing carbon emissions comparable to the lifetime output of several passenger vehicles (Strubell et al., 2019).

lse-fig-2-9-cost-composition.png

Figure 2-9. Cost Composition Across Training Pathways

A useful way to think about the cost gap is in orders of magnitude. A LoRA-based fine-tuning run on a 7 billion-parameter open model can complete in a few hours of single-GPU time. A continued pretraining run on the same model with a multi-billion-token domain corpus may consume hundreds of GPU-hours. In contrast, even a hobbyist from-scratch run targeting a similarly sized model from random initialization, may require tens of thousands of GPU-hours when accounting for the full data volume the scaling literature suggests is needed. Each step up the ladder represents roughly two orders of magnitude in compute alone, before any other category is counted. The precise training economics of from-scratch runs are further discussed in Module 39.

Compute cost and calendar time are related but distinct. A run that consumes a thousand GPU-hours can complete in a single day on a 40-GPU cluster or take more than a month on a single accelerator. The calendar time that matters to a project is the elapsed time from the first experiment to a deployable system, and that figure is almost always longer than initial estimates suggest. Fine-tuning projects, even at their simplest, typically take weeks when the full cycle of dataset construction and evaluation is accounted for. Continued pretraining projects often span months, with the data preparation phase alone consuming as much calendar time as the training run itself. From-scratch projects routinely take six months to a year or longer, even at the small end of the scale spectrum.

lse-fig-2-10-calendar-time.png

Figure 2-10. Calendar Time to Deployment Across Training Pathways

The reason these timelines stretch is that the visible work of training is usually a small fraction of the total. Engineers planning a project frequently estimate based on the duration of the training loop and underestimate the time required for the surrounding activities. Data preparation and evaluation harness construction both consume substantial calendar time, and they tend to be discovered sequentially as earlier phases reveal what the next phase requires.

The gap between a working prototype and a dependable deployed system also tends to be underestimated. A model that produces acceptable outputs on a hand-picked set of test prompts is different from a model that handles the variance of real user input without producing failures. Closing that gap requires evaluation work and behavioral testing, and often a second iteration on training data composition. Teams that treat the first acceptable training run as the end of the project are usually forced to revisit it once deployment begins.

Categories of Risk Across the Three Pathways

Section titled “Categories of Risk Across the Three Pathways”

Every pathway carries a distinct set of failure modes, and a sound plan accounts for the risks specific to the chosen approach. Fine-tuning runs are most often derailed by data quality problems. A small dataset with inconsistent formatting and ambiguous labels can produce a model that behaves worse than the base model it started from. Because the dataset is small, individual problematic examples carry disproportionate weight, and the failure can be subtle enough that it is only detected after deployment. The risk of capability regression, where the fine-tuning process degrades the general abilities the base model already had, is also a recurring concern when learning rates are set too aggressively or when training continues too long.

Continued pretraining introduces its own risks, the most prominent of which is catastrophic forgetting. When a model is trained on a narrow domain corpus for an extended period, the weight updates that install new knowledge can simultaneously erode the representations supporting older capabilities. The model may become more proficient in its target domain while becoming less reliable on adjacent tasks. Detecting this kind of degradation requires evaluation infrastructure that spans both the new domain and the original capability profile, and teams that build only domain-specific evaluation often discover the regression too late to address it cheaply.

From-scratch training carries the broadest risk surface. Training instability can manifest as loss spikes that derail a run after weeks of progress. Hardware failures in long-running distributed training can corrupt checkpoints or introduce subtle numerical inconsistencies across devices. Data pipeline errors, which may be invisible during early phases, can produce silent degradation that only becomes apparent when the trained model is evaluated against a reliable benchmark. Cost overruns are themselves a category of risk, since the gap between a planned budget and the actual figure can grow rapidly when the training run must be restarted or when the data pipeline produces lower yields than expected.

Some risks are shared across pathways. Evaluation infrastructure that is built too late and the underestimation of personnel time are common to projects of every scale. Other risks are specific to one pathway. Distributed training failures are largely a from-scratch concern. Catastrophic forgetting is largely a continued pretraining concern. Dataset bias amplification is most acute in fine-tuning, where a small dataset can produce outsized behavioral effects.

A resource plan that survives contact with the project is one that begins with honest scoping at the level of pathway choice and works downward into specifics.

  1. Translate the chosen pathway into a compute estimate that reflects the scale of the model and the volume of data the project requires. For from-scratch projects, the work of Hoffmann et al. (2022) suggests at a ratio in the vicinity of 20 tokens per parameter.

    This relationship gives planners a starting point for sizing both the compute budget and the data acquisition effort.

  2. Build in contingency at the stages where uncertainty is highest. Data preparation almost always takes longer than estimated, so the data phase should be budgeted with explicit buffer time. Training runs almost always require at least one restart, so compute budgets should be set with restart capacity in mind. Evaluation work almost always reveals problems that demand a second iteration, so the timeline should accommodate a second pass through training and data preparation.

  3. Identify early warning signs of underestimation and to act on them when they appear. When a data preparation phase that was budgeted for two weeks reaches the four-week mark, the right response is to revisit the overall plan. When pilot training runs at small scale produce unstable loss curves, the right response is to investigate before scaling up.

A realistic resource plan acknowledges that some categories of cost are difficult to estimate in advance and treats those categories with explicit humility. Personnel time is the most common category to underestimate, and it is also the one most resistant to compression once the project is underway. Infrastructure complexity is another category that tends to grow beyond its initial scope, particularly for from-scratch projects where the integrated pipeline must support distributed training and evaluation in coordination. Treating these categories as ranges instead of point estimates produces plans that are more robust to the inevitable surprises of building at scale.

The discipline of planning honestly is itself one of the most valuable skills a team building an LLM can develop. Projects that fail rarely fail because the technology is beyond the team’s reach. They fail because the gap between expected and actual cost compounds across the project lifecycle until a decision point is reached where the remaining work cannot be justified by the remaining budget. Teams that begin with realistic estimates, that build in contingency at the right stages, and that treat early warning signs as invitations to replan are the teams that complete their projects and produce models worth the investment.