LoRA Fine Tuning: QLoRA, Adapters and Evaluation

Learn how LoRA and QLoRA work, when to fine-tune, which hosted and GPU routes train adapters, and how to evaluate and serve them.

Published

LoRA Fine Tuning: QLoRA, Adapters and Evaluation

LoRA fine tuning is a good next step for repeatable style, format or task errors that survive a strong prompt baseline. It trains 2 small matrices per adapted weight matrix while keeping the original weights frozen; QLoRA also stores the frozen base in 4-bit precision. The useful outcome is a measured improvement on your task, with a serving plan that preserves it.

Documentation and deployment restrictions verified on 26 October 2026. The mechanisms come from the original LoRA paper and QLoRA paper.

For a builder, the decision starts with a recurring failure. A support model has the right policy in its context but keeps choosing the wrong escalation label. A writing assistant understands the brief but repeatedly ignores an established house style. Those are useful candidates. A model missing today's refund policy needs access to that policy before it needs training.

What Is LoRA Fine Tuning?

LoRA changes a model's behavior by learning a small correction to selected weight matrices. The original matrices remain frozen during ordinary LoRA training. A weight matrix is a table of learned numbers that transforms information inside the model; an adapter is the extra set of learned parameters that modifies that transformation.

Think of retrofitting a building with a fitted entrance module. You keep the structure and change how people pass through it. The module is smaller than the building, but it still depends on the building. Likewise, a LoRA adapter is neither a complete language model nor a replacement for its base.

The name means Low-Rank Adaptation. Instead of learning a full-sized update to a weight matrix, LoRA represents that update as the product of smaller matrices, usually called A and B. In a linear layer, the effective transformation can be written as W + sBA: frozen weights W plus a scaled adapter update. The input passes through the base path and the adapter path, and their outputs are added. Original LoRA formulation.

Architectural paths show frozen base computation in parallel with trainable matrices A and B, meeting at an add junction
LoRA adds a learned correction to the base computation. The frozen base still participates in every request.

This is why the adapter can learn a house format without saving a separately modified copy of every base weight. It is also why the base model must already be a plausible foundation for the task. The correction has to work with the model you chose.

A Parameter Example, Not a GPU-Memory Promise

Consider a hypothetical layer with 4,096 × 4,096 weights, or 16,777,216 original parameters. With rank 8, its LoRA matrices have 8 × 4,096 and 4,096 × 8 parameters. Together, that is 65,536 trainable parameters, about 0.39% of the original matrix's count.

That is our arithmetic using the paper's matrix shapes, not a benchmark or a recommended rank. It describes a single adapted matrix. The frozen weights remain present, and the run still needs working memory for intermediate computations, adapter gradients and optimizer state. Optimizer state is the bookkeeping used to decide the next training update.

The practical lesson is to separate how many parameters you update from how much memory the whole job needs. A tiny adapter does not make the underlying model tiny.

ComparisonWhat changesBuilder consequence
LoRA vs fine-tuningLoRA is a method of fine-tuning, within the broader familyThese are not mutually exclusive choices
LoRA vs full fine tuningOrdinary LoRA trains added low-rank matrices; full fine-tuning updates the base weightsCompare task quality and operational requirements before expanding the training scope
LoRA vs QLoRAQLoRA also quantizes the frozen base, storing its weights with fewer bitsLower base-weight memory can make a training setup feasible; runtime compatibility still matters

The distinction between the methods follows the LoRA and QLoRA papers. None of these labels guarantees a particular result on your data.

LoRA Fine-Tuning Explained: Rank, Targets and Scaling

The settings control the size and placement of the correction, not how intelligent the model becomes. Rank is the inner dimension of A and B: increasing it adds trainable parameters. Target modules specify which parts of the model receive adapters. Alpha scales the update, while dropout can regularize adapter training. The LoRA configuration reference defines these controls.

Start with the maintained recipe for your model, then change a setting because a validation result gives you a reason. If the model confuses two support categories, first inspect contradictory labels and missing boundary cases. Increasing rank cannot tell the model which contradictory example your business considers correct.

Also inspect what is trainable. Some configurations train additional modules, such as an output head, alongside the adapters. Calling a run “LoRA” does not establish that only A and B changed; the configuration does.

What QLoRA Adds, and What It Does Not

QLoRA addresses the memory occupied by the frozen base model as well as the number of parameters being trained. Its core setup stores the base in 4-bit form and trains higher-precision LoRA adapters through it. The base is frozen, but it still participates in the computation used to learn the adapter. QLoRA paper.

The paper combines NF4, a numeric representation designed for normally distributed weights; double quantization, which compresses the constants used in quantization; and paged optimizers, which manage memory spikes. You do not need to implement those mechanisms yourself to use a maintained QLoRA recipe.

“4-bit training” is an easy phrase to misread. It does not mean every calculation, activation and adapter parameter uses four bits. Nor does it mean a model can be trained in the same memory footprint as simply loading its quantized weights. Long examples and larger batches still consume working memory.

Choose QLoRA when the base model's memory footprint is the obstacle and the training stack supports the model you need. If ordinary LoRA already fits, compare the two on your validation cases instead of assuming that quantization is always the better choice. Compression changes the numerical setup; its effect on your task belongs in the evaluation.

Our LLM quantization guide explains the separate deployment question: which compressed representation your inference engine can execute. Training a QLoRA adapter does not make it compatible with every quantized serving format.

When Fine-Tuning Beats Prompting or RAG

Fine-tune when the remaining failure is stable behavior you can demonstrate with approved examples. Keep prompting when clear instructions already meet your requirement. Use retrieval-augmented generation, or RAG, to supply relevant documents or database facts at request time. The longer decision framework is in RAG vs fine tuning.

For house style, first try a concise style specification and representative examples in the prompt. Consider training when the desired behavior is settled and the same violations keep recurring across varied inputs. Your examples should teach decisions, such as leading with the answer or avoiding unsupported superlatives, rather than merely repeating a catchphrase.

For format, separate syntax from meaning. If your runtime supports constrained structured output, test it before training solely to obtain valid JSON. A response can obey the schema while selecting the wrong category. LoRA becomes more interesting when that semantic decision is the persistent problem. Keep application validation even after the adapter improves.

For a narrow task, define the decision boundary. A ticket about an unfamiliar charge might need account verification, while a confirmed duplicate payment needs billing review. Train approved input-output pairs showing that difference, including cases that require clarification. The payoff is a better repeatable decision, not a general claim that the model is smarter.

For changing knowledge, retrieval remains the cleaner source of truth. A style adapter should not be the authority for a product's current availability. You can combine retrieval and fine-tuning: retrieve the latest policy, then train the model to use supplied evidence and return the required response shape. Evaluate that combined application with the same retrieved context on both sides.

For builders, this means measuring the residual error before choosing a training stack. For operators, it means owning the approved examples and deciding which mistakes matter. For buyers, it means asking for the before-and-after scorecard and the exact deployable artifact, not accepting “custom model” as proof of improvement.

If a larger teacher model supplies training examples for a smaller model, that is also a model distillation workflow. LoRA describes which parameters the student updates; distillation describes where its training signal comes from. They can be used together, but generated targets still need review.

Choose a Hosted API or Your Own GPU

Choose the hosted route when its supported model, data handling and deployment options fit your application. Choose your own GPU when you need control over the checkpoint, training recipe and runtime, and can operate that stack. Make the serving choice before starting the training job.

Together AI: Explicit LoRA Training and Export

Together AI provides a hosted fine-tuning API whose quickstart explicitly launches a LoRA job. Its Python call, client.fine_tuning.create(), defaults to LoRA and can set lora=True explicitly. The workflow prepares conversational data, validates and uploads it, trains, then deploys the result. Together AI quickstart.

Together AI documentation for creating a hosted LoRA fine-tuning job
Together AI: hosted LoRA training

The wall is deployment eligibility. Training support is not the same as serverless availability, and the current guide serves fine-tuned models through dedicated model inference. Verify that your chosen base has a supported dedicated deployment before committing to it.

Export is a separate choice. Together documents checkpoint="adapter" for adapter-only weights and checkpoint="merged" for a combined base-and-adapter checkpoint. Use the adapter when your runtime will load it over the matching base; choose the merged artifact when you need a standalone model. Deployment and checkpoint types.

Fireworks AI: Check Training and Serving Separately

Fireworks AI documents LoRA in its managed supervised fine-tuning workflow. Supervised fine-tuning, or SFT, learns from examples of the desired response. For an explicit adapter job, its REST API uses loraRank; the Python SDK uses lora_rank. Fireworks SFT documentation.

Fireworks documentation showing supervised fine-tuning and LoRA settings
Fireworks AI: managed adapter training

The distinction to check is Tunable versus Supports Lora. A base can support an externally trained adapter for inference without supporting training on Fireworks itself. The training guide also accepts a separate evaluation_dataset, so you can supply validation examples instead of relying on its automatic split.

For serving, Fireworks documents live merge, which merges an adapter at deployment time, and multi-LoRA, which applies the selected adapter to a shared base. Its current deployment guide says trained LoRAs require on-demand dedicated deployments; serverless deployment is unsupported. It also says FP8 and FP4 deployment shapes do not support LoRA addons. A compressed deployment option is therefore not automatically an adapter-compatible option. Fireworks deployment guide.

LoRA for Fine Tuning: PEFT or Unsloth?

Hugging Face PEFT is the open library for parameter-efficient fine-tuning methods, including LoRA. Choose it when you want explicit control over the model, quantization configuration and adapter modules. Its quantization guide documents loading a quantized base, preparing it for training, then attaching the adapter.

Hugging Face PEFT documentation for quantized models and LoRA configuration
Hugging Face PEFT: explicit adapter configuration

The documented QLoRA path uses BitsAndBytesConfig with load_in_4bit=True, NF4 and double quantization; prepare_model_for_kbit_training() prepares the model before get_peft_model() wraps it. For QLoRA-style coverage of linear layers, the guide uses target_modules="all-linear". Treat that as a supported configuration pattern, not evidence that every architecture or downstream runtime accepts every adapter.

PEFT's wall is the rest of the training system: it does not choose your examples, correct your chat template or supply your product's success metric.

Unsloth is an open training toolkit with maintained fine-tuning guides and notebooks. Its guide documents LoRA, QLoRA and full fine-tuning, including load_in_4bit=True for the quantized route. Choose it when a maintained notebook matches your intended model and hardware, and use that notebook as the starting recipe. Unsloth fine-tuning guide.

Unsloth fine-tuning guide with model, dataset, training and deployment steps
Unsloth: a documented route from data to adapters

Unsloth's wall is recipe compatibility. A notebook that completes training is not proof that your exported model preserves the same behavior elsewhere. Keep the tokenizer, chat template and generation settings consistent, then evaluate the served artifact. A chat template is the formatting that marks user, assistant and other message roles for the model.

Hugging Face TRL supplies SFTTrainer, a supervised training loop that integrates with PEFT. It supports training and evaluation datasets, and assistant_only_loss=True with compatible chat templates to learn from assistant responses rather than every token in the conversation. Its wall is that the template must support the necessary assistant mask; inspect the rendered training examples. TRL SFTTrainer.

Hugging Face TRL documentation for SFTTrainer and assistant response loss
Hugging Face TRL: the supervised training loop

For an own-GPU experiment, the sequence is concrete: select the supported base and recipe, render a sample conversation, inspect which tokens receive training loss, attach the adapter, supply training and validation data, and save checkpoints. A checkpoint is a saved version you can evaluate or restore. Our broader how to fine-tune an LLM workflow covers the surrounding project decisions.

How Adapters Are Served and Swapped

An adapter must travel with its base-model identity and configuration. In PEFT, save_pretrained() saves adapter weights and adapter_config.json; those files do not replace the base weights. Keep the exact base revision, tokenizer, chat template and training configuration alongside the adapter. PEFT checkpoint format.

Keep adapters separate when several task variants need to share a base or when switching variants matters. PEFT's load_adapter() loads another named adapter, and set_adapter() selects it. Loading is not the same operation as activation. The disable_adapter() context manager allows inference with the base behavior. PEFT model API.

That distinction is useful for evaluation, but a shared application's adapter selection must also be concurrency-safe. Do not toggle one global model's active adapter while unrelated requests are running and assume each request will receive the intended behavior. Use a serving runtime with an explicit per-request routing contract.

vLLM is an inference engine that supports LoRA on compatible model implementations. Its server uses --enable-lora and --lora-modules to register adapters; requests select an adapter through the model field. Check the model's LoRA support, the maximum adapter rank and the configured simultaneous-adapter capacity. Those are serving constraints, not training settings. vLLM LoRA documentation.

vLLM documentation showing named LoRA adapters and per-request selection
vLLM: select a registered adapter per request

Runtime loading and unloading are also documented, but vLLM warns against using that capability in production unless the environment is isolated and fully trusted. For a routine deployment, registering known adapters at startup is a simpler operational choice.

Merge the adapter when you want a standalone model and do not need adapter switching in that artifact. PEFT's merge_and_unload() folds the update into the base and returns a model without PEFT adapter functionality. Some quantization configurations do not support merging. Keep the original adapter and base separately if you want to recover that workflow later. PEFT merging limitations.

Portability has a final catch: the matching base means the exact weights, not merely a familiar model-family name. Fireworks explicitly cautions that a vendor checkpoint used for training may differ from the public weights. Confirm that dependency before moving an adapter off-platform. Adapter export guidance.

Fine Tuning With LoRA: Evaluate Before and After

Ship only when the chosen adapter improves the target behavior on examples that did not influence its selection. A declining training loss means the model fits its training examples better; it is not a release criterion.

Use this evaluation protocol for the support-routing example. It is a recommended procedure, not a report of a training experiment.

  1. Write the acceptance rules before training

    Define the allowed labels, required output fields and escalation behavior. Decide which errors block release. For house style, write observable rules such as “state the answer before background” and “do not add unsupported claims.” A vague instruction to sound better cannot support a reliable comparison.

  2. Separate training, validation and final test cases

    Training cases update the adapter. Validation cases select the recipe and checkpoint. The final test stays sealed until those choices are fixed. Keep related tickets, paraphrases of the same document and near-duplicate examples in the same split. Otherwise the test can reward familiarity instead of generalization.

  3. Record a strong baseline

    Run the untuned base with the best practical prompt and any structured-output controls you intend to keep. For a retrieval application, record the retrieved evidence too. Save the model revision, prompt, template, generation settings, outputs and evaluator version. An adapter should beat your viable alternative, not a deliberately weak prompt.

  4. Select on validation, then compare on the sealed test

    Use validation results to choose the checkpoint and freeze the choice. Run that adapter and the baseline on the same final-test inputs with matched settings. If the intended application uses a shorter prompt after training, measure that separately from the controlled adapter comparison so the source of the improvement stays clear.

  5. Evaluate the artifact you will serve

    After merging, quantizing or switching inference engines, rerun the acceptance checks on the deployed artifact. Include long inputs, ambiguous requests and cases that should retain base behavior. Release only when the target improvement survives deployment and the regression checks remain acceptable.

The base and adapted model receive matching held-out cases and their outputs meet at the same evaluation rubric
A fair before-and-after comparison uses the same held-out inputs and scoring rules. This illustration reports no measured result.

Keep syntax, task correctness and style as separate scores. For the support model, a clean JSON object with the wrong escalation decision is still wrong. For the writing model, a more polished answer that invents a product claim is a regression.

CheckHow to score itFailure to catch
Output contractParse the response; validate required fields and allowed valuesValid JSON with a missing category
Task decisionCompare labels with reviewed targets; inspect precision and recall by categoryCommon tickets improve while rare escalations fail
House styleBlind review against a written rubric; use deterministic checks where possiblePreferred tone hides a changed meaning
Regression behaviorScore unchanged tasks, ambiguous inputs and abstention cases separatelyAdapter answers confidently when it should ask for evidence

Report denominators and category-level results, not just an overall success percentage. Precision asks how often a predicted category is correct; recall asks how many true cases of that category the model catches. If most examples are routine billing questions, the headline average can hide failures on a small but consequential escalation class. Include successes that became failures as well as failures that became successes.

For subjective style review, hide which output came from which model and vary presentation order. A model-based judge can help organize review, but check its decisions against human judgments before using its score as the release gate. The rubric, not the fluency of the judge's explanation, determines whether it is useful.

Do not turn the final test into a second validation set. Once you inspect its failures and use them to change the recipe, those cases have influenced development. Keep them as regression cases, and reserve new untouched cases for the next final comparison. There is no universal dataset-size rule here: the question is whether the evaluation represents the decisions your application will encounter.

Finally, compare the deployed system's latency and resource use under the workload it will face. LoRA's parameter savings do not establish an inference speedup. Keep the base-and-adapter version that passed, preserve a rollback target, and monitor the same error categories after release.

What Is Overhyped About LoRA?

“Cheap fine-tuning” describes a narrower optimization than “cheap customization.” You still need approved examples, evaluation, serving and maintenance. Neither a smaller checkpoint nor a successful training log proves that the application improved.

Frozen weights do not mean frozen behavior. The adapter deliberately changes the model's outputs, so general ability, refusal behavior and response quality still need regression checks. Removing the adapter can restore the base path; leaving it active does not guarantee unchanged answers elsewhere.

LoRA is not guaranteed to equal full fine-tuning. The original paper reports strong results on its evaluated tasks. That is evidence for the method, not a universal equivalence theorem. If a well-evaluated adapter still misses the requirement, investigate the data, base model and task before assuming a larger training job is the answer.

There is no universal magic rank, example count or GPU-hour estimate. Model architecture, sequence length, target modules and the actual task change the experiment. Start from a documented recipe and let validation justify the next change.

LoRA Fine-Tuning FAQ

What is fine-tuning with LoRA?

It is training added low-rank matrices while keeping the original base weights frozen. The learned adapter modifies the base computation and needs that base model for inference unless the weights are merged.

Has fine-tuning been debunked?

No blanket verdict follows from a failed experiment or a benchmark. For your application, compare the strongest practical prompt baseline with the trained model on held-out cases. If it does not improve the required behavior, do not ship it.

How expensive is fine-tuning?

It depends on the model, data processed, training recipe and serving arrangement. LoRA reduces trainable parameters, but does not remove data preparation, evaluation or hosting. Choose a supported training-and-serving path before consulting its current published rates; there is no useful universal job price.

What is an example of fine-tuning?

Training on approved support messages paired with the correct category, escalation action and response format. The examples teach a recurring decision pattern; current customer records still need to be supplied at request time.

Is fine-tuning still a thing?

Yes. Together AI, Fireworks AI, Hugging Face PEFT and Unsloth document current training routes. Whether it is the right choice depends on the failure that remains after prompting and, where needed, retrieval.

How can I do fine-tuning?

Define a task metric, establish a baseline, prepare separate training and evaluation data, choose a supported model and recipe, train, select using validation, then compare on a sealed test before deploying. Verify the deployed artifact too.

What is peft and lora?

PEFT means parameter-efficient fine-tuning, a family of methods that trains a limited set of parameters. Hugging Face PEFT is also a library implementing those methods. LoRA is one method within that family.

Which models allow fine-tuning?

Use the exact supported-model list for your hosted provider or open training stack, together with the model's license. Training support, adapter-serving support and availability of the base weights are separate checks. A family name alone is insufficient.

What's another word for fine-tuning?

In this context, task adaptation or continued training on targeted examples. Prompt engineering changes the instructions supplied at inference time; fine-tuning changes learned parameters.

Your Next Build Step

Next week, take a recurring failure from the application you already operate and turn it into an explicit acceptance test. Collect approved examples, separate related cases before splitting the data, and measure the best prompt baseline. If that baseline fails on a stable behavior, choose a documented LoRA route whose output you can serve. Train only after those decisions are clear.

For practical guides to building and evaluating AI systems, join the newsletter.

Published
Category
Build
Related Articles
LangChain Alternatives in 2026: LangGraph, LlamaIndex, Pydantic AI and More (Compared)

LangChain Alternatives in 2026: LangGraph, LlamaIndex, Pydantic AI and More (Compared)

Compare LangGraph, LlamaIndex, Pydantic AI and six more LangChain alternatives by language, models, licence and the problem each solves.Oct 26, 2026Build
LLM vs SLM: Which Model Fits Your Feature?

LLM vs SLM: Which Model Fits Your Feature?

Choose large or small language models by task. Compare current model families, deployment limits and a routing example for production features.Oct 26, 2026Build
Model Distillation: Teacher to Student for Production LLMs

Model Distillation: Teacher to Student for Production LLMs

When to distill a narrow LLM task, which managed routes are available, what output-training terms allow, and how to evaluate before switching traffic.Oct 26, 2026Build
Vision Language Models: What Builders Can Trust

Vision Language Models: What Builders Can Trust

What vision language models can read, where they fail, and how to choose API or self-hosted models with a test plan for your own images.Oct 26, 2026Build
Multi Agent Systems: When One Agent Beats a Team

Multi Agent Systems: When One Agent Beats a Team

When should you split one LLM agent into several? Compare supervisors, hierarchies, handoffs and group chat, with a task-based decision table.Oct 26, 2026Build
Prompt Injection: Direct and Indirect Attacks in AI Agents

Prompt Injection: Direct and Indirect Attacks in AI Agents

Understand direct and indirect prompt injection, how agents expose business data, and the safeguards to use before connecting an inbox or CRM.Oct 26, 2026Build
GraphRAG: How It Works and When to Use It

GraphRAG: How It Works and When to Use It

How Microsoft GraphRAG answers questions across documents, what drives indexing work, and when to use it instead of vector, hybrid or agentic RAG.Oct 26, 2026Build
AI Agent Architecture: The Production Map

AI Agent Architecture: The Production Map

Map the model, tools, memory, orchestration, approvals and evaluation behind a production AI agent, with a support workflow and buy-versus-build decisions.Oct 25, 2026Build
Newsletter

One letter, every Sunday.Working systems, not hot takes.

Weekly. No spam. Unsubscribe anytime.