Memory Footprint in Foundation Models
Prompting leaves the trained model as it is and shapes what you send to it.
Two Dates That Frame the Chapter
This chapter is about a central question: how do you adapt a language model to your needs? Answering it depends on two things, which architectures dominated the field and what changed among them. This article steps back from the main thread to set the historical stage, and then follows the thread the chapter cares about most: the memory cost of changing a model.
The source makes two historical claims. First, one architecture, the LSTM, once led deep learning for natural language processing. Second, 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. Treat this article as a map of vocabulary you will need later rather than a complete treatment of each topic.
From LSTM Dominance to the Transformer
An LSTM is a type of recurrent neural network. Before 2018, it was the dominant architecture of deep learning for NLP. The phrase dominant architecture is worth taking seriously. It does not mean the 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, the LSTM was the default choice for a long period.
Because dominance is about adoption across a field, a change of dominance is a historical event rather than a single technical breakthrough. The source states that the transformer architecture took over from the LSTM in 2018. It describes a handoff between two architectures, not a gradual blending of them. The diagram below shows the order of the two eras.
The source gives only a small amount of detail about each architecture. Use what it supports as a checklist: you know the LSTM was a recurrent neural network that led NLP before 2018, and you know the transformer took over in 2018. Anything beyond that, such as how either architecture works internally, is something you would need to look up next.
What Finetuning Changes Inside a Model
Finetuning adapts a model to a specific task by further training the whole model or part of it. It does so by adjusting the model's weights.
The clearest way to understand finetuning is to contrast it with prompt-based methods. The source explains that 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. In short, prompting changes the input, while finetuning changes the model itself.
The source lists what finetuning can enhance. It can improve domain-specific capabilities, such as coding or medical question answering, and it can strengthen a model's safety. However, the source says finetuning is most often used to improve a model's instruction-following ability, particularly to make it adhere to specific output styles and formats.
Why Finetuning Costs More Memory
Finetuning can produce a model that is more customized to your needs, but it also requires more up-front investment. The source is direct about the cost: 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 is available on a single GPU. For this reason, the source describes finetuning as expensive and challenging to do.
Why does this matter? A memory limit is a hard boundary. If the work you need to do does not fit on the hardware you have, the approach is not merely slower or costlier; it may be unavailable on that hardware. This is why the memory footprint sits at the heart of the choice between finetuning and prompting. The source does not break down which parts of memory grow during finetuning, so the claim to hold onto is the one it does make: finetuning needs much more memory than prompting, and naive finetuning can exceed a single GPU.
Choosing Between Finetuning and Prompting
A team deciding how to adapt a model
A small team wants a foundation model to answer questions in a fixed output format that their software can parse. They have one GPU available. Should they finetune the model or use prompt-based methods? Reason with the trade-off the source describes: finetuning is more customized and requires more up-front investment, while prompt-based methods have a much lower memory footprint.
- 1Name the goal
The team needs consistent output formatting. The source notes that finetuning is most often used to improve instruction-following, particularly adherence to specific output styles and formats, so finetuning is a relevant option.
- 2Check the hardware constraint
They have one GPU. The source says naive finetuning at foundation-model scale can exceed the memory of a single GPU. That is a warning sign for naive full finetuning on this hardware.
- 3Weigh the trade-off
Prompting has a much lower memory footprint, so it fits the constraint more easily. Finetuning would give a more customized result but at a higher up-front cost in memory.
- 4Decide with the constraint in view
A reasonable first step is to try prompt-based methods, since they fit the single-GPU constraint. If that does not produce the needed formatting, the team can look into more memory-efficient finetuning, which the next section introduces.
The team should not assume finetuning is automatically required. The memory footprint, not just the goal, determines which options are realistic on their hardware. The source does not give a formal decision rule, so this reasoning is an original illustration of the trade-off.
Parameter-Efficient Finetuning and Its Adapter Category
The source introduces parameter-efficient finetuning (PEFT) as a memory-efficient approach to finetuning that has become dominant in the finetuning space. Its name signals the goal: adapt the model while using fewer trainable parameters than full finetuning would require. The chapter explores PEFT, how it differs from traditional finetuning, and an overview of its evolving techniques.
| Aspect | Traditional finetuning | Parameter-efficient finetuning (PEFT) |
|---|---|---|
| Goal | Adapt the model by further training the whole model or part of it | Adapt the model while using fewer trainable parameters |
| Trainable parameters | Adjusts the model's weights through further training | Uses fewer trainable parameters than full finetuning requires |
| Memory footprint | Much higher than prompt-based methods; can exceed a single GPU when naive | Memory-efficient approach to finetuning |
| Status in the field | The baseline form of finetuning | Has become dominant in the finetuning space |
How traditional finetuning and PEFT differ, as the source describes them
The hierarchy below places adapter-based techniques inside the PEFT family. The source states that adapter-based techniques are one category within PEFT, which implies other categories sit alongside them. The source does not name those other categories, so the diagram labels them generically.
Mistakes Readers Make About Memory and Methods
Common mistake Assuming prompting changes the model's weights
What it looks likeBelieving that after giving a model instructions and context, its weights have been updated for the next task.
Why it failsThe source says prompt-based methods leave the trained model as it is and shape what you send to it. Only finetuning changes the weights.
Do this insteadTreat prompting as changing the input and finetuning as changing the model.
Common mistake Thinking finetuning is always the right choice because it is more customized
What it looks likeChoosing finetuning on a single GPU without checking whether the memory needed fits.
Why it failsThe source notes finetuning needs more up-front investment and a much higher memory footprint, and naive finetuning can exceed a single GPU's memory.
Do this insteadCheck the memory constraint first, then weigh customization against cost.
Common mistake Believing the LSTM was the only or best architecture for NLP
What it looks likeReading that the LSTM was dominant and concluding no other architecture was used for NLP before 2018.
Why it failsDominant means it was the default choice across a field for a long period, not that it was the only option or the best in every case.
Do this insteadRead dominance as adoption across the field, not as a claim of exclusivity.
Common mistake Treating PEFT and adapter-based techniques as the same thing
What it looks likeUsing the terms interchangeably as if every PEFT method is an adapter.
Why it failsThe source says adapter-based techniques are one category within PEFT, so PEFT is the broader family.
Do this insteadPlace adapters as one branch inside the PEFT family.
Open Questions the Source Leaves Unanswered
The source says a question it hears very often is when to finetune and when to use RAG. It does not answer that question in this passage. It only sets up the trade-off: finetuning is more customized and needs more up-front investment, while prompt-based methods have a much lower memory footprint. Keep the question open as you read later chapters.
Trace the Memory Trade-Off
A colleague says: 'Since finetuning changes the model itself and prompting does not, prompting must always be the cheaper of the two.' Using the source's description of memory footprint, explain whether the colleague's claim is supported, and identify what the source actually says about cost.
Hints
- Look at what the source says about the memory footprint of finetuning compared with prompt-based methods.
- Consider whether the source makes a claim about every possible situation or about the general relationship between the two approaches.
- Think about the difference between a cheaper memory footprint and a method that produces a better result.
What do you think happens?
Before you finetune, what would you expect to be true about the model's weights after you prompt it instead?
Reveal answer
After prompting, the model's weights are unchanged. Prompting leaves the trained model as it is and shapes what you send to it.
Finetuning is the approach that adjusts the weights. Prompting works through instructions, context, and tools in the input.
Key Takeaways
- The LSTM, a type of recurrent neural network, was the dominant architecture of deep learning for NLP before the transformer took over in 2018.
- Finetuning adapts a model to a specific task by further training the whole model or part of it, adjusting its weights, while prompt-based methods leave the model unchanged and shape its inputs.
- Finetuning has a much higher memory footprint than prompt-based methods, and naive finetuning at foundation-model scale can exceed a single GPU's memory.
- Parameter-efficient finetuning (PEFT) is a memory-efficient approach to finetuning that has become dominant, and adapter-based techniques are one category within it.