Book a free call

What Is a Foundation Model, and How Does It Work?

A foundation model is a large model trained on broad data that teams adapt for many tasks, from drafting to search, instead of training a new model each time.

Hertiv engineering teamReviewed by a senior engineer
6 min read
What Is a Foundation Model, and How Does It Work?
On this page

Short answer

A foundation model is a large machine learning model trained on a broad mix of text, images, code or other data, which teams then adapt for many different tasks. Instead of training a separate model for each job, a team starts from the foundation model and tunes it, prompts it or connects it to its own data for the task at hand.

What is a foundation model?

A foundation model is a large model trained once on a broad set of data, such as books, web pages, images and code, that can then be adapted for many tasks. It learns general patterns from the data, such as how language works, how images relate to words, or how code is structured, and those patterns carry over to new tasks.

The name comes from the idea that the model is a foundation: other systems are built on top of it. A team does not train a model from scratch to answer support tickets or summarise documents. It starts from a foundation model and adapts it with prompts, examples or a smaller round of training on its own data.

Most well-known language and image models today are foundation models. They are usually trained by large providers with large computing budgets, and teams access them through an API or download open-weight versions to run themselves.

How is a foundation model trained?

A foundation model is trained by feeding it a huge amount of data and asking it to predict what comes next. A language model predicts the next word in a sentence; an image model learns to rebuild an image from noise. The model adjusts its internal settings each time it is wrong, and over millions of examples it learns the patterns in the data.

Training happens in stages:

  1. Pre-training. The model learns general patterns from a broad dataset. This is the expensive stage, using large amounts of computing power.
  2. Fine-tuning. The model is trained further on a smaller, task-specific dataset, such as support tickets or legal documents.
  3. Alignment. The model is adjusted so its answers follow the instructions and limits the provider wants, such as refusing harmful requests.

Most teams never run pre-training. They use a model that is already trained and focus on the later stages: choosing the right model, writing good prompts, connecting their own data and checking the output.

How is a foundation model different from a task-specific model?

A foundation model is different from a task-specific model because it is trained for breadth, not for one job. A task-specific model is trained on one dataset for one purpose, such as sorting invoices or flagging fraud, and it usually does that one job well and cheaply.

Aspect Foundation model Task-specific model
Training data Broad mix of text, images, code One dataset for one job
Tasks Many, after adaptation One
Cost to train Very high Low to medium
Cost per use Higher, per token or call Usually lower
Flexibility High: new tasks need prompts, not retraining Low: new tasks need new training
Best when The task changes often or is open-ended The task is fixed and high volume

In practice the two work together. A foundation model can draft an answer, while a small task-specific model checks it, routes it or extracts the fields. Choosing between them is a cost and flexibility decision, not a question of which is better in general.

What can you build with a foundation model?

You can build drafting, summarising, search, coding help and classification with a foundation model, usually by connecting it to your own documents and checking its output. The model supplies the language skill; your data supplies the facts.

Common uses include:

  • Support drafts. Draft replies from your help centre and ticket history, with a human approving each one.
  • Document summaries. Turn long reports, contracts or meeting notes into short summaries with the key points.
  • Internal search. Answer staff questions over policies and manuals, with links to the source document.
  • Code help. Explain code, suggest fixes and draft tests inside the tools developers already use.
  • Content drafts. Produce first drafts of product copy for a human to edit and own.

None of these should publish or act without a check. The model can be confident and wrong, so every use case needs a review step, a way to trace the answer to its sources, and a fallback when the answer is not good enough.

How do you start using a foundation model?

You start using a foundation model by picking one narrow task, testing the model on real examples, and adding your own data before you write any production code.

  1. Pick one task. Choose a job with a clear output, such as drafting support replies or summarising meeting notes.
  2. Gather examples. Collect 20 to 50 real inputs with known good outputs. These become your test set.
  3. Try prompting first. Test the model with clear instructions and a few examples before considering any training.
  4. Connect your data. If answers need facts from your documents, add retrieval so the model quotes your sources.
  5. Measure and review. Score the model on your test set, have a human review the failures, and fix the prompt or the data before expanding.

For a deeper comparison with the models most teams compare them to, see foundation model vs LLM.

For the testing step, how to test AI models covers how to build the test set.

Example (hypothetical): a support team tests a foundation model

Example (hypothetical): a support team handles 200 tickets a day and wants to draft replies with a foundation model. It collects 200 past tickets with the replies that resolved them, then tests the model on those 200 cases.

On the first test, the model's drafts are usable without changes on 132 of the 200 tickets, which is 132 / 200 = 66%. The team improves the prompt with three good examples and adds retrieval from the help centre, then tests again on the same 200 tickets.

On the second test, 161 of the 200 drafts are usable, which is 161 / 200 = 80.5%. The team ships the draft feature for the ticket types where the score is highest, and keeps the rest on manual replies. The test set made the decision easy: the numbers, not a demo, showed where the model was ready.

What are the common mistakes?

The most common mistakes with foundation models are treating them as a source of facts, skipping the test set, and giving them jobs they were not built for.

  • Trusting the output as fact. A foundation model predicts likely text, not verified truth. Ground answers in your documents.
  • No test set. Without real examples and known good answers, quality debates are guesswork.
  • Picking the biggest model by default. A smaller or cheaper model often scores the same on a narrow task.
  • Skipping the review step. Drafts that go straight to customers will eventually contain a confident error.
  • Feeding it messy data. Outdated or duplicated documents produce outdated or duplicated answers.
  • No cost control. Per-token pricing adds up fast on long documents and high volumes.

For the basics of how these models learn, what is machine learning is a useful starting point.

Key takeaways

  • A foundation model is trained once on broad data, then adapted for many tasks
  • Most teams never pre-train; they prompt, tune or connect a model that already exists
  • Foundation models suit open-ended work; task-specific models suit fixed, high-volume jobs
  • Every use case needs a test set, a review step and a way to trace answers to sources
  • Start with one narrow task and let the test scores decide where to expand

Frequently asked questions

What is a foundation model in simple terms?

A foundation model is a large model trained on a broad mix of data, such as text, images and code, that can be adapted for many tasks. Think of it as a general-purpose engine: you add your instructions and your data, and it drafts, summarises, searches or classifies for that specific job.

Is a foundation model the same as an LLM?

An LLM is a type of foundation model, focused on language. Foundation model is the broader term: it also covers models for images, audio and other data. A large language model is a foundation model, but not every foundation model is a language model.

Do you need to train a foundation model yourself?

Almost never. Pre-training a foundation model takes very large datasets and computing budgets. Most teams use a model trained by a provider, through an API or an open-weight download, and adapt it with prompts, examples or a smaller round of training.

How much does using a foundation model cost?

It depends on the model, the provider and the volume. API models usually charge per token, so long documents and high volumes cost more. Open-weight models cost computing power instead. Compare the cost per task on your own test set before choosing.

Can a foundation model be wrong?

Yes. A foundation model predicts likely text, which means it can produce confident answers that are wrong, outdated or made up. Grounding answers in your own documents, checking the output and keeping a human review step are the standard ways to manage this.

What is the difference between fine-tuning and prompting?

Prompting tells the model what to do with instructions and examples at the time of use, and costs nothing to set up. Fine-tuning trains the model further on your data, which takes more effort but can improve consistency. Most teams start with prompting and only fine-tune when prompting is not enough.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: AI and agent systems in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Planning a product on a foundation model and unsure where to start? Talk to Hertiv.

A senior engineer replies within one business day. Or see our LLM Development service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to [email protected].

Prefer email? Write to [email protected]
Estimate costBook a call