<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ephrame Amanu on Medium]]></title>
        <description><![CDATA[Stories by Ephrame Amanu on Medium]]></description>
        <link>https://medium.com/@ephremeamanu?source=rss-578e37454952------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*s3NU7yw3AHP-Opsu</url>
            <title>Stories by Ephrame Amanu on Medium</title>
            <link>https://medium.com/@ephremeamanu?source=rss-578e37454952------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 10:02:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ephremeamanu/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[PEFT Explained: How to Fine-Tune Giant Models Without Melting Your GPU]]></title>
            <link>https://medium.com/@ephremeamanu/peft-explained-how-to-fine-tune-giant-models-without-melting-your-gpu-eb403b109742?source=rss-578e37454952------2</link>
            <guid isPermaLink="false">https://medium.com/p/eb403b109742</guid>
            <category><![CDATA[model-finetuning]]></category>
            <category><![CDATA[lora]]></category>
            <category><![CDATA[adapter]]></category>
            <category><![CDATA[peft]]></category>
            <category><![CDATA[ml-engineering-tips]]></category>
            <dc:creator><![CDATA[Ephrame Amanu]]></dc:creator>
            <pubDate>Fri, 14 Aug 2026 13:36:01 GMT</pubDate>
            <atom:updated>2026-08-14T13:36:01.430Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VOhqZK5W18NFH1yUGHFPsg.png" /></figure><p>If you’ve ever tried to fine-tune a large language model on your own hardware, you already know the punchline: it hurts. A 7-billion-parameter model can eat over 100GB of GPU memory just to update all its weights during training. Most of us don’t have that lying around. So the question becomes — do you <em>really</em> need to touch every single parameter to teach a model something new?</p><p>Turns out, no. That’s the whole idea behind <strong>Parameter-Efficient Fine-Tuning (PEFT)</strong>, and it’s quietly become one of the most practical skills in an AI engineer’s toolkit. This post is a quick, no-fluff tour of the major PEFT methods, why they exist, and when you’d actually reach for each one.</p><h3>Why Full Fine-Tuning Is Overkill (Most of the Time)</h3><p>Think of a pretrained model like a musician who already knows thousands of songs. If you want them to learn one new song, you don’t send them back to music school to relearn everything from scratch — you just teach them the new part. Full fine-tuning is the “back to music school” approach: you update every weight in the network, store a full copy of the model for every task, and pay the full training cost each time.</p><p>That gets expensive fast, especially when:</p><ul><li>You’re working with models in the billions of parameters</li><li>You need separate fine-tuned versions for many different tasks</li><li>You don’t have access to a GPU cluster (most of us)</li></ul><p>PEFT methods solve this by freezing almost the entire pretrained model and only training a small set of new or selected parameters — often less than 1% of the total. You keep almost all the “knowledge,” and you cheaply steer it toward your task.</p><h3>The Methods, One by One</h3><h3>1. Adapters</h3><p>The original idea (Houlsby et al., 2019) is simple: slide small bottleneck layers into each transformer block, freeze the rest of the model, and only train those tiny adapter modules. Each adapter squeezes the hidden representation down to a small dimension and projects it back up, with a residual connection so the original signal isn’t lost.</p><figure><img alt="basic adapter architecture" src="https://cdn-images-1.medium.com/max/544/0*LLykuh_8LIzwNUz_.png" /></figure><p>Think of adapters as sticky notes clipped onto a textbook — the textbook (the pretrained model) stays untouched, but the notes redirect how you read it. Typically trains a small fraction of total parameters, and you can swap adapters in and out per task.</p><h3>2. LoRA (Low-Rank Adaptation)</h3><p>LoRA (Hu et al., 2021) is probably the method you’ve heard of most, and for good reason. Instead of adding new layers, it freezes the original weight matrices and injects a pair of small, low-rank matrices alongside them. During training, only those small matrices update. At inference time, you can even merge them back into the original weights, so there’s zero extra latency.</p><p>Why it’s popular: it’s simple, it works well across model sizes, and libraries like Hugging Face’s peft make it a five-line change.</p><pre>from peft import LoraConfig, get_peft_model</pre><pre>config = LoraConfig(<br>    r=8,                # rank of the low-rank matrices<br>    lora_alpha=16,       # scaling factor<br>    target_modules=[&quot;q_proj&quot;, &quot;v_proj&quot;],  # which layers to adapt<br>    lora_dropout=0.05,<br>    task_type=&quot;CAUSAL_LM&quot;<br>)</pre><pre>model = get_peft_model(base_model, config)<br>model.print_trainable_parameters()<br># something like: trainable params: 0.06% of total</pre><p>That’s it — you’re fine-tuning a multi-billion parameter model by updating a sliver of it.</p><h3>3. Prefix Tuning</h3><p>Prefix tuning (Li &amp; Liang, 2021) doesn’t touch the model weights at all. Instead, it prepends a small sequence of trainable “virtual tokens” to the input of every transformer layer. The model itself stays completely frozen — only those prefix vectors are learned.</p><p>It’s like giving someone a sticky note before they start reading, priming how they interpret everything that follows, without changing a word of the actual book.</p><h3>4. Prompt Tuning</h3><p>A lighter cousin of prefix tuning (Lester et al., 2021). Instead of injecting trainable vectors at every layer, you only add them at the input embedding layer. It’s cheaper and simpler, though it tends to need a larger base model to really shine — it works great at scale, less so on smaller models.</p><h3>5. P-Tuning v2</h3><p>P-Tuning v2 (Liu et al., 2022) is essentially prefix tuning re-engineered to work reliably across model sizes and tasks, including harder ones like sequence labeling — something plain prompt tuning struggled with. It reintroduces trainable prefixes at every layer (like prefix tuning) but with tweaks that make optimization more stable.</p><h3>6. BitFit</h3><p>BitFit (Zaken et al., 2021) takes minimalism to the extreme: freeze every weight matrix, and only train the bias terms. That’s it. Surprisingly, this tiny sliver of parameters can get you respectable performance on many tasks — proof that you often don’t need to move much to get a model to shift its behavior.</p><h3>7. (IA)³</h3><p>(IA)³ (Liu et al., 2022) learns small vectors that rescale the model’s internal activations — keys, values, and feed-forward activations — through element-wise multiplication. It trains even fewer parameters than LoRA in many setups, and was actually designed as part of a broader few-shot learning method (T-Few).</p><h3>8. QLoRA</h3><p>QLoRA (Dettmers et al., 2023) isn’t a new adaptation mechanism — it’s LoRA’s memory-efficient sibling. It quantizes the frozen base model down to 4-bit precision, then trains LoRA adapters on top in higher precision. This is the trick that lets people fine-tune 30B+ parameter models on a single consumer GPU. If you’ve ever seen someone fine-tune a huge open-source model on a laptop-class card, this is usually how.</p><h3>Quick Comparison</h3><p>Method What’s Trained Touches Every Layer? Good For Adapters Small bottleneck layers Yes Multi-task setups, swappable modules LoRA Low-rank weight deltas Selected layers General purpose, best default choice Prefix Tuning Virtual tokens per layer Yes Generation tasks Prompt Tuning Input embeddings only No Very large models, simple tasks P-Tuning v2 Prefixes per layer (stabilized) Yes Harder tasks like sequence labeling BitFit Bias terms only Yes (biases) Quick, ultra-lightweight tuning (IA)³ Activation rescaling vectors Yes Few-shot / very low compute budgets QLoRA LoRA adapters + 4-bit base Selected layers Fine-tuning huge models on one GPU</p><h3>So Which One Should You Actually Use?</h3><p>If you’re just getting started, LoRA is the sensible default — it’s well-supported, well-documented, and works across nearly every architecture people care about today. If your hardware is the real bottleneck, QLoRA is the move. If you’re building a multi-tenant system where different users need different fine-tunes, adapters give you a clean way to swap task-specific modules without duplicating the whole model. And if you just want to see how far a minimal change can take you, BitFit is worth trying if only for how absurdly small it is.</p><h3>The Bigger Picture</h3><p>The common thread across all of these methods is the same insight: pretrained models already contain most of what they need to know. Fine-tuning, in the PEFT world, isn’t about re-teaching the model — it’s about finding the smallest possible nudge that redirects its existing knowledge toward your task. That mindset shift is why PEFT has become the default rather than the exception for anyone fine-tuning models outside of a well-funded lab.</p><p>If you take one thing away from this: you almost never need to fine-tune the whole model. Start small, measure, and only go bigger if you actually need to.</p><p>Don’t forget to clap and repost if you got this helpful.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eb403b109742" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>