DEV Community

Cover image for I Fixed Every Bug In My Second Fine-Tune. Format Accuracy Still Went From 80% To 12%.
Sumama-Jameel
Sumama-Jameel

Posted on

I Fixed Every Bug In My Second Fine-Tune. Format Accuracy Still Went From 80% To 12%.

Run one dropped format accuracy from 80% to 69%, wasted 2 weeks and ~50 hours of free Kaggle GPUs. I literally wrote a whole post about how bad that was.

Run two dropped it from 80% to 12%.

So yes. I fixed every single bug I found, and the headline number got worse. About 30 hours of free Kaggle GPU and five days, by my own rough count. The part that actually matter is that, run one failed because my pipeline was broken. Run two failed because I am not the right person to run it.

What I actually am

I am a product engineer. I build things by directing AI coding agents, and I am good at that. I shipped a working data engine, a verifier, and a corpus that checks out on a stranger's laptop.

Fine-tuning or pre-training is a different job. I do not have the instincts for it. I learned what loss masking was three weeks ago, and what a drift gate was by building one wrong. And I have no compute. Free Kaggle T4s, 30 hours a week, 20GB of disk. That is my whole lab.

Those two things, my skill gap and my hardware, are the story of run two. Not the data.

Everything I fixed from run one

Truncation. Run one cut every episode at 4096 tokens, and the system prompt plus the first user message alone was already 4,210 to 4,729 tokens. The model trained on my instructions and none of the work. Run two cuts whole sessions into windows at 6144, so real assistant turns and real tool results actually fit.

Masking. Run one put loss on everything, including tool outputs. I was teaching the model to write tool results itself. Run two masks system, user and tool output to -100. Assistant tokens only.

Recipe. Rank 32 down to 16. Learning rate 2e-4 down to 2e-5 and 5e-5. Four epochs down to one and two.

Judge. Three validation rows picked the winner last time. Run two uses two held-out slices and a drift budget on both.

Fairness. Two instruments had changed harness since run one, so I re-measured the base model on them. Uncapped BFCL. Full 114-task tau. Separate banks so neither side could overwrite the other.

Every one of those fixes held. That is not the problem.

Then my own safety gate killed a good run

In run one I built a gate that refuses to believe a merge until the numbers move. It caught a merge that silently handed back base weights, diff exactly 0.000000.

In run two, that gate fired again and aborted the battery 40 minutes in.

The merge was fine. Drift was +0.0107. My own written budget allowed +0.5. I had coded the gate at zero, which was stricter than my own rule. So the thing I built to stop me lying to myself, stopped me telling the truth.

Training itself also took six pushes to finish. Not recipe problems. Mechanical bugs in my chunked loss code :)

The scoreboard

Check Base Run one Run two
Answer with no tool 100% 50% 100%
Held-out NLL (lower is better) 16.62 19.93 16.63
HumanEval 55.5% 40.2% 43.9%
Tool call schema valid 43.2% 79.6% 51.9%
Format overall 80% 69% 12%
GSM8K 32% 34.7% 11.3%

Look at the top two rows. Run one lost 50 points on answering a plain question with no tool. Run two held it at 100%. Run one wrecked held-out likelihood. Run two barely moved it.

Those were the two things I set out to fix. They are fixed. Twelve instruments on the card. Five failed the red lines I wrote before the run. Verdict(pipeline said): NO-SHIP.

The lesson that cost me 30 hours

I thought I balanced the mix. I put 276 no-tool rows against 217 tool rows. More no-tool than tool. Looks fine. And then I counted tokens instead of rows.

  • Tool rows: 63.2% of all assistant tokens
  • Refusal rows: 0.71%
  • Direct-answer rows: 0.43%

My no-tool rows were short. My tool rows were long. So the model saw a wall of tool calling and a rounding error of "sometimes just answer."

So basically, Row counts lied to me. And token counts told the truth.

It learned exactly what I fed it: tools are attached, so call a tool. It never learned to decide whether a tool was needed. That is why format collapsed and math collapsed and coding dropped. Not a bug or a bad merge. The merge was proven real and the battery was fair. I built the mix and I got the balance wrong.

What this does not prove

It would be easy to read this as "the data does not work." So let me be careful.

The corpus verified 66 out of 66 before this run and it verifies 66 out of 66 now. Every tool call ran in a real sandbox. Failed commands and retries are kept, not cleaned up. You can clone it and check it yourself in one command.

And here is the number that settles it: only 217 of my 643 training rows came from MegaBit. The other 426 were chat data, math data, code replay and refusals. Two thirds of that mix was not my dataset at all. It was stuff I added. The balance between them was my call, and I made it badly.

What failed was my mix, recipe, gate settings and my six broken pushes. One bad run by a product engineer with no compute is not a verdict on the data.

I already published the rows where my dataset loses to bigger ones. I lost on quantity and won on quality, and I printed both. I am not going to start hiding results now. The training and eval harness is public too: megabit-finetune.

So I am asking again. For help.

I asked in the first post. I am asking again, more directly, because the situation got tighter.

I am out of quota. No Kaggle hours left, no Colab left. I cannot run another attempt right now even if I knew exactly what to change. And I need a number ASAP. Either direction works:

  • If it's bad, I know what to fix and I fix it.
  • If it's good, I can finally use it.

What I cannot keep doing is guessing. Two runs, two negative cards, and the second one taught me the mix was wrong but did not tell me what right looks like. Someone who does this for a living would get that answer in a weekend.

As a thank you, here is what you get:

  • 5 custom datasets, built for your exact setup. You pick the repo, the model and the language.
  • Those go only to you. Not published, not in the public corpus, not anywhere.
  • You get the credit for the results and the model. Your name on it.
  • Mentions and tags across my LinkedIn, dev.to and Medium.

Full details are in the first post. Reply here or email me and we will start. I would be genuinely grateful. Not in a polite sign-off way. I mean it.

Top comments (0)