Benchmarking fine-tuned vs base model
Prove improvement on a held-out evaluation split
Never ship a fine-tuned model on vibes. Run both the base model and your fine-tuned checkpoint on the exact same held-out test set and compare JSON validity, exact accuracy, and latency.
Example
base_results = [{'ok': True, 'ms': 420}, {'ok': False, 'ms': 450}, {'ok': True, 'ms': 410}, {'ok': False, 'ms': 430}]
tuned_results = [{'ok': True, 'ms': 180}, {'ok': True, 'ms': 175}, {'ok': True, 'ms': 190}, {'ok': True, 'ms': 185}]
def summarize(name, rows):
acc = sum(r['ok'] for r in rows) / len(rows) * 100
avg_ms = sum(r['ms'] for r in rows) / len(rows)
print(f'{name:10s} | accuracy={acc:5.1f}% | avg_latency={avg_ms:.0f}ms')
summarize('Base 3B', base_results)
summarize('Tuned 3B', tuned_results)Example explained
- held-out test set — Prompts never seen during training so accuracy reflects real production performance.
- accuracy + avg_latency — Tracks both quality gain and speed win side by side.
Run automated CLI benchmarks
Use praisonai train benchmark to generate a side-by-side comparison table across accuracy, latency, and throughput automatically.
Example
praisonai train benchmark --base Qwen/Qwen2.5-3B-Instruct --tuned ./checkpoints/support-router --eval data/val.jsonlExample explained
- praisonai train benchmark — Evaluates the base model and fine-tuned checkpoint on identical prompts and reports deltas.
Common pitfall: evaluating on training data
Testing on examples from train.jsonl always looks near 100% even when the model fails on new customer wording. Guard your held-out test split strictly.
Reference: documentation