Pi Svelte Agent V4 training report

What happened during a one-epoch QLoRA run on Nemotron Cascade 8B, what the measurements mean, and where the resulting coding agent improved or still failed.

Morningstar · NVIDIA GeForce RTX 5090 · completed July 24, 2026

Training time
170.2 min
443 optimizer steps
Validation loss
0.1030
Down 94.5%
Token accuracy
96.96%
Up 31.78 points
Pi agent tasks
1 / 3
Base passed 0 / 3
The short version

The adapter learned the training format extremely well and became much better at modern Svelte conventions and valid tool arguments. It did not yet become a consistently good autonomous coding agent: one real Pi loop passed, two failed, strict raw-code quality stayed at 0/10, and the blinded head-to-head review was split.

Outcome

This was a full one-epoch supervised fine-tuning run. “Supervised” means the model was repeatedly shown an input and the desired next assistant action, then adjusted to make that desired output more likely. The run completed without out-of-memory errors, numerical instability, truncation, or checkpoint recovery.

Concise before-and-after results
Signal Before After V4 What changed
Held-out loss 1.8875 0.1030 94.5% lower
Held-out token accuracy 65.18% 96.96% +31.78 points
Pi tool-loop tasks 0 / 3 1 / 3 One new pass
Strict static-clean answers 0 / 10 0 / 10 No gate change
Compiler-clean answers 3 / 10 5 / 10 +2 answers
Modern-Svelte policy clean 1 / 10 6 / 10 +5 answers
Standalone quality rubric 1.58 / 5 1.57 / 5 Essentially flat

What the model trained on

The V4 export contains coding-agent trajectories rather than only final snippets. A trajectory records the sequence an agent should follow: inspect a file, make a change, run validation, respond to failures, and finish only after checking the real result. That makes it possible to teach both code and workflow.

Training examples
3,543 assistant actions
Validation examples
377 assistant actions kept out of training
Source trajectories
1,118 complete coding-agent trajectories
Action coverage
566 reads, 566 edits, 552 writes, 1,118 validation phases, and 1,118 final responses
Sequence lengths
1,393 minimum; 4,868 median; 8,519 at the 95th percentile; 12,195 maximum
Training ceiling
16,384 tokens, with zero oversized or truncated rows
Why zero truncation matters

If a long example is cut off, the model may see “run validation” without the result, or an error without the repair. Every V4 example fit under the token ceiling, so each supervision target remained intact.

How QLoRA works

The base model has about 8.28 billion parameters. Updating all of them would require much more GPU memory. QLoRA keeps the base weights frozen and stores them in a compact 4-bit form, then trains small low-rank adapter matrices alongside selected layers. At inference time, the adapter steers the frozen base model toward the new behavior.

QLoRA data flow Training examples update a small adapter while the quantized base model remains frozen. Base plus adapter produce the V4 model behavior. Training examples prompt + target action Frozen 4-bit base 8.28B parameters Trainable adapter 87.3M parameters V4 behavior base + adapter
Only about 1.05% of the model parameters were trainable. This makes the run practical on one 32 GB GPU while preserving the original model as a reusable base.
Adapter versus a new full model

The 167 MB adapter is not a standalone 8B model. It must be loaded with the exact Nemotron Cascade base revision used for training. Different adapters can share that same base.

The training recipe, translated

Training settings and why they matter
Setting Value Plain-language meaning
Epochs1The trainer made one pass over all 3,543 training examples.
Quantization4-bit NF4 + double quantizationThe frozen base weights used a memory-efficient representation designed for normally distributed neural weights.
Compute typebfloat16Math used a wider-range 16-bit format that is generally stable for modern training.
LoRA rank32Each adapter update is represented through a compact 32-dimensional bottleneck.
LoRA alpha64This scales the adapter contribution; with rank 32, the nominal scale is 64/32 = 2.
Dropout0.05Five percent of adapter activations are randomly omitted during training to reduce memorization.
Batch size1 × 8 accumulatedOne long example fits at a time; gradients from eight examples are combined before each optimizer update.
Learning rate0.0001 with decayUpdates start larger, then become progressively smaller so the run settles near the end.
Loss maskCompletion onlyThe prompt provides context, but the penalty applies to the assistant action the model is supposed to produce.
Seed42Fixes controllable randomness so reruns are easier to compare.

What happened during training

The trainer measured the 377 held-out examples before the first update and after every 50 steps, plus once at the end. Held-out measurements matter because those examples were not used to update the adapter.

Validation loss by optimizer step Validation loss dropped from 1.8875 at step zero to 0.1357 at step 50, then gradually improved to 0.1030 at step 443. The vertical axis is logarithmic. 2.0 0.5 0.1 0 200 443 steps
Validation loss, logarithmic scale. The dramatic first 50-step drop means the adapter quickly learned the expected action format. Later gains are smaller but remain stable; the slight step-200 bump is normal noise.
Validation token accuracy by optimizer step Token accuracy rose from 65.18 percent before training to 96.22 percent at step 50 and 96.96 percent at the end. 98% 84% 64% 0 200 443 steps
Held-out token accuracy. This is the percentage of target tokens predicted correctly under teacher forcing. It is useful for learning progress, but it is easier than autonomously completing a whole coding task.

Behavior-level evaluation

Real Pi coding-agent loops

Both models ran through Pi 0.79.10 with the same read, bash, edit, and write tools. Each final file was independently checked after the model stopped, so a confident final message could not substitute for a real pass.

Three controlled Pi coding-agent tasks
TaskBaseV4Observed behavior
Read, exact edit, validateFailPassV4 used read → edit → bash, then inspected two clean validator results.
Recover after injected failureFailFailV4 diagnosed the missing button type but malformed its follow-up edit tool call.
Create and validate componentFailFailV4 wrote, checked, and attempted repairs, but left an invalid CSS value.

Ten-prompt raw component suite

The strict “static-clean” result is 0/10 for both models because every answer had at least one failure across output shape, modern-Svelte policy, parsing, type checking, or automated best-practice review. The subchecks show that V4 still moved in the desired direction.

Raw-code subcheck passes out of ten V4 improved output-shape clean from one to six, modern-Svelte policy clean from one to six, compiler clean from three to five, type-check clean from one to two, and autofixer clean from one to three. Base V4 Output shapeModern policy CompilerType check Autofixer 16 16 35 12 13 0 5 10 passes
Subcheck successes out of ten. V4’s biggest gain is conformity to the requested modern-Svelte and raw-output format. The all-or-nothing static gate remains unmet.

Blinded pairwise review

Claude Fable compared base and V4 on each prompt twice, reversing which answer appeared first. The stable verdicts split 4–4. Two prompts were order-sensitive, meaning the judge preferred whichever candidate appeared in a particular position; those were excluded from the win counts.

Base wins
4
Stable across order
V4 wins
4
Stable across order
Order-sensitive
2
No reliable verdict

How to interpret the result

Low loss is necessary, not sufficient

A model can accurately imitate the next token when shown a correct trajectory yet still drift when it must generate many steps, consume tool results, recover from an error, and decide when to stop. Small mistakes compound in an autonomous loop.

What clearly improved

  • The held-out imitation objective improved dramatically and remained stable through the end of the epoch.
  • V4 emitted valid structured tool arguments in the serving stack; the base often double-encoded them.
  • V4 completed one full Pi read-edit-validate loop where the base completed none.
  • Modern-Svelte policy compliance rose from 1/10 to 6/10, output-shape compliance from 1/10 to 6/10, and compiler-clean output from 3/10 to 5/10.

What did not improve enough

  • Two of three agent tasks still failed after malformed tool syntax or a bad repair.
  • No raw answer passed every strict static check.
  • The standalone rubric mean stayed essentially flat, and the direct pairwise judge found no overall winner.
  • The model can still generate corrupted identifiers or CSS values during longer answers.

What I would test next

  1. Add more short, clean recovery trajectories where validation fails once and the next tool call repairs exactly that error.
  2. Increase examples that finish immediately after two clean validators, reducing over-generation after success.
  3. Run a larger agent-loop benchmark with repeated seeds so a single malformed call has less influence.
  4. Track “valid tool call,” “successful edit,” “validation attempted,” and “final validation clean” as separate metrics during future iterations.
  5. Consider filtering or reweighting very long generated code trajectories that contain corrupted text, while retaining high-quality tool-oriented examples.

Reproducibility and artifacts

Base model
nvidia/Nemotron-Cascade-8B
Base revision
276a779fe0c1fe2d63a68fd573fec7b4b0a1907e
Repository commit
dd29dc73e60b68fa4f3b4fbed91ccfe069a94b86
Training data SHA-256
4fcdd0a7360d7049ae5333635403f5b8f9c2be2eaab9f83e27bc69734635324a
Validation data SHA-256
98e1aa13b80cb092e01ce3d269fc14fdac12b4d2c475413042f52be377682d20
Environment
PyTorch 2.13.0 + CUDA 13.0; Transformers 5.14.1; TRL 1.8.0; PEFT 0.19.1
Adapter size
167 MB model weights
Agent harness
Pi 0.79.10 with read, bash, edit, and write tools
Serving
vLLM 0.25.1; Qwen3 reasoning parser; Hermes JSON tool-call parser

The run metadata, TensorBoard events, final adapter, raw benchmark answers, static scores, Pi event streams, and judge records remain in the native Morningstar checkout. No training examples, credentials, or private prompts are embedded in this public report.