A pretrained language model can handle many general tasks, but it may need extra training to follow a specific set of instructions reliably. Imagine teaching one to classify news articles as World, Sports, Business, or Sci/Tech. We provide examples with the correct labels and help the model adjust its predictions.
Inside a model are millions or billions of numerical weights. Think of them as settings that influence what the model predicts. Adapting a model means changing some of those settings, or adding new settings alongside them.
The six methods below approach that problem differently. Some change every original weight; others learn a small set of additions. The last method experiments with directly editing selected weights. The main questions are what changes, what stays fixed, and how much training memory is needed.
About the examples: The Python snippets illustrate the defining step of each technique. They are not full training programs, have not been executed for this article, and do not establish benchmark performance. A proper experiment requires labelled training data, a training loop, and evaluation on examples the model has not seen.
A shared starting point
We'll use Qwen2.5-0.5B-Instruct, a relatively small language model, with PyTorch and Hugging Face's Transformers and PEFT libraries. The function below loads a fresh copy so each method starts from the same model rather than inheriting another method's changes.
import torch
from transformers import AutoModelForCausalLM
from peft import LoraConfig, get_peft_model
MODEL = "Qwen/Qwen2.5-0.5B-Instruct"
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
def load_base():
return AutoModelForCausalLM.from_pretrained(MODEL).to(DEVICE)1. Full fine-tuning: change the original model
Full fine-tuning allows all trainable weights to change. When the model predicts the wrong news category, training calculates an error and adjusts the weights to make the correct answer more likely next time. That process repeats across many examples.
The simple way to understand it: you are allowed to revise the entire model, even if the task only needs small changes. This gives training plenty of flexibility, but requires memory to keep track of the weights and the information needed to update them.
A basic gradient-descent update looks like this:
Read this as: new weights = current weights − a calculated adjustment. Here, measures the error and controls the adjustment size. The code uses AdamW, which has a more detailed update rule.
model = load_base()
optimizer = torch.optim.AdamW(model.parameters(), lr=2e-5)
# Train with labelled examples and backpropagation.Full fine-tuning is useful when the task calls for substantial adaptation and enough compute is available. It also provides a reference against which less expensive methods can be measured.
2. LoRA: keep the original model and learn corrections
LoRA leaves the pretrained weights unchanged. Instead, it trains small additional matrices that modify how selected parts of the model behave.
An analogy is keeping the original document intact while learning a separate set of corrections. Those corrections affect the result when the model runs, without replacing the original weights.
LoRA represents a correction using two matrices, and :
The formula says: use the original weights plus a learned correction. The rank controls the size of the correction matrices, and sets their scale. For a single matrix, a rank-8 LoRA correction trains 16,000 values instead of the original million.
config = LoraConfig(
r=8, lora_alpha=16,
target_modules=["q_proj", "v_proj"],
)
model = get_peft_model(load_base(), config)
model.print_trainable_parameters()Here, q_proj and v_proj identify two attention components to adapt. LoRA is useful when a pretrained model already performs reasonably well and needs task-specific improvements without updating its entire set of weights.
3. LoRA-FA: train fewer parts of the correction
Regular LoRA trains both matrices, and . LoRA-FA fixes and trains only .
Think of LoRA as having two sets of adjustable controls. LoRA-FA locks one set and learns how to use the other. Because the first matrix is fixed, training can avoid storing some of the intermediate information required to update it. This can lower activation memory, the temporary memory used while calculating updates.
In plain language, stays fixed while learns the correction. For the same square-matrix example at rank 8, this leaves 8,000 trainable adapter values instead of 16,000. Total GPU memory is not necessarily halved, because the base model and other training data still occupy memory.
from peft.optimizers import create_lorafa_optimizer
model = get_peft_model(load_base(), config)
optimizer = create_lorafa_optimizer(
model=model, r=8, lora_alpha=16, lr=1e-4
)LoRA-FA uses a dedicated optimizer, so manually freezing alone is not an equivalent implementation. It is worth testing when temporary training memory is a problem, especially with larger adapter ranks.
4. QLoRA: compress the model, then train corrections
QLoRA combines LoRA with a compact representation of the original model.
A useful way to picture it is storing the large, unchanged part of the model in a compressed form while training the small corrections separately. The base weights are typically stored using 4-bit NF4 quantization, a method that represents each weight with much less storage than ordinary 16-bit or 32-bit formats. During calculations, the compressed values are reconstructed approximately at higher precision.
This means reconstruct the compressed original weights, then apply the LoRA correction. QLoRA reduces the memory needed to store the frozen base, although training still needs memory for the adapters, intermediate calculations and optimizer.
from transformers import BitsAndBytesConfig
from peft import prepare_model_for_kbit_training
quant = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16,
)
base = AutoModelForCausalLM.from_pretrained(
MODEL, quantization_config=quant, device_map={"": 0}
)
base = prepare_model_for_kbit_training(base)
model = get_peft_model(base, config)This example requires a compatible CUDA GPU with BF16 support. QLoRA is particularly useful when the original model would consume too much GPU memory at standard precision. Quantization can also introduce numerical differences, so performance must be measured rather than assumed.
5. TinyLoRA: learn only a handful of controls
TinyLoRA explores how few numbers training might need to change. Instead of learning full adapter matrices, it uses a very small trainable vector together with fixed mathematical projections.
Imagine several parts of a model connected to a small control panel. The connections are fixed, but adjusting the few controls can influence many parts at once. The number of values being learned becomes tiny; the pretrained model itself does not become tiny.
One component of the approach can be written as:
Here, each is a fixed projection, and training changes the values . The value specifies how many values this component learns.
from peft import TinyLoraConfig
model = get_peft_model(
load_base(),
TinyLoraConfig(
r=2, u=13, weight_tying=1.0,
target_modules=["q_proj", "v_proj"],
),
)
model.print_trainable_parameters()In a February 2026 preprint, the researchers reported 91% accuracy on GSM8K using 13 trained parameters to adapt a Qwen2.5 8B model for mathematical reasoning. That result used a particular reinforcement-learning procedure; it cannot be generalized to every model or task. Our short configuration illustrates the idea but does not reproduce the experiment.
6. Weight-space programming: test direct edits
Weight-space programming (WSP) investigates whether a reasoning agent can identify useful changes to the original weights without performing standard gradient-based training.
The idea is straightforward: inspect a model's errors, propose a small numerical edit, test the modified model, and keep the edit only when evidence supports it. Unlike LoRA, the proposed change acts directly on selected original weights.
This reads as edited weights = original weights + proposed changes. The difficult part is finding edits that genuinely improve performance rather than help a few test examples by chance.
model = load_base().eval()
weights = model.model.layers[0].mlp.down_proj.weight
with torch.no_grad():
original = weights[:8, :8].clone()
weights[:8, :8] *= 0.99 # Arbitrary illustration
# Evaluate the edited model on development data.
weights[:8, :8].copy_(original) # Restore originalThis example shows only the mechanics of modifying and restoring weights. It does not implement the paper's search procedure or demonstrate an improvement.
In a preprint published on 6 November 2026, researchers reported an instance where changing 1,023 parameters improved MATH-500 accuracy by 29.45 percentage points under their evaluation conditions. However, six of 16 editing trajectories retained the original weights because candidate improvements could not be validated reliably. WSP remains an experimental direction, not a dependable alternative to fine-tuning.
Comparing the six methods
| Method | What changes? | Why use it? | Main limitation |
|---|---|---|---|
| Full fine-tuning | All trainable original weights | Broad model adaptation | High training memory and storage cost |
| LoRA | Two small adapter matrices | Task-specific training with fewer parameters | Results depend on the adapters and task |
| LoRA-FA | One adapter matrix | Reduce temporary training memory | More restricted updates |
| QLoRA | LoRA adapters, with a compressed base | Fit larger models in GPU memory | Quantization and hardware requirements |
| TinyLoRA | A tiny set of learned values | Research on extremely small updates | Results are task- and training-dependent |
| WSP | Selected original weights | Explore targeted direct repairs | Early, inconsistent evidence |
There is no universal winner. The smallest number of trainable parameters does not guarantee the best model, the fastest training or the lowest total memory use.
A fair experiment starts from the same pretrained checkpoint and evaluates each method on examples kept separate from training. For our news-classification example, we would measure correct predictions, per-category performance, training time and peak GPU memory.
For ordinary task-specific adaptation, LoRA is a reasonable starting point. QLoRA is useful when storing the base model consumes too much GPU memory, while LoRA-FA addresses part of the memory needed during training. TinyLoRA and WSP are interesting to investigate, but their narrower research evidence warrants caution when applying them to new tasks.
Research sources
The explanations follow the original research and official implementation documentation reviewed for the 24 November 2026 version of this article. The established methods are LoRA (ICLR 2022), LoRA-FA (2023), and QLoRA (2023). Newer work includes TinyLoRA (February 2026 preprint) and WSP (November 2026 preprint). For implementation details, see Hugging Face PEFT, its TinyLoRA documentation, and Transformers' quantization guide.