A 0.6B Model Can Memorize Answers but Can't Fix a One-Line Java Bug: A 4-Day Fine-Tuning Autopsy
This experiment shows that fine-tuning a small model for code repair is pointless if the base model lacks fundamental language semantics; the gap between training loss and behavioral capability is wide, and developers need rigorous verification pipelines—not just more data or bigger models—to avoid false confidence.
For four days, a developer systematically fine-tuned a 0.6B model on Java defect repair tasks, only to conclude that the model could memorize exact training examples but never generalize a single meaningful rule. The target was Lang-33 in Defects4J, a one-line fix adding a null check; both the 0.6B and a 4B model failed to produce a correct patch, even when given the exact location and a compatible output format.
The developer progressively isolated variables: output protocol, prompt phrasing, model size, reasoning mode, and even precision (FP32 vs BF16). None moved the needle. Training loss dropped, validation loss dropped, and patches became more applicable, yet trigger tests never passed. The model also failed basic concept checks: it thought `1 / 2` is `0.5`, confused `==` with `equals`, and didn't know that static methods can't access instance fields directly.
The breakthrough came from treating the experiment itself as a system to validate: aligning training and evaluation prompts, forcing overfitting on 8 samples to prove the pipeline worked, and using pairwise code (legal vs illegal) to reveal that the model consistently judged both versions as legal, exposing a total lack of rule understanding. The dev's methodical approach, including red-team review and a strict compile-and-test evaluation chain, offers a reusable template for anyone probing small-model capabilities.
The experiment exposes a fundamental flaw in many fine-tuning workflows: the objective function (loss) is disconnected from the behavior you actually care about. A model can memorize patterns and still have zero understanding of the underlying rules.
The rigorous use of controlled variables and environment verification (e.g., FP32 vs BF16, prompt alignment, forced overfitting) demonstrates that many "model inabilities" might actually be pipeline artifacts; until the pipeline is white-boxed, you can't trust the results.
The pairwise validation technique is a powerful diagnostic: if a model gives the same answer to legal and illegal code, it hasn't learned the rule, regardless of single-question accuracy.
The 4B model's verbatim copying of the buggy method suggests that larger models may be more prone to mimicking input patterns when the task is ambiguous, rather than reasoning from the code's semantics.
The developer's decision to stop is a valuable example of scientific discipline: knowing when to halt a research direction because the evidence for progress is exhausted, even if the goal isn't achieved.
The use of a red-team review to invalidate test questions shows that test set independence is not a static property; a set that was previously held out can become tainted if it influences design decisions.