TL;DR: You almost never need to pre-train a model. The economical path for small teams and researchers is to take a strong open base model, fine-tune it cheaply (LoRA/QLoRA) on high-quality data, or skip training entirely and use RAG. Pre-training from scratch is for the few labs with nine-figure budgets.
Everyone talks about AI models as if they're magic. They're not. Under the hood, a model is a huge pile of numbers adjusted over and over until its guesses improve. Once you understand that loop, the headlines about DeepSeek, Kimi, Claude, and Gemini start to make more sense, and so does the question every small team should ask: what should I actually build?
This guide covers:
- How machine-learning models are trained
- The stages of building a modern LLM
- What training costs, and how to make it economical
- How Chinese labs (DeepSeek, Kimi, Qwen) differ from Western frontier labs (OpenAI, Anthropic, Google)
- Where agentic tools like Kiro fit
- Where specialized research projects sit on this spectrum, with a worked example
- What the Prima Mente Alzheimer's Translation Challenge teaches about all of this
Model details and figures below are as reported at the time of writing. This field moves fast, so check primary sources (technical reports, model cards, vendor docs) before relying on any specific number.
1. How ML models are trained
At its core, training means adjusting millions to trillions of numbers (parameters, or weights) so the model's predictions get closer to the right answers. The loop never changes:
1. Forward pass Feed input in. The model produces a prediction.
2. Loss Compare the prediction to the right answer. Compute an
error number called the "loss". Lower is better.
3. Backward pass Backpropagation works out how much each weight
contributed to the error (the gradient).
4. Update Nudge each weight slightly to reduce the loss. An
optimizer such as AdamW does this step.
5. Repeat Millions of times, over billions of examples.
A few ideas matter for everything that follows:
- Parameters (weights): The model's learned knowledge. A "7B model" has 7 billion of them. More parameters mean more capacity, but also more compute and memory.
- Tokens: Text gets chopped into tokens, roughly ¾ of a word each. Models train on trillions of them.
- Compute: Measured in GPU-hours or FLOPs. It's usually the dominant cost.
- Scaling laws: Performance improves predictably as you grow model size, data, and compute together. That's why frontier models got so big. But bigger isn't automatically better per dollar, and that tension drives Sections 3 and 4.
2. The LLM training pipeline
Modern large language models are built in phases, each with a different job.
Phase A: Pre-training (the expensive one)
The model reads a huge corpus of web text, books, and code, and learns to predict the next token. This is self-supervised: nobody labels anything, because the "answer" is just the next word in the text. The result is a base model with broad knowledge that isn't yet helpful or safe. This phase uses more than 95% of total training compute.
Phase B: Supervised fine-tuning (SFT)
The base model trains on curated input and output pairs, like "question → good answer." This teaches it to follow instructions and reply in a useful format. It's far cheaper than pre-training: thousands to millions of examples instead of trillions of tokens.
Phase C: Alignment and preference optimization
This is where the model becomes helpful, honest, and harmless. The main techniques:
- RLHF (Reinforcement Learning from Human Feedback): Humans rank answers, a reward model learns those preferences, and the LLM is optimized against it, classically with PPO.
- DPO (Direct Preference Optimization): A simpler, cheaper alternative that skips the separate reward model.
- Constitutional AI (Anthropic): The model critiques and revises its own answers against a written set of principles, which reduces how much human labeling is needed.
Phase D: Reasoning training (the 2024–2026 shift)
The model learns to think before answering: it produces a long chain of reasoning, then a final answer. This is often done with reinforcement learning on verifiable rewards, where correctness can be checked automatically, as with math and code. DeepSeek-R1 and OpenAI's o-series popularized it. It improves hard reasoning without making the base model bigger.
3. What training costs, and how to make it economical
Why frontier training is so expensive
Frontier pre-training needs thousands of top-tier GPUs running for months. A single frontier run can cost tens to hundreds of millions of dollars in compute alone, before you count data, salaries, and failed runs. That's why only a handful of organizations pre-train frontier models from scratch.
The levers that make training cheaper
| Lever | What it does | Who uses it |
|---|---|---|
| Mixture-of-Experts (MoE) | Activates only a subset of the network per token (for example, 37B of 671B parameters). Big capacity at a fraction of the per-token compute. | DeepSeek, Kimi, Qwen, Mixtral |
| Low precision (FP8/INT4) | Trains or runs in 8-bit or 4-bit instead of 16 or 32-bit. Less memory, faster math. | DeepSeek (FP8 pre-training), most quantized inference |
| LoRA / QLoRA | Freezes the base model and trains tiny adapter matrices, about 0.1–1% of the weights. You can fine-tune a big model on one GPU. | Most open-source fine-tuning |
| Quantization | Stores weights in 4-bit, so bigger models fit on smaller GPUs. | QLoRA, llama.cpp, Unsloth |
| Distillation | Trains a small "student" to imitate a big "teacher." Small models that punch above their size. | DeepSeek-R1 distills, many small models |
| Better optimizers and stability tricks | Converge faster and avoid wasted failed runs (Muon, MuonClip). | Kimi K2 (MuonClip) |
| Data quality over quantity | Clean, de-duplicated, well-curated data trains better per token. | Everyone serious about results |
| Retrieval (RAG) instead of training | Keeps knowledge in a searchable store and retrieves it at query time, instead of baking it into weights. Near-zero training cost. | Most production deployments |
| Free and cheap compute | Kaggle (free T4 GPUs, about 30 hours a week), Colab, cloud credits, spot instances. | Students, small teams, researchers |
The most important beginner lesson
You almost never need to pre-train. The economical path is to take a strong open base model, fine-tune it cheaply with LoRA or QLoRA on your high-quality data, or skip training entirely and use RAG. Pre-training from scratch is for the few labs with nine-figure budgets. Everyone else builds on top.
4. The Chinese labs: DeepSeek, Kimi, Qwen
The defining theme of the major Chinese labs is efficiency and openness: near-frontier quality at a reported fraction of the cost, with open weights you can download and run yourself.
DeepSeek (V3 / R1)
- Architecture: Mixture-of-Experts with 671B total parameters and about 37B active per token. You get the capacity of a huge model at roughly the compute of a 37B one.
- Scale and cost: Pre-trained on 14.8 trillion tokens using FP8 training, in about 2.788 million H800 GPU-hours. The widely cited figure is roughly $5.6M for the main run, far below typical Western frontier estimates. The caveat matters: that's the final run's compute, not total R&D, so the comparison is imperfect. The efficiency is still real.
- R1 (reasoning): Reasoning ability came largely from reinforcement learning with GRPO (Group Relative Policy Optimization). R1-Zero was trained with RL and no supervised cold start, which showed reasoning can emerge from RL alone. The shipped R1 adds a small SFT cold start for readability.
- Openness: Open weights under an MIT license, plus detailed technical reports.
Kimi (Moonshot AI, K2)
- Architecture: MoE with 1 trillion total parameters and about 32B active, using 384 experts, 8 active per token.
- Training innovation: The MuonClip optimizer, which combines Muon with a "QK-clip" technique to keep training stable at trillion-parameter scale. Training instability is a hidden cost in large runs, and fixing it prevents wasted runs.
- Focus: Agentic tool use. K2 is built to call tools and take actions, not just chat. Base K2 isn't a chain-of-thought reasoning model by default. It's tuned for fast agentic action.
- Openness: Open weights.
Qwen (Alibaba, Qwen3 family)
- A broad open-weight family with dense models (every parameter active) and MoE variants, across many sizes from laptop-friendly to very large.
- Strong on multilingual, coding, and agentic tasks. It's widely used as a fine-tuning base because of its permissive licensing and range of sizes.
The common thread
MoE for efficiency, low-precision training, open weights, and published methods. The strategic bet is that openness drives adoption, and efficiency makes near-frontier capability affordable.
5. The Western frontier labs: OpenAI, Anthropic, Google
OpenAI (GPT series)
Proprietary, closed weights, API access. OpenAI pioneered the RLHF-aligned assistant (InstructGPT, then ChatGPT) and the reasoning-model wave with the o-series. Its budgets are very large and mostly undisclosed, and its product and ecosystem integration is deep.
Anthropic (Claude)
Proprietary, closed weights, API access. Anthropic is known for Constitutional AI and a strong emphasis on safety and reliability. That focus helps explain why Claude is a popular choice for agentic coding: it holds intent across long, multi-step tasks.
Google (Gemini)
Proprietary, closed weights, API access, deeply multimodal (text, images, audio, video), integrated across Google's products, and running on Google's own TPU hardware.
The nuance: Google also publishes the open-weight Gemma family, including MedGemma, a medical variant. So "Google" spans both closed frontier models (Gemini) and genuinely open small models (Gemma).
Meta (Llama): worth naming explicitly
Llama showed that a capable model could be released with open weights at all, and much of today's fine-tuning ecosystem exists because of it. Meta's openness stance has shifted across releases, which is instructive in itself. "Open" is a spectrum, and the license matters more than the press release.
The common thread
Closed weights, API access, large undisclosed budgets, heavy investment in alignment and safety, and productization. With these models, you rent capability rather than own the model.
6. Side by side
| Dimension | Chinese labs (DeepSeek, Kimi, Qwen) | Western frontier (OpenAI, Anthropic, Google) |
|---|---|---|
| Weights | Open. Download and self-host | Closed. API only (Google's Gemma is the exception) |
| Headline strategy | Efficiency and openness | Capability, product, and safety, kept proprietary |
| Architecture trend | Aggressive MoE (sparse) | A mix, often undisclosed |
| Training precision | FP8 pre-training (DeepSeek) | Undisclosed |
| Reported cost | Much lower (about $5.6M for DeepSeek's final run) | Much higher (tens to hundreds of millions), undisclosed |
| Reasoning | RL-centric (GRPO; R1-Zero showed RL alone can work) | RLHF plus dedicated reasoning models (o-series) |
| Alignment | Varies by model, generally less publicly detailed | Heavy emphasis (RLHF, Constitutional AI, red-teaming) |
| Can you fine-tune it? | Yes, with open weights | No. You can only prompt or call it |
| Transparency | Detailed technical reports | Limited: model cards and marketing |
The practical upshot for a small team: open-weight models are the ones you can download, fine-tune, and own. Closed models are things you call. A sensible pattern is to build on the open end for anything you train, and optionally call a closed model for one-off, high-quality data work.
7. Where Kiro fits (it isn't a model maker)
If you haven't seen it, Kiro is an agentic development tool, an IDE and CLI from AWS. It is not a model maker, which is a very common confusion.
- It doesn't train foundation models. It runs on Amazon Bedrock, which gives access to models from several providers, rather than producing its own.
- Its value comes from orchestration: spec-driven workflows, agentic tooling, and how it routes tasks to models, not from owning weights.
Three genuinely different roles:
Model makers (train) Orchestrators (route + act) Domain fine-tuners (specialize)
OpenAI, Anthropic, Kiro (agentic IDE/CLI on NeuroJen (MedGemma + LoRA on
Google, DeepSeek, → Bedrock, using models from → curated Alzheimer's literature)
Moonshot, Alibaba several providers)
Keeping these three roles separate makes most AI news much easier to read.
8. Where specialized projects fit: a worked example
Full disclosure: this is my project, so treat this section as a worked example, not a neutral case study.
NeuroJen mines Alzheimer's research literature and tries to extract structured claims of the form peripheral factor → mechanism → central brain pathology. One example is chronic gut inflammation feeding through gut-brain signaling into microglial activation. The bet is that Alzheimer's has body-wide signals that get under-read, because most tools look only at the brain.
Here's where it sits in the ecosystem above:
- Base model: MedGemma-4B. It's small, open, and already medically literate. We didn't pre-train it.
- Method: LoRA supervised fine-tuning via Unsloth on a single free Kaggle T4 GPU, with 4-bit quantization. That's Section 3's economical toolkit applied end to end: open base model, parameter-efficient fine-tuning, quantization, and free compute.
- The interesting bit, "answer-withholding" tasks: The training signal hides the field we want predicted, so the model has to reason about the body-to-brain link instead of just reformatting text. It's a small-scale echo of Phase D.
- Stage one comes before any training: GraphRAG. Retrieval runs over a Neo4j knowledge graph at zero GPU cost. It's also the baseline the fine-tuned model must beat. If the fine-tune can't beat retrieval, we don't ship it.
- Honest evaluation: The fine-tuned model is actually queried and scored against an explicit rubric by an LLM judge, and generations are logged for human review.
In one sentence: where frontier labs spend millions to pre-train general models, NeuroJen spends almost nothing to specialize an existing open model for one disease. That's the right strategy for a small team. We consume and specialize this ecosystem; we don't train it.
9. The Prima Mente Alzheimer's Translation Challenge
Who they are
Prima Mente is an AI-biology company with offices in San Francisco and London. It builds epigenomic foundation models, which learn from how genes are switched on and off across cell types, rather than from text. Its model family, Pleiades, uses autoregressive transformer decoders at 90M, 600M, and 7B parameters, trained on 1.9 trillion tokens of epigenetic data at single-nucleotide resolution. The work was developed with groups at Oxford, the Hebrew University of Jerusalem, and the University of Gothenburg. Reported results include 0.89 accuracy for early-stage Alzheimer's or Parkinson's detection from blood samples, rising to 0.97 when combined with protein tests.
This is the same pre-training loop from Section 1, applied to DNA methylation instead of English. Nothing exotic is happening. "Foundation model" describes a method, not a substance.
Their track record
In March 2026, Prima Mente shared the Alzheimer's Insights AI Prize with Biomni-AD (Stanford and Mount Sinai). The organizers doubled the prize pool so both teams received $1M. Prima Mente's entry, PARTHENON, models virtual neurons, microglia, and astrocytes as agents, so therapeutic hypotheses can be tested in silico before they reach a lab bench.
The Translation Challenge itself
It's a global, free competition to find new therapeutic hypotheses for Alzheimer's. It runs with the Alzheimer's Disease Data Initiative (ADDI) and partners including NVIDIA, Hugging Face, Nebius, Prime Intellect, Goodfire, and Boltz.
- The data: An open-source cellular atlas of roughly 150 million cells, including neurons, astrocytes, and microglia. It's accessed through the AD Workbench, an ADDI cloud environment connecting hundreds of datasets, and through Prima Mente's modeling platform.
- Stage 1, build and evaluate: Participants build models on the atlas. They're assessed on curated evaluations, including phenocopy tasks (does a perturbation reproduce a disease-like cell state?) and community-proposed evals. The strongest results get shortlisted.
- Stage 2, hypothesize and validate: Shortlisted teams propose one therapeutic hypothesis with expected molecular or functional phenotypes. Finalists' hypotheses get tested in a wet lab.
- Published schedule: Registration opened October 2026, the community launched in November 2026, prizes were slated for December 2026, model-building runs through spring 2027, and wet-lab validation is planned for summer 2027.
- Terms that matter: Free to enter, open to non-biologists ("set up so ML researchers can take part"), entrants keep rights to their models and discoveries, and you could nominate a gene or compound to test at registration.
Note: Competition schedules slip, datasets get renamed, and prize structures change. If you're reading this after late 2026, treat the timeline as historical context for how such a challenge is structured, and check the organizer sites for current details. Similar challenges recur, so the format will likely come back even if this edition has concluded.
Why this design is worth stealing
Even if you never touch Alzheimer's data, the structure is a good template for any AI-for-science project:
- Literature layer → cellular layer. Hypothesis generation on one side, validation on the other. Many AI-for-science projects fail because they generate hypotheses nobody can test.
- Shared infrastructure. Everyone works in the same hosted workbench, so the work isn't throwaway.
- Community-proposed evals. Participants define hard tasks like phenocopy, which stops benchmarks from saturating.
- A real deadline. Milestones turn open-ended interest into a pipeline someone actually finishes.
For NeuroJen, the connection is direct. Our extracted from → relation → to edges are candidate perturbations, and hippocampal microglia are part of that atlas. Structured hypotheses in, testable claims out: the two halves of one "papers → validated targets" pipeline.
Key takeaways
- Training is a loop: predict, measure the error, adjust the weights, repeat. Everything else is a variation on that.
- Pre-training is the expensive phase. Most people should fine-tune an open model or use RAG instead.
- Efficiency is a strategy, not a footnote. MoE, low precision, LoRA, and quantization are how small teams get serious results.
- Open versus closed matters. Open weights let you own and adapt a model. Closed APIs let you rent one.
- Keep the roles straight. Model makers train, orchestrators route, and specializers adapt. Tools like Kiro belong to the second group.
- Always beat the baseline. If your fine-tune can't beat retrieval, don't ship it.
Glossary
| Term | Plain meaning |
|---|---|
| Parameter / weight | One number the model learns. More means more capacity and cost. |
| Token | A chunk of text (about ¾ of a word) the model reads and writes. |
| Tokenizer / BPE | The rules that split text into tokens. Chosen before training, and it affects which languages and code formats a model handles well. |
| Embedding | The vector a token becomes once inside the model. |
| Context window | How much text the model can attend to at once. Expensive to grow. |
| Pre-training | The big, expensive phase: predict the next token across trillions of tokens. |
| Mid-training / annealing | An end-of-pre-training push: lower learning rate, more math, code, and synthetic data, and a longer context. |
| SFT | Supervised fine-tuning: teaching instruction-following with input→output pairs. |
| RLHF | Reinforcement learning from human feedback: aligning the model to ranked human preferences. |
| DPO | Direct preference optimization: a cheaper alternative to RLHF that needs no separate reward model. |
| RLVR | Reinforcement learning on verifiable rewards: grading correctness with a checker (math, code) instead of humans. |
| Reward hacking | The model learns to please the grader rather than be correct. |
| Constitutional AI | The model critiques its own answers against written principles. |
| MoE | Mixture-of-Experts: activates a subset of the network per token, for big capacity at low per-token compute. |
| LoRA / QLoRA | Training small adapters (optionally on a 4-bit model) instead of all the weights. Cheap fine-tuning. |
| Quantization | Storing and running weights in fewer bits (FP8, INT4). Less memory, faster, cheaper. |
| Distillation | A small student model learns to imitate a big teacher. |
| Synthetic data / self-play | Generating training examples with a model, then filtering them by verification. |
| Catastrophic forgetting | Fine-tuning erases earlier abilities. Mitigated with replay data and KL constraints. |
| RAG | Retrieval-augmented generation: fetching relevant documents at query time instead of storing all knowledge in the weights. |
That's all for now, till next time. Stay tuned for my next article on ADAM An AI Reasoning and Bioinformatics Model for Alzheimer's Disease Detection and Microbiome-Clinical Data Integration. We will go through it's architecture and how it economizes ai training using base LLMs, agentic systems, databases, embedding models and data to perform effective Alzheimer disease detection. Stay tuned.
Top comments (0)