Concepts / Prompt-Based Methods and Instruction Design

Prompt-Based Methods and Instruction Design

Prompting leaves the trained model as it is and shapes what you send to it.

  • Programming

Why a Model's Setup Is a Real Decision

Suppose you have a language model that is already trained and you want it to behave the way your application needs. It might need to follow a particular output style, answer questions in a specialized domain, or produce a fixed format every time. There are two broad ways to get there. You can leave the model alone and change what you send to it, or you can change the model itself. This article is about that choice, and about the vocabulary you need to reason about it.

The chapter this article belongs to asks how to adapt a language model to your needs. That question depends on history, because the tools you will meet later were shaped by which architectures dominated the field and what changed. The source names two historical facts that set the stage: an architecture called the LSTM once led deep learning for natural language processing, and a different architecture, the transformer, took over that role in 2018. Keep those two names and that date in mind, because the rest of the article builds on them.

The LSTM Era and the 2018 Handoff

LSTM, a type of recurrent neural network, was the dominant architecture of deep learning for NLP before the transformer architecture took over in 2018. The word dominant needs care. It does not mean LSTM was the only option or the best option in every case. It means that when researchers and practitioners building NLP systems reached for a deep learning architecture, LSTM was the default choice for a long period. Dominance of this kind is a fact about adoption across a field, which is why a change of dominance is a historical event and not a single technical breakthrough.

The source describes the change as a handoff. It does not describe a gradual blending in which the two architectures slowly shared the field. The order of the two eras is shown below.

What Finetuning Actually Changes

Definition

Finetuning adapts a model to a specific task by further training the whole model or part of it. It does this by adjusting the model's weights. Finetuning changes the model itself, which is the key contrast with prompt-based methods.

Prompt-based methods adapt a model by giving it instructions, context, and tools. Prompting leaves the trained model as it is and shapes what you send to it. Finetuning instead changes the model's weights. The same underlying model can be steered either way, but only finetuning alters the numbers inside it.

The source says finetuning can be applied to the whole model or to part of it. The diagram below contrasts these two cases using a simplified model made of three layers. The layers are a teaching device, not a claim about any particular architecture.

What do you think happens?

If you finetune only a subset of the model's weights and leave the rest untouched, what happens to the weights you did not train?

  • They change by the same amount as the trained weights

  • They keep their earlier values

  • They are deleted and regenerated

Reveal answer
Answer:

They keep their earlier values.

The source defines finetuning as further training the whole model or part of it. If only part is trained, only that part's weights are adjusted, so the rest stay as they were.

Tracing Where the Memory Goes

Finetuning is useful because it can produce models that are more customized to your needs. The source is clear, however, that this comes with more up-front investment. Compared to prompt-based methods, finetuning incurs a much higher memory footprint. At the scale of today's foundation models, naive finetuning often requires more memory than what is available on a single GPU. For this reason the source describes finetuning as expensive and challenging to do.

Follow the state of the system as you move from prompting to finetuning. With a prompt-based method, the model's weights are not changed, so the work is confined to shaping the input you send. With finetuning, the weights are the thing being adjusted, so the training process has to hold and update that model. The source does not break down the exact memory categories involved in training, but the core difference is already visible: one approach changes the model's weights and the other does not.

QuestionPrompt-based methodsFinetuning
How is the model adapted?Through instructions, context, and tools sent to the modelBy further training the whole model or part of it
What changes?The input you send; the trained model is left as it isThe model's weights
Memory footprintMuch lowerMuch higher; naive finetuning can exceed one GPU at foundation-model scale
CustomizationShaped through what you sendMore customized to your needs
Up-front investmentLowerHigher

Summary of the trade-off described in the source

A Scenario Choosing Between Prompting and Finetuning

The source says that a question it hears very often is when to finetune and when to use RAG, but it does not answer that question in this passage. It does set up the trade-off you need to reason about: finetuning is more customized and requires more up-front investment, while prompt-based methods have a much lower memory footprint. The scenario below is an original illustration of how that trade-off plays out.

Worked example

A support team that needs a fixed answer format

A team has a language model that answers customer questions well, but the answers come back in many different layouts. The team needs every reply in the same format, and they must decide whether to change the request they send or to finetune the model.

  1. 1
    Identify the requirement

    The need is an output style and format. The source says finetuning is most often used to improve instruction-following, particularly to make a model adhere to specific output styles and formats.

  2. 2
    Consider the prompt-based option

    The team can add format instructions to every request. This leaves the model untouched and has a much lower memory footprint than finetuning.

  3. 3
    Consider the finetuning option

    The team can further train the model on examples of the desired format. This adjusts the model's weights and can produce a more customized model, but it requires more up-front investment and a much higher memory footprint.

  4. 4
    Weigh the trade-off

    If the format instructions are reliable and the team has limited resources, prompting is the lower-cost choice. If the format must be followed consistently across a large set of tasks and the team can afford the investment, finetuning becomes more attractive. The source does not settle this choice; it names the trade-off.

Result

The team should compare the reliability of prompt-based formatting against the cost of finetuning. The trade-off is memory footprint and up-front investment on one side and customization on the other.

Parameter-Efficient Finetuning and Its Categories

Parameter-efficient finetuning (PEFT) is a memory-efficient approach to finetuning that has become dominant in the finetuning space. Its full name signals the goal: adapt the model while using fewer trainable parameters than full finetuning would require. The source says the chapter explores PEFT, how it differs from traditional finetuning, and an overview of its evolving techniques.

PEFT is a family of approaches rather than a single technique. Adapter-based techniques are one category within PEFT. The diagram below places them in that structure. The source does not list the other PEFT categories, so the branch for them is left as a general placeholder.

The distinction to hold onto is this. Traditional finetuning trains the whole model or a part of it, and it has the high memory footprint described earlier. PEFT is designed to reach a similar adaptation goal while keeping the number of trainable parameters small. Adapter-based techniques belong to the PEFT branch, not to traditional finetuning.

Mistakes Learners Make With These Terms

  • Common mistake

    Treating prompting and finetuning as the same thing with different names

    What it looks like

    Saying that adding instructions to a request also updates the model's weights.

    Why it fails

    The source contrasts the two directly. Prompt-based methods give instructions, context, and tools and leave the trained model as it is. Finetuning changes the model's weights.

    Do this instead

    Ask one question: does this approach change the model's weights? If not, it is prompt-based.

  • Common mistake

    Assuming dominant means the only or best architecture

    What it looks like

    Concluding that because LSTM dominated NLP, it was always the best option.

    Why it fails

    The source says dominant means LSTM was the default choice for a long period, not that it was the only option or the best in every case.

    Do this instead

    Read dominant as a fact about adoption across a field.

  • Common mistake

    Assuming finetuning always means retraining every weight

    What it looks like

    Believing that finetuning must always adjust the entire model.

    Why it fails

    The source defines finetuning as further training the whole model or part of it.

    Do this instead

    Remember that finetuning can cover a subset of the model, and the weights outside that subset are not adjusted.

  • Common mistake

    Using PEFT and traditional finetuning as interchangeable labels

    Why it fails

    PEFT is described as a memory-efficient approach that uses fewer trainable parameters than full finetuning would require, and adapter-based techniques are one category within it.

    Do this instead

    Place adapter-based techniques under PEFT, and keep traditional finetuning as the higher-memory option.

Checking Your Understanding

MEDIUM

A colleague says: We do not need to finetune anything, because a prompt-based method and finetuning both change the model's weights, so they cost the same. Explain what is wrong with this claim, using the memory footprint and the definition of prompt-based methods.

Hints
  • Start by asking what a prompt-based method actually changes.
  • Compare the memory footprint of the two approaches as stated in the source.
  • Check whether the claim that both cost the same is supported by the source.

Key Dates and Terms to Keep

  • LSTM, a recurrent neural network, was the dominant deep learning architecture for NLP before 2018.
  • The transformer architecture took over from LSTM in 2018.
  • Finetuning adapts a model by further training the whole model or part of it, adjusting its weights.
  • Finetuning has a much higher memory footprint than prompt-based methods, which change the input rather than the model.
  • Parameter-efficient finetuning (PEFT) is a memory-efficient approach, and adapter-based techniques are one category within it.

Key Takeaways

  • LSTM was the default deep learning architecture for NLP for a long period, and the transformer took over that role in 2018.
  • Prompt-based methods shape a model through instructions, context, and tools, while finetuning changes the model's weights.
  • Finetuning can produce more customized models, but it has a much higher memory footprint and requires more up-front investment.
  • PEFT is a memory-efficient family of finetuning approaches, and adapter-based techniques are one category within it.

Related concepts

More concepts starting with P