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.

Python
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:

Wt+1=Wt−η∇WLW_{t+1} = W_t - \eta\nabla_W L

Read this as: new weights = current weights − a calculated adjustment. Here, LL measures the error and η\eta controls the adjustment size. The code uses AdamW, which has a more detailed update rule.

Python
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, AA and BB:

Weffective=W+αrBAW_{\mathrm{effective}} = W + \frac{\alpha}{r}BA

The formula says: use the original weights plus a learned correction. The rank rr controls the size of the correction matrices, and α\alpha sets their scale. For a single 1,000×1,0001{,}000\times1{,}000 matrix, a rank-8 LoRA correction trains 16,000 values instead of the original million.

Python
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, AA and BB. LoRA-FA fixes AA and trains only BB.

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.

Weffective=W+αrBtrainableAfrozenW_{\mathrm{effective}} = W + \frac{\alpha}{r}B_{\mathrm{trainable}}A_{\mathrm{frozen}}

In plain language, AA stays fixed while BB 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.

Python
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 AA 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.

Weffective≈Dequant⁡(QNF4(W))+αrBAW_{\mathrm{effective}} \approx \operatorname{Dequant}(Q_{\mathrm{NF4}}(W)) + \frac{\alpha}{r}BA

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.

Python
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:

R=∑i=1uviPiR = \sum_{i=1}^{u} v_iP_i

Here, each PiP_i is a fixed projection, and training changes the values viv_i. The value uu specifies how many values this component learns.

Python
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.

Wedited=W+ΔWproposedW_{\mathrm{edited}} = W + \Delta W_{\mathrm{proposed}}

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.

Python
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 original

This 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

MethodWhat changes?Why use it?Main limitation
Full fine-tuningAll trainable original weightsBroad model adaptationHigh training memory and storage cost
LoRATwo small adapter matricesTask-specific training with fewer parametersResults depend on the adapters and task
LoRA-FAOne adapter matrixReduce temporary training memoryMore restricted updates
QLoRALoRA adapters, with a compressed baseFit larger models in GPU memoryQuantization and hardware requirements
TinyLoRAA tiny set of learned valuesResearch on extremely small updatesResults are task- and training-dependent
WSPSelected original weightsExplore targeted direct repairsEarly, inconsistent evidence
What changes in each method?
Full fine-tuning
Train the original model weights.
LoRA
Freeze the base. Train both low-rank adapter matrices, A and B.
LoRA-FA
Keep the base and the down-projection A fixed. Train only the up-projection B.
QLoRA
Store the frozen base in 4-bit form. Train the higher-precision adapters A and B.
TinyLoRA
Train a small vector v through fixed projections P. The article’s example shares v across target modules.
Weight-space programming
Write edits directly into selected original weights. The other weights stay fixed.
FrozenTrainableFrozen · 4-bit quantizedDirectly edited
Each grid represents the base weights. Symbols show parameter roles only. Their size and number do not measure parameter counts or memory use.

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.