Pioneer Agent: Continual Improvement of Small Language Models in Production
Organizations: Fastino Labs
Abstract
Small language models are attractive for production deployment due to their low cost, fast inference, and ease of specialization. However, adapting them to a specific task remains a challenging engineering loop, driven not by training itself but by surrounding decisions: data curation, failure diagnosis, regression avoidance, and iteration control. We present Pioneer Agent, a closed-loop system that automates this lifecycle. In cold-start mode, given only a natural-language task description, the agent acquires data, constructs evaluation sets, and iteratively trains models by jointly optimizing data, hyperparameters, and learning strategy. In production mode, given a deployed model with labeled failures, it diagnoses error patterns, constructs targeted training data, and retrains under explicit regression constraints. To evaluate this setting, we introduce AdaptFT-Bench, a benchmark of synthetic inference logs with progressively increasing noise, designed to test the full adaptation loop: diagnosis, curriculum synthesis, retraining, and verification. Across eight cold-start benchmarks spanning reasoning, math, code generation, summarization, and classification, Pioneer Agent improves over base models by 1.6-83.8 points. On AdaptFT-Bench, it improves or preserves performance in all seven scenarios, while naive retraining degrades by up to 43 points. On two production-style deployments built from public benchmark tasks, it raises intent classification from 84.9% to 99.3% and Entity F1 from 0.345 to 0.810. Beyond performance gains, the agent often discovers effective training strategies, including chain-of-thought supervision, task-specific optimization, and quality-focused data curation, purely from downstream feedback.
Figures & tables
| Scenario | Task | Base Model | Domain | Fail | Pass | Tier |
| Benchmark-derived synthetic-log scenarios | ||||||
| GSM8K | Math generation | Qwen3-8B | Math reasoning | 751 | 577 | Hard |
| GSM8K | Math generation | Llama 3.2-3B | Math reasoning | 903 | 425 | Hard |
| ARC-Challenge | Multiple choice | Llama 3.2-3B | Science reasoning | 765 | 735 | Hard |
| TriviaQA | Open QA | Llama 3.2-3B | Trivia knowledge | 798 | 702 | Hard |
| HumanEval | Code completion | Qwen3-8B | Python functions | 395 | 235 | Medium |
| Benchmark | Model | Baseline | Fine-tuned | Iters | |
| Decoder models (generation) | |||||
| ARC-Challenge | Llama 3.2-3B | 5.3% | 72.6% | +67.3 | 11 |
| GSM8K | Llama 3.2-3B | 8% * | 43.7% | +35.7 | 10 |
| TriviaQA | Llama 3.2-3B | 0% * | 48.6% | +48.6 | 9 |
| ARC-Challenge | Qwen3-8B | 91.7% | 93.3% | +1.6 | 13 |
| HumanEval | Qwen3-8B | 71.3% | 92.7% | +21.4 | 4 |
| Benchmark | Key Finding |
|---|---|
| ARC-Challenge (Llama 3B) | Chain-of-thought training was the largest observed lever (+21pp); DeepSeek-R1 traces outperformed GPT-4.1. Post-peak iterations with more data, higher LoRA rank, or lower learning rate all regressed. |
| GSM8K (Llama 3B) | Fewer epochs (2) with larger batch size (16) were optimal; the model overfits quickly on math patterns. Final accuracy (43.7%) is competitive for 3B-scale models. |
| HumanEval (Qwen 8B) | Cross-benchmark generalization: trained on MBPP (374 problems), evaluated on HumanEval (164). Adding GPT-4.1-generated solutions reduced performance (96.9% 94.5%), indicating that external outputs can dilute the training signal. |
| XSum (Qwen 8B) | Summarization overfits rapidly—1 epoch is optimal. Fine-tuning corrected verbosity (32.6-word 21-word summaries). |
| SAMSum (Qwen 8B) | System prompt design was the primary lever: a constrained prompt (“1–3 sentences, main outcome, third person, brief”) outperformed all hyperparameter changes. |
| SMS Spam (GLiNER2) | 55 targeted examples added to a 4,458-example base (+1.2%) increased F1 from 0.9834 to 0.9967 via iterative precision–recall balancing. |
| Benchmark | Model | Metric | Agent C1 | Agent Best | Naive C1 | Naive C4 | Final Gap |
|---|---|---|---|---|---|---|---|
| GSM8K | Qwen3-8B | Acc. | 75.9% | 81.2% | 71.6% | 64.7% | +16.5% |
| GSM8K | Llama 3.2-3B | Acc. | 27.8% | 34.8% | 19.8% | 14.5% | +20.3% |
| ARC-Challenge | Llama 3.2-3B | Acc. | 74.2% | 78.4% | 52.9% | 55.8% | +22.6% |
| TriviaQA | Llama 3.2-3B | Acc. | 73.5% | 76.1% | 34.0% | 33.1% | +43.0% |
| HumanEval | Qwen3-8B | pass@1 | 89.0% | 90.3% | 74.4% | 72.5% | +17.8% |
| XSum | Qwen3-8B | ROUGE-2 | 38.9 | 43.1 | 10.9 | 6.5 | +36.6 |
| Method | Overall | Noisy | Clean |
|---|---|---|---|
| Base model (no training) | 56.6 | 49.4 | 66.3 |
| Naive Retrain (40% poison) | 64.4 | 55.1 | 76.9 |
| Naive Retrain (60% poison) | 64.3 | 56.0 | 75.2 |
| Random Augmentation | 68.5 | 58.6 | 81.7 |
| Clean Only (no poison) | 71.2 | 62.6 | 82.5 |
| Pioneer Agent (filtered) | 72.2 | 61.7 | 86.2 |
| Checkpoint | Naive | Agent | Poison | |
|---|---|---|---|---|
| C1: Clean Base | 71.6 | 75.9 | +4.3 | 0% |
| C2: +Stage 1 | 62.6 | 77.6 | +15.0 | 15% |
| C3: +Stage 2 | 63.3 | 79.1 | +15.8 | 25% |
| C4: +Stage 3 | 64.7 | 81.2 | +16.5 | 40% |
| Perturbation Type | Count | Fixable | Agent Action |
| Linguistic / structural noise | |||
| Typo / misspelling | 74 | Yes | Uses contrastive pairs to improve robustness to surface noise |
| Syntactic / grammatical error | 50 | Yes | Uses contrastive pairs to enforce correct interpretation |
| Preamble injection | 69 | Partial | Trains on clean extraction of relevant content |
| Truncation | 28 | Partial | Includes shorter contexts to improve robustness |
| Number distractor | 50 | Yes | Uses contrastive pairs to resolve numerical confusion |
| Metric | Before | After | |
|---|---|---|---|
| Failures fixed | 453 | 450 (99.3%) | 3 remaining |
| Adjusted (excl. 1 label error) | 452 | 450 (99.6%) | 2 remaining |
| Regression on passing set | 198 | 197 (99.5%) | 1 regression |
| Cost Breakdown | ||||
| Run | Hours | Claude API | Train + Sandbox | Total |
| Production improvement (AdaptFT-Bench) | ||||
| GSM8K (3-stage, run A) | 11.5 | $22.98 | $10.00 | $32.98 |
| GSM8K (3-stage, run B) | 8.3 | $16.62 | $9.00 | $25.62 |
| CLINC150 (2 iterations) | 1.0 | $1.98 | $1.50 | $3.48 |
| Cold-start | ||||
Appendix figures & tables8 assets
Supplementary material from the paper’s appendix.
Appendix
| Tier | Description | Failure count | Failure diversity | Model state |
|---|---|---|---|---|
| Easy | Few failures, clear patterns | 10–50 | 1–2 clusters | Fine-tuned |
| Medium | Many failures, systematic patterns | 50–500 | 3–5 clusters | Fine-tuned or base |
| Hard | Many failures, adversarial + non-fixable | 100–500+ | 5+ clusters, incl. non-fixable | Base model |
| Scenario | Regime | Base model | Metric | Failure source | Sanitized artifact |
|---|---|---|---|---|---|
| CLINC150 | Production-style case study | GLiNER2-base | Exact-match pass rate on failing slice | 453 judged production failures + 198 passing regression examples | clinc150_trace_and_report_summary.md |
| CoNLL-2003 | Production-style case study | GLiNER2-base / large | Entity F1 + sample pass rate | 2,740 judged NER failures from production-style deployment logs | conll2003_ner_trace_and_report_summary.md |
| GSM8K (Qwen3-8B) | Synthetic 3-stage scenario | Qwen3-8B | Exact match on final #### number | Benchmark-derived noisy inference logs | none in representative bundle |
| GSM8K (Llama 3.2-3B) | Synthetic 3-stage scenario | Llama 3.2-3B | Exact match on final #### number | Benchmark-derived noisy inference logs | gsm8k_llama_trace_summary.md |
| ARC-Challenge | Synthetic 3-stage scenario | Llama 3.2-3B | Exact match on answer letter | Benchmark-derived noisy inference logs | arc_challenge_trace_summary.md |
| TriviaQA | Synthetic 3-stage scenario | Llama 3.2-3B | Case-insensitive answer-alias match | Benchmark-derived noisy inference logs | triviaqa_trace_summary.md |
| Category | Perturbation Type | Default Rate |
| Linguistic | Typos (character transposition/insertion/deletion) | 10% |
| Phonetic misspellings | 7% | |
| Syntactic errors (broken structure, fragments) | 6% | |
| Grammatical errors (tense, articles, agreement) | 5% | |
| Punctuation abuse (missing, excessive) | 5% | |
| Casing errors (all-lower, all-caps, random) | 4% |
| Benchmark | Model | Iter 1 | Iter 3 | Best | Iterations |
|---|---|---|---|---|---|
| ARC-Challenge | Llama 3B | 48.1% | 68.6% | 72.6% | 11 |
| GSM8K | Llama 3B | 11.8% | 35% | 43.7% | 10 |
| HumanEval | Qwen 8B | 72.0% | 85.4% | 92.7% | 4 |
| XSum | Qwen 8B | R2: 13.0 | R2: 16.4 | R2: 17.9 | 13 |
| SAMSum | Qwen 8B | R2: 21.8 | R2: 24.1 | R2: 25.4 | 11 |
| TriviaQA | Llama 3B | 0.0% | 44.0% | 48.6% | 9 |
| Benchmark | Model | Train Ex. | Epochs | Batch Size | LR | Notes |
|---|---|---|---|---|---|---|
| ARC-Challenge | Llama 3B | 1,119 | 5 | – | – | R1 CoT + val data |
| GSM8K | Llama 3B | 7,473 | 2 | 16 | 2e-4 | |
| TriviaQA | Llama 3B | 3,000 | 4 | – | 1e-4 | |
| HumanEval | Qwen 8B | 374 | 3 | – | – | Cross-benchmark (MBPP) |
| XSum | Qwen 8B | 3,000 | 1 | 4 | – | |
| SAMSum | Qwen 8B | 500 | 8 | – | – | Constrained system prompt |
| Component | Configuration |
|---|---|
| Agent LLM | Claude Sonnet 4.6, 1M context, 32K extended thinking budget |
| Agent framework | LangGraph + LangChain (Python) |
| Sandbox | Modal containers, 16GB memory, 24h timeout, 1 CPU |
| Training backend | Tinker SDK (LoRA fine-tuning, instant inference after training) |
| Training helpers | tinker_helpers.py – standalone wrappers for train() , infer() , infer_batch() |
| Data generation LLMs | OpenAI GPT-4.1/4.1-mini, DeepSeek-R1/V3, Fireworks |
| Benchmark | Evaluation Method | Code Source |
|---|---|---|
| ARC-Challenge | Exact match on answer letter (A/B/C/D) | Agent-written extraction + string match |
| GSM8K | Exact match on final number after #### | Agent-written regex extraction |
| TriviaQA | Case-insensitive match against answer aliases | Agent-written alias matching |
| HumanEval | pass@1 – code execution against unit tests | Official human_eval package |
| XSum | ROUGE-1, ROUGE-2, ROUGE-L | rouge-score Python package |
| SAMSum | ROUGE-1, ROUGE-2, ROUGE-L | rouge-score Python package |
| Artifact family | Agent mode | Benchmarks | What it preserves |
|---|---|---|---|
| Final reports (PDF) | Cold-start | SMS Spam | Domain research, dataset setup, 4-iteration augmentation loop, final F1 0.9967 |
| Final reports (PDF) | Production | CLINC150 | 5-cluster failure taxonomy, 1,254-example curriculum, Full FT vs. LoRA comparison, rollback decision |
| Final reports (PDF) | Production | CoNLL-2003 | FP-dominated diagnosis, 6-iteration repair loop, threshold sweep, capacity scale-up to GLiNER2-large |
| Derived trajectory summaries | Cold-start | ARC, GSM8K, TriviaQA | Search trajectories, iteration-by-iteration configuration changes, evaluation outputs, and intermediate decisions distilled from internal run exports |
| Derived trajectory summaries | Production | CLINC150, CoNLL-2003 | SQL diagnostics, delegated taxonomy analysis, dataset revisions, training/evaluation history, and stopping criteria distilled from internal traces |
LLM Agent Training
Large language model agent training teaches models to plan, use tools, and learn from multi-step interaction with environments.
See all 586 papers