I fine-tuned Gemma 4 E4B with LoRA on a DGX Spark to extract facts from news stories in Spanish. Its model card states 4.5 billion effective parameters, 8 billion counting embeddings. On 200 stories the model had never seen, it went from 4.5% to 42.5% perfect records. A Llama 3.3 70B, from the previous generation, fine-tuned in the cloud with the same recipe and the same data scored 48.0%. With 200 stories, that difference cannot be told apart from chance, though it does not prove the two are equal either.
This piece explains how it was measured, why I repeated the whole comparison before publishing it, what those 5.5 points mean and what failed along the way.
A BBC Mundo news story of 400 to 2,500 characters goes in. A JSON with six fields comes out: story type, date, normalized figures, people, organizations and places.
{"tipo": "sociedad",
"fecha": null,
"cifras": [{"valor": 25, "unidad": "anios"}, {"valor": 5, "unidad": "otro"},
{"valor": 50, "unidad": "otro"}, {"valor": 18, "unidad": "otro"}],
"personas": ["Stephanie Sautner", "Lindsay Lohan"],
"organizaciones": ["Disney"],
"lugares": []}
I chose a fixed output because each field is right or wrong with no need for human judges. The rules are strict: figures in digits with a unit from a list of ten, names without titles, a date only if the text gives day, month and year, and no text around the JSON.
The main metric is exact match: all six fields correct at once. Entity lists are compared as normalized sets (lowercase, no accents) and figures as value and unit pairs. Every percentage carries its 95% Wilson interval.
The stories come from XL-Sum in Spanish, a public dataset of BBC Mundo articles with 38,110 in the training split and 4,763 in the test split. I used only the text. XL-Sum is by Hasan et al. (Findings of ACL-IJCNLP 2021) and is distributed under the CC BY-NC-SA 4.0 license.
Before labeling anything I set aside 200 stories from the test split and fixed the sha256 hash of their ids, joined with newlines in file order and encoded in UTF-8: acbfabe30e5158c9520893568e37279b581bc3cfcf948fe137ba371e3437ba6b. None of them entered training. I learned that discipline as a judge at the NVIDIA Seattle Hackathon, as an NVIDIA Developer Champion, from a team that froze its test set by id before preparing data.
Claude Opus 5.5 filled in the reference records following a two-page instruction sheet. The 200 test stories were labeled at high effort and the training ones at medium effort. I planned 3,200 examples and ended up with 2,551, because I hit the monthly API limit in the middle of the night: 2,487 for training and 64 for validation.
Then I asked Opus to label the 200 test stories again. Against its own labels it scored 63.5%. That number is the judge's self-consistency: how often two passes by the teacher agree on the full record. It is not a ceiling. A student that learns the teacher's most frequent answer can match or exceed that figure, because training on thousands of labels averages out the teacher's noise. It works as a reference: no result should be read against 100, because not even the teacher agrees with itself more than 63.5% of the time.
The rivals were Claude Haiku 5.5 and Sonnet 5.5 with the full instruction sheet in the prompt. The fine-tuned student only receives the record schema.
I set a rule before spending GPU: if the model without fine-tuning came close to that 63.5%, I would not train.
Gemma 4 E4B without fine-tuning scored 4.5%, with valid JSON in 62% of cases. It wrapped the answer in markdown, invented units outside the list and left figures as text. Those are exactly the rules that training teaches.
To rule out a prompt effect, I repeated the measurement giving it the full instruction sheet, the same as Haiku and Sonnet. Valid JSON rose to 86% and perfect records stayed at 5.5%. The instruction sheet improved the format and barely moved the extraction.
Before you fine-tune, know whether fine-tuning is worth it. That answer comes from measuring the base model, not from intuition.
generate and not from an optimized runtime.A loss of 0.023 is equivalent to the correct token having a 97.7% probability as a geometric mean. It sounds perfect, but a record has more than a hundred tokens and all of them have to come out right. That is why I count perfect records and not tokens.
The first version of this article compared Gemma with three models that had not been trained the same way. The 8B and 70B Llama models were fine-tuned on Nebius Token Factory, a service that chose its own steps: 3 epochs in 66 optimizer steps, against 2 epochs in 622 steps on the Spark. The 70B was also evaluated quantized to 4 bits. And Nemotron Nano had only one epoch.
With those differences there was no way to know whether the model or the recipe was winning. We could not settle for those results, so I repeated everything with the same script, the same data, the same seed and the same 622 steps:
All four runs use the same training file and the same versions of PyTorch, transformers and peft. The results from the service stay in the second table as a reference, marked as a different recipe.
Evaluation is the same for all of them: greedy decoding, up to 400 new tokens and one story at a time. Nemotron Nano is a reasoning model. I did not pass a system prompt: its tokenizer's chat template inserts detailed thinking off when there is no system message. I checked it by printing the rendered prompt, and that is how it was trained and evaluated. Its 200 outputs had no reasoning blocks and no empty answers.
If you compare models, run them all with the same recipe. Otherwise you do not know whether you are measuring the model or the training.
Accuracy on the same 200 stories, with the same evaluation script. First, the four models fine-tuned with the same recipe:
| Model + LoRA, same recipe | Parameters (billions) | Valid JSON | Exact 6/6 [95% CI] | Figures | Organizations | Places |
|---|---|---|---|---|---|---|
| Llama-3.1-Nemotron-Nano-4B-v1.1 (Spark) | 4.5 | 99.5% | 26.0% [20.4, 32.5] | 67.5% | 58.5% | 77.0% |
| Gemma 4 E4B (Spark) | 8.0 | 100.0% | 42.5% [35.9, 49.4] | 79.0% | 71.5% | 90.0% |
| Llama 3.1 8B (Spark) | 8.0 | 100.0% | 43.0% [36.3, 49.9] | 80.0% | 72.5% | 89.0% |
| Llama 3.3 70B (cloud, bf16) | 70.6 | 100.0% | 48.0% [41.2, 54.9] | 81.0% | 77.5% | 86.0% |
Then, the references: the model without fine-tuning, the general models with the instruction sheet in the prompt, the two runs from the service and the judge's self-consistency.
| Reference | Valid JSON | Exact 6/6 [95% CI] | Figures | Organizations | Places |
|---|---|---|---|---|---|
| Gemma 4 E4B, no fine-tuning, schema only | 62.0% | 4.5% [2.4, 8.3] | 35.0% | 25.0% | 28.0% |
| Gemma 4 E4B, no fine-tuning + instruction sheet | 86.0% | 5.5% [3.1, 9.6] | 43.0% | 32.0% | 39.5% |
| Claude Haiku 5.5 + instruction sheet | 100.0% | 28.0% [22.2, 34.6] | 70.0% | 57.0% | 76.0% |
| Claude Sonnet 5.5 + instruction sheet | 99.0% | 24.0% [18.6, 30.4] | 65.5% | 54.5% | 72.5% |
| Nemotron 3 Super 120B + instruction sheet, reasoning off | 82.0% | 5.0% [2.7, 9.0] | 43.0% | 30.5% | 41.5% |
| Nemotron 3 Super 120B + instruction sheet, reasoning on | 98.0% | 13.0% [9.0, 18.4] | 53.0% | 43.0% | 66.0% |
| Llama 3.1 8B + LoRA (service, different recipe) | 100.0% | 39.5% [33.0, 46.4] | 79.5% | 69.0% | 83.5% |
| Llama 3.3 70B + LoRA (service, different recipe, 4-bit) | 100.0% | 44.0% [37.3, 50.9] | 80.0% | 74.0% | 85.0% |
| Claude Opus 5.5 against itself (self-consistency) | 100.0% | 63.5% [56.6, 69.9] | 86.5% | 82.5% | 94.0% |
At inference on the Spark, with transformers generate and no optimized runtime, batching is what matters most. One story at a time, the fine-tuned Gemma took 7.6 seconds per story: about 96 output tokens at 12.7 tokens per second. With the adapter merged into the base model it rose to 14.4 tokens per second, and in batches of 8 it reached 62.8, which is 1.5 seconds per story. Llama 3.1 8B went from 11.7 to 44.0 tokens per second with the same changes. With the adapter merged and in batches of 8, accuracy moved by two records, within noise: Gemma 83 perfect out of 200 instead of 85, and Llama 3.1 8B 84 instead of 86. I do not report the speed of the 70B: I measured it one story at a time on the rented GPU, and that figure says nothing about the machine.
Four readings:
Unified memory belongs to everyone. At midnight another service on the machine loaded a 57 GB model and the OOM killer ended the training at step 522, with no checkpoint. setsid does not protect you, because it changes the session and not the cgroup. The fix was to save a checkpoint every 100 steps and leave the machine alone while it trains. Launching with systemd-run --user --scope gives the training its own cgroup, but does not protect it from the OOM killer on its own; that takes limiting the other service's memory.
An adapter can load silently and wrong. The adapters downloaded from the cloud came with keys missing the base_model.model. prefix that peft expects. They loaded without error, with random weights, and generated garbage. After rewriting the keys, the output was valid JSON. It pays to try three texts and read the output before evaluating two hundred.
The 70B only fit pre-quantized. Loading the base in bf16 (132 GiB) to quantize it on the fly died for lack of RAM. With a base already quantized to 4 bits (37 GB) it loaded in five minutes. For the run with the same recipe I rented a 288 GB (268 GiB) GPU, where it fits in full.
The cloud does not always have the GPU. The first two regions where I requested the machine had no B300 available. It started in the third.
A low token limit truncates models that reason. On the first attempt, Nemotron Super returned 73 empty answers out of 200 because the reasoning used up the output limit. The figure in the table is with reasoning on, 8,000 output tokens, temperature 0 and the instruction sheet as the system prompt, served through an API. With reasoning off and 4,000 tokens it scored 5.0%, level with Gemma 4 E4B without fine-tuning and the same instruction sheet (5.5%). I did not optimize that path: it is a single configuration, and 18% of its answers were not valid JSON. The limit differs between the two rows because without reasoning a record takes about 100 tokens and 4,000 is more than enough.
You pay for the labels once. The fine-tuned model runs locally, with no cost per call and without the texts leaving the machine.