TL;DR
Wrapping a language model in an external software workflow—a "harness"—makes it much better at complex reasoning, at the cost of slower, pricier, and more fragile deployments. This paper introduces On-Policy Harness Self-Distillation (OPHSD), a training recipe where a model learns directly from its own harness-assisted self, absorbing complex multi-step workflows straight into its weights. Once trained, you can throw the external scaffolding away—in fact, putting the harness back on at test time actually gets in the model's way.
What Problem Does This Paper Address?
When large language models (LLMs) face hard problems requiring long-horizon planning or nuanced verification, they often stumble. To fix this, engineers surround models with inference-time harnesses: external programs that orchestrate retrievals, intermediate prompts, and verification steps.
While harnesses work wonders in production, they come with a catch: the underlying model doesn't actually get any smarter. Remove the harness, and the model goes right back to being brittle. Meanwhile, keeping the harness permanently in the deployment loop adds latency, burns extra tokens, and introduces complex engineering failure modes. Standard training methods don't easily close this gap—supervised fine-tuning (SFT) just mimics static text, and reinforcement learning (RL) relies on sparse final-answer rewards that struggle to pinpoint which procedural steps mattered. The authors ask: can we bake the step-by-step procedural habits of an external harness directly into the model's parameters?
Methods
The authors build on on-policy distillation (OPD), where a "student" model generates its own attempt at a problem and receives dense, token-by-token feedback from a "teacher" model. Previously, self-distillation methods created a teacher by simply handing a copy of the base model a static cheat sheet—like appending the reference solution to the prompt. That gives the teacher an informational advantage, showing what a good answer looks like, but not procedurally how to derive it.
OPHSD upgrades this static cheat sheet into an active, programmatic workflow. During training, two things happen in parallel for every problem:
- The unassisted student model attempts the problem directly from scratch.
- Simultaneously, the student model is run inside a task-specific harness equipped with privileged training-only information, generating a structured, multi-step reasoning context. A frozen copy of the base model reads this rich terminal context to act as the teacher, providing token-level supervision via reverse-KL divergence.
The authors test two distinct harnesses on Qwen3-8B:
- Draft–Verify (Text Classification): Given an online memory bank of past labeled cases, the model drafts a prediction, retrieves "confirmers" (similar cases with the same label) and "challengers" (confusable cases with different labels), and verifies its final answer.
- Plan–Solve (Math Reasoning): Using an oracle reference solution, the model acts as a "planner" to write a high-level strategic sketch, then switches roles to a "solver" that executes the algebra using only the problem and the sketch.
At test time, both the privileged data and the harness are completely removed.
Datasets
No new benchmarks are introduced; the authors sample 10k examples per domain from existing datasets:
- Legal Charge Prediction: Trained on CAIL-2018 and evaluated on LawBench (predicting 215 criminal charges from case descriptions).
- Chemical Reaction Prediction: Trained and tested on USPTO-50k (10 reaction classes).
- Mathematical Reasoning: Trained on DeepMath and evaluated on four competition-level benchmarks: AIME24, AIME25, OlympiadBench, and HMMT25.
Key Insights and Ideas
- Harnesses are training wheels, not prosthetics: Once the model internalizes the harness's habits, reattaching the harness at test time yields zero average benefit—and often hurts accuracy. For instance, on LawBench, the external retrieval overwrites the model's newly learned, nuanced internal deliberation with obvious but wrong neighbor examples.
- Learning the shape of retrieval without a database: In text classification, the standalone student obviously can't memorize an external database. Instead, an LLM-as-judge analysis shows that 90%+ of the time, the unassisted model spontaneously invents a case-citation reasoning structure ("here is a similar case, decided as X for reason R...") straight from its weights, compared to under 10% for RL and standard distillation baselines.
- Planning prevents reasoning collapse: In math tasks, standard self-distillation (OPSD) feeds the raw oracle answer straight to the teacher, causing the student's chain-of-thought length and accuracy to collapse mid-training. Routing the solution through a "planner" forces the student to internalize structural decomposition, keeping outputs concise and stable.
- Gains concentrate on the hardest problems: On easy questions, all methods perform similarly. On the hardest tier of questions, OPHSD opens up a massive lead over baselines.
Key Results
Evaluated on Qwen3-8B, standalone OPHSD consistently beats strong RL (GRPO) and self-distillation (OPSD, CRISP) baselines:
- Text Classification: OPHSD hits 68.85% F1 on LawBench and 90.71% accuracy on USPTO, beating GRPO by +7.72% / +1.27% and OPSD by +4.84% / +3.40%. Reattaching the harness at test time drops performance by 0.64% on LawBench and 7.59% on USPTO.
- Mathematical Reasoning: OPHSD achieves the highest standalone pass@8 average across the four math benchmarks at 66.89%, outperforming OPSD by 4.14 percentage points, GRPO by 1.89, and CRISP by 8.14. Reattaching the plan–solve harness drops the average to 64.62%.
- Targeted Transfer: OPHSD solves 84.62% of the math problems that the base model could previously only solve with the harness, plus 12.54% of problems that neither the base model nor the harness could originally crack.
Limitations and Future Work
First, there is a hard theoretical boundary on what can be distilled: OPHSD can internalize structural reasoning priors (like decomposition and self-verification), but it cannot fabricate genuine real-time external access, such as live web searches or code execution environments. Second, the authors note that their experiments currently validate only two representative harnesses rather than sweeping across a massive variety of agentic architectures. Future systems may treat complex harnesses dynamically—using them to bootstrap capabilities during training, then progressively stripping away harness components as the base model matures.
Summary updated