﻿# CPU LoRA for Qwen2.5-1.5B: what the published notebook actually measures

Inspect a CPU medical-QA LoRA case through its saved training logs, float32 recipe, runtime and small ROUGE check, with clear limits on RAM and model quality.

Author: Retrivium editorial team
Updated: 2026-11-05
Canonical URL: https://retrivium.ai/journal/qwen-cpu-lora-notebook-runtime-memory-evaluation-boundaries/
Language: en

A public CPU LoRA project for Qwen2.5-1.5B-Instruct contains more evidence than a recipe alone: the author's notebooks retain training metrics and generated outputs. They demonstrate a completed adaptation workflow under the recorded software environment. They do not provide a measured peak-memory trace or a clinically validated assistant. This distinction matters when interpreting the repository's modest hardware target.

## Read the executed record beside the defaults

The [original repository](https://github.com/JaberQezelbash/finetune-Qwen2.5-1.5B-Instruct) targets an 8 GB RAM environment. Its training code explicitly loads float32 weights, disables mixed-precision flags, enables gradient checkpointing and uses small batches with accumulation. This is ordinary adapter training over an unquantized base, rather than a quantized-base recipe. The [LoRA memory guide](/journal/lora-qlora-memory/) explains why reducing trainable parameters does not remove weight and activation storage.

Defaults include a sequence limit of 512, per-device batch size 1, accumulation 16 and adapter rank 8. Attention and feed-forward projection names are detected from the loaded architecture. The saved output identifies PyTorch 2.10.0+cpu and Transformers 5.1.0. These are evidence about this execution, not a guarantee that every supported library version behaves identically.

## A small adapter still takes substantial time

The [training notebook](https://github.com/JaberQezelbash/finetune-Qwen2.5-1.5B-Instruct/blob/main/codes/finetune_qwen25_medqa_cpu.ipynb) reports 9,232,384 trainable parameters, or 0.5945% of its total. Its recorded training runtime exceeds 3 days for the completed epoch, with train loss 1.0867 and evaluation loss 1.093. These are author-retained notebook outputs, not measurements independently repeated here.

Neither that low trainable fraction nor successful completion proves an 8 GB resident-memory ceiling. The published record lacks a corresponding peak-RAM trace and sufficiently identified CPU configuration for a hardware-normalized comparison. Evaluation, model loading and optional adapter merging also have separate costs. The optional merge branch loads another base model; the training-only target should not silently become a promise about every artifact-export path.

## Formatting defines what receives supervision

Questions, question types and answers come from a medical-question CSV. The code constructs a system-and-user prompt with the model's chat template, adds the answer, and masks prompt labels so loss concerns the assistant response. It truncates the combined example to the configured limit. A long prompt can therefore leave little supervised answer text; a low aggregate loss does not show that every source answer survived preprocessing.

The [official Qwen model card](https://huggingface.co/Qwen/Qwen2.5-1.5B-Instruct) documents the underlying instruction model and chat-template usage. That upstream identity should stay attached to the saved adapter and tokenizer. An adapter folder is a dependency on the matching base, unless a separate merged checkpoint has actually been produced and checked.

## Interpret the evaluation as a sanity check

The [evaluation notebook](https://github.com/JaberQezelbash/finetune-Qwen2.5-1.5B-Instruct/blob/main/codes/inference_and_eval.ipynb) compares adapter-enabled and adapter-disabled generation without loading a separate full base copy. It also reports mean ROUGE-L F1 of 0.292 on 15 sampled training examples and 0.214 on 15 evaluation examples. This is a small lexical-overlap diagnostic, not a measurement of clinical accuracy or a statistically established improvement over the base model.

The repository's safety-oriented prompt is an input instruction, not evidence that generated medical claims are correct. A useful continuation would preserve the split, inspect truncation and evaluate base and adapted outputs on the same independently reviewed questions. The [bounded LoRA experiment guide](/journal/peft-lora-gpu-budget/) provides the broader framework for recording complete-step memory, time, saving and held-out outcomes. This case contributes an actual execution record while leaving those unmeasured boundaries explicit.
