﻿# Qwen CPU LoRA on Banking77: what the small run measures

A Qwen Banking77 LoRA smoke run improves stored scores, with important limits from sample size, label matching and macro-F1 calculation.

Author: Retrivium editorial team
Updated: 2026-11-05
Canonical URL: https://retrivium.ai/journal/qwen-half-billion-cpu-lora-banking77-smoke-run/
Language: en

A small CPU-oriented LoRA repository provides a useful, limited example of task adaptation: Qwen2.5-0.5B-Instruct is trained to output Banking77 intent names. Its published improvement is measurable, but understanding the data sampling and label parser is essential before interpreting the result.

## A deliberately small reported comparison

The [experiment repository](https://github.com/s-wasim/LoRA-Fine-Tuning) describes a smoke run with 300 training examples, 1 epoch and 100 evaluation examples. The committed [metrics artifact](https://github.com/s-wasim/LoRA-Fine-Tuning/blob/main/artifacts/metrics.json) records accuracy changing from 0.28 to 0.36 and macro-F1 from approximately 0.1511 to 0.2088. These are author-published results, not measurements reproduced here.

The result supports a narrow claim: the stored task scores improved in this configuration. It does not establish a strong Banking77 classifier or a general advantage of CPU training. No associated RAM trace, processor specification or training duration is supplied for turning it into a hardware capacity estimate.

## Configuration and sampling define the experiment

The [configuration file](https://github.com/s-wasim/LoRA-Fine-Tuning/blob/main/configs/banking77_qwen0.5b.yaml) selects float32, LoRA rank 8, alpha 16, dropout 0.05 and attention projection targets. The configured maximum sequence length is 512. A prompt requests an intent label rather than an open-ended banking answer. Consequently, this is a constrained classification adaptation, not evidence of reliable financial advice.

The [data implementation](https://github.com/s-wasim/LoRA-Fine-Tuning/blob/main/src/data.py) removes duplicate text within each split, shuffles with seed 42 and then takes the configured sample count. Training comes from the dataset's training split; evaluation comes from its test split. This is not a documented stratified selection guaranteeing representation of every intent. Deduplication is performed separately within splits, rather than an explicit cross-split overlap audit.

## The parser participates in the score

The [inference implementation](https://github.com/s-wasim/LoRA-Fine-Tuning/blob/main/src/infer.py) generates deterministically with a 16-token output limit. It first normalizes the answer and checks for an exact normalized label. If that fails, it searches label words for the greatest positive set overlap; otherwise it returns an unmatched marker.

Thus the reported metric evaluates the model together with this matching rule. A response can receive a recognized intent without printing the exact requested label. This is a reasonable implementation choice to document, but strict-format accuracy and parser-assisted classification accuracy answer different questions. Preserving raw generations would reveal how often matching changes the outcome.

## Macro-F1 has a specific denominator

The [evaluation code](https://github.com/s-wasim/LoRA-Fine-Tuning/blob/main/src/evaluate.py) compares the original checkpoint and the merged directory on the same selected evaluation data. It explicitly passes the complete label list to macro-F1 and sets undefined values to zero. The [dataset card](https://huggingface.co/datasets/legacy-datasets/banking77) identifies 77 fine-grained intents.

With only 100 evaluation examples, class coverage deserves inspection. A label absent from both reference and prediction contributes zero under the implemented rule, rather than disappearing from the average. Comparisons with another report therefore require matching both the sample and metric convention; the macro-F1 number alone does not describe the class distribution.

## A useful baseline with clear next questions

The [LoRA memory guide](/journal/lora-qlora-memory/) explains why float format and trainable adapters do not determine complete memory use. The [benchmarking guide](/journal/inference-benchmark-method/) explains why implementation conditions belong beside scores.

A stronger follow-up would retain the selected example identifiers, raw outputs, per-class support and parser decisions, then repeat training on declared seeds and evaluate a larger untouched test set. Those checks would distinguish a repeatable adaptation gain from sensitivity to a small sample. The repository's best-effort deployment exports remain separate from the demonstrated classification comparison.
