Concepts / Prompt Engineering for Model Comparison

Prompt Engineering for Model Comparison

Finetuning reduces to three choices: a base model, a finetuning method, and a framework or service for running the training.

  • Programming

A Support Team Faces Three Choices

Imagine a small support team that wants a model to draft replies to customer tickets in its own house style. The team has a few hundred good example replies, a modest budget, and one shared GPU. Before any training begins, the team has to make decisions, and the source pack frames the mechanics of finetuning as reducing to three of them: a base model to start from, a finetuning method that decides which parts of the model get updated, and a framework or service that actually runs the training.

The source is clear that finetuning projects involve harder questions before these three choices appear. You have to decide whether finetuning is worth the effort at all, gather training data, and keep the resulting model up to date. Once those questions are settled, the finetuning step itself is comparatively simple. The rest of this article follows the three choices in turn, and then shows how they interact, because each choice affects the others.

Choosing a Base Model

Choosing a base model uses the same criteria introduced earlier in the course for model selection, and those criteria apply to both prompt-based work and finetuning. The source names three: model size, licenses, and benchmark performance. Size affects the cost and the hardware needed to run training and serving. The license determines what you are legally allowed to do with the model. Benchmark performance gives a rough sense of how capable the model is on tasks that others have already measured.

The source offers a starting strategy for the early part of a project, when you are still checking whether the task is feasible at all. Begin with the most powerful model you can afford. If that model cannot produce good results, a weaker model is unlikely to do better, which suggests the task or the data probably needs work first. If the strongest model does meet your needs, try weaker and cheaper models and measure each one against the strong model you started with. The strongest model therefore becomes the benchmark for the rest of the search.

Worked example

Applying the start-strong strategy to the support team

The support team wants the cheapest model that still drafts acceptable replies in its house style. Which base model should it benchmark first, and what does it do next?

  1. 1
    Start with the strongest affordable model

    The team picks the most capable model its budget and single shared GPU can handle, and uses it to test whether the reply task is feasible at all.

  2. 2
    Check whether the strong model meets the need

    If the strong model cannot produce good drafts, the source's reasoning says a weaker model is unlikely to do better, so the team should first improve the task or the example replies.

  3. 3
    Benchmark weaker models against the strong one

    Once the strong model works, the team tries smaller, cheaper models and compares each result against the strong model's output, which serves as the reference point.

Result

The strongest affordable model becomes the benchmark, and a cheaper base model is chosen only if it measures up against that benchmark.

Progression Path and Distillation Path

By the time a team reaches finetuning, it has usually run prompt engineering experiments and has a sense of how different models behave. The source describes two development paths for organizing the work from there, both drawn from OpenAI's finetuning best practices. They differ in where the work begins and what the final model is for.

What do you think happens?

Which development path starts from a small dataset and a strong model, using that strong model to generate training data for a cheaper model?

  • The progression path

  • The distillation path

Reveal answer
Answer:

The distillation path

The source says the distillation path uses a small dataset and a strong model to generate data for a cheaper model. The progression path instead validates a finetuning setup step by step.

Validate codeSmall datasetValidate dataStrong modelgenerates dataRun experimentsCheaper model trainedthenthenwith strong modeltrains
Where does the training data come from in each path, and which path starts with a small dataset plus a strong model that generates more training examples?

The progression path validates a finetuning setup in sequence: first the code, then the data, then the experiments. The distillation path works the other way around in terms of its starting resources. It begins with a small dataset and a strong model, and the strong model produces the data used to train a cheaper model. Because the two paths answer different questions, they are not competing answers to the same problem. A team can use both, for example by distilling a cheap model after a progression run has shown that the training setup works.

Full Finetuning Versus LoRA

Once a base model is chosen, the next decision is how much of the model to update. Full finetuning updates all of the model's parameters. Adapter-based techniques update only a subset of the parameters, and LoRA is the example the source names. The two methods make different demands on data and on serving.

CriterionFull finetuningAdapter-based (LoRA)
Parameters updatedAll of the model's parametersA subset of the parameters
Typical data neededThousands of examples, often moreCan show good results with a much smaller dataset, such as a few hundred examples
PerformanceTypically matches or exceeds adapter methodsCost-effective, but typically does not match full finetuning
Serving several finetuned modelsMeans serving multiple full modelsLets you serve several models that share one base model more efficiently
Source adviceAttempt laterStart here as a newcomer

Full finetuning and LoRA compared on data volume and serving cost, as described in the source

Serving cost is the second criterion. With LoRA you serve a single full model, while full finetuning means serving multiple full models. The support team's few-hundred-example dataset and single shared GPU point toward an adapter-based method, which matches the source's advice to start with something like LoRA and attempt full finetuning later.

Choosing a Training Framework

The framework decision answers a practical question: who runs the training, and on what hardware. The source describes an easy route and a flexible route, and a third option for training across more than one machine. The diagram below sets out the order in which to check project constraints.

The easiest route is a finetuning API. You upload data, select a base model, and get back a finetuned model. APIs can come from model providers, cloud service providers, or third-party providers. Their limits are that you can only use the base models the API supports, and the API may not expose every setting that affects performance. The source's verdict is that APIs suit someone who wants something quick and easy, and they can frustrate someone who wants more control.

The flexible route is to finetune with an open-source framework. The source names LLaMA-Factory, unsloth, PEFT, Axolotl, and LitGPT, and notes that these support a wide range of methods, especially adapter-based ones. For full finetuning, many base models publish their open-source training code on GitHub, which you can clone and run with your own data. The trade-off is that you must provision the compute yourself. The source estimates that a mid-tier GPU may be enough if you only do adapter-based work, and that a framework integrated with your cloud provider can help when you need more compute.

A single machine is not always enough. To finetune a model across more than one machine, you need a framework built for distributed training. The source lists DeepSpeed, PyTorch Distributed, and ColossalAI as examples.

Project needsfinetuningQuick route enough?Finetuning APIOpen-source frameworkFits on one machine?Distributed trainingframeworkcheck firstyesno, needs controlyesno
Given project constraints such as scale, control needs, and infrastructure, which option should I pick, and in what order do I check those constraints?

How the Three Choices Interact

The three decisions are sequential in the sense that each one narrows the next, but they also influence each other. The source gives the examples that a larger base model may need more compute, a method that updates fewer parameters may fit a small dataset better, and a managed API may be the quickest route while limiting which models are available. The diagram below places the three decisions as parts of one finetuning project.

Finetuning projectBase modelsize, licenses, benchmarksFinetuning methodwhich parts get updatedFramework or servicewho runs the trainingdecision 1decision 2decision 3affectsaffects
How do the three choices relate to each other, and which one sits above or contains the others?

Common Mistakes When Planning a Finetuning Run

  • Common mistake

    Treating the three choices as independent

    What it looks like

    Picking the largest base model first, then discovering the single shared GPU cannot train it.

    Why it fails

    The source states that each of the three choices affects the others, so a larger base model may need more compute.

    Do this instead

    Check hardware and budget constraints alongside the base model choice, and revisit earlier decisions if a later one fails.

  • Common mistake

    Starting with the weakest affordable model

    What it looks like

    Benchmarking only a small, cheap model and concluding the task is impossible.

    Why it fails

    The source's strategy is to begin with the most powerful affordable model, so a weak model's failure does not show whether the task is feasible.

    Do this instead

    Benchmark the strongest affordable model first, then compare weaker models against it.

  • Common mistake

    Assuming full finetuning is always the better method

    What it looks like

    Running full finetuning on a few hundred examples without comparing it to an adapter-based method.

    Why it fails

    The source notes that with a few hundred examples, full finetuning may not outperform LoRA, and full finetuning typically needs thousands of examples.

    Do this instead

    Match the method to data volume, and start with an adapter-based method as a newcomer.

  • Common mistake

    Choosing an API without checking its limits

    What it looks like

    Adopting a managed API, then finding the model you wanted is not supported or the key setting is not exposed.

    Why it fails

    The source says APIs limit you to supported base models and may not expose every setting that affects performance.

    Do this instead

    Confirm the supported base models and available settings before committing to an API.

  • Common mistake

    Forgetting that open-source routes require provisioning your own compute

Practice: Plan a Finetuning Project

MEDIUM

A research group has 4,000 labeled examples, a single mid-tier GPU, and needs full control over training settings. Working through the three decisions, which base model strategy, which method, and which framework route would you recommend, and why?

Hints
  • Apply the start-strong strategy to the base model and benchmark weaker models against it.
  • Compare the 4,000 examples with the source's guidance on how many examples full finetuning typically needs.
  • Consider whether an API can expose the control settings the group needs, and whether a single mid-tier GPU fits a single-machine framework.

Key Takeaways

  • Finetuning reduces to three choices: a base model, a finetuning method that decides which parts of the model get updated, and a framework or service that runs the training.
  • Start with the most powerful affordable base model and benchmark weaker, cheaper models against it.
  • The progression path validates code, data, and experiments in sequence, while the distillation path uses a small dataset and a strong model to generate data for a cheaper model.
  • Full finetuning updates all parameters and typically needs thousands of examples, while LoRA updates a subset, works with smaller datasets, and lets you serve several models that share one base.
  • Choose an API for quick, simple work with limited control, an open-source framework for flexible single-machine work where you provision compute, and a distributed training framework when one machine is not enough.

Related concepts

More concepts starting with P