2 min readfrom Machine Learning

Training a harness for model-agnostic and task-environment-agnostic capability improvements with PyTorch-like framework [P]

Our take

Introducing Harness Training, a novel framework designed to unlock general capability improvements across diverse language models. Developed with a PyTorch-like structure, this project reframes "Agent-driven Self-improving Harness" to a more streamlined approach: training a harness once against a specific task environment, then leveraging it to evaluate *any* model on *any* new environment. Initial results, detailed in a recent blog post (https://www.henrypan.com/blog/2026-07-18-harness-training), demonstrate significant gains on benchmarks like Terminal Bench 2.0, as explored in a related article discussing agent evaluation challenges.

The recent work on "Harness Training," as detailed by u/Megadragon9 and outlined in their blog post [Seeking collaborators for scaling and independent evaluation of a new recurrent language model architecture (preprint + code) [R]], represents a compelling shift in how we approach improving the capabilities of large language models (LLMs). Moving away from the initial framing of "Agent-driven Self-improving Harness," this project proposes a more modular and adaptable methodology—training a "harness" separately, then applying it across various LLMs and task environments. This is particularly pertinent given the ongoing challenges highlighted in discussions around AI agent reliability, such as those explored in [A single AI agent conversation can look perfect and still be broken, leaders from LangChain, Conviva and CoreWeave said at VB Transform 2026]. The ability to isolate and refine the decision-making framework—the harness—while swapping out the underlying LLM offers a powerful pathway towards greater efficiency and robustness in AI systems.

The beauty of this approach lies in its potential to decouple the core reasoning logic from the specific knowledge base of a given LLM. By training the harness on a fixed task environment with a frozen LLM, the resulting framework can then be deployed with different models, even on entirely new task environments. This echoes a broader trend towards more modular AI architectures, allowing for faster experimentation and adaptation. The use of a PyTorch-like training framework further enhances accessibility and facilitates community contributions, as evidenced by the discussions around performance bottlenecks and optimization strategies, as seen in [PyTorch model running 170x slower on T4 vs A100. What could cause a bottleneck this extreme? [D]]. The emphasis on determinism, identified as a crucial missing element in earlier iterations, underscores the importance of reliable and reproducible results in AI development, particularly as we strive for greater control and understanding of complex models.

The demonstrated results – improving general capabilities across multiple LLMs and transferring learnings to unseen environments – are particularly noteworthy. The ability to leverage training from one task (SWE-Bench) to improve performance on another (Terminal Bench) speaks to a potential for cross-task generalization that has long been a goal in AI research. While the framework currently supports OpenAI-compatible APIs and specific benchmark tasks, the design emphasizes extensibility, allowing for easy adaptation to new environments and LLMs. This modularity and adaptability are key to unlocking the full potential of this approach, enabling researchers and practitioners to rapidly iterate and refine their AI systems. The project’s open-source nature and clear documentation further contribute to its value, fostering collaboration and accelerating progress in the field.

Ultimately, Harness Training presents a pragmatic and innovative solution for improving LLM capabilities. It moves beyond a singular focus on model size and architecture, instead emphasizing the importance of the surrounding infrastructure and decision-making processes. As the landscape of LLMs continues to evolve, with a constant stream of new models and architectures emerging, the ability to efficiently adapt and refine these models across diverse tasks will become increasingly critical. The question now is: how can we best leverage this framework to build more reliable, adaptable, and ultimately, more useful AI systems that truly augment human capabilities?

I worked on this project (https://github.com/workofart/harness-training) for the past few months to reframe "Agent-driven Self-improving Harness" to "Harness Training".

The idea is simple, the harness is trained once with a frozen task LLM against a given task environment. Then you can then swap out the task LLM to any model and evaluate the "frozen trained harness" with any task LLM on any new task environment.

Since this was a general problem, I took the chance to create a general PyTorch-like training framework. Right now, you can train with any OpenAI-compatible API for interfacing with the task LLM and train against Terminal-Bench or SWE-Bench tasks, but you can easily extend it to support any task environments.

 criterion = StrictPareto() optimizer = GreedyMonotonic() trainer = Trainer( config_path="config/train_harness.yaml", estimator=AgenticEstimator( backend=CodexAgentBackend(...) ), criterion=criterion, optimizer=optimizer, ) for loss in trainer.epochs(30): # Records the baseline-vs-candidate verdict loss.backward() # Optimizer either fast-forwards the candidate change (git commit) as a new baseline or rejects it (preserved as git ref) optimizer.step() 

I wrote a blog post (https://www.henrypan.com/blog/2026-07-18-harness-training) on this journey, including (but not limited to):

  • results from using this harness training framework to improve general capabilities across many task LLMs to beat Terminal Bench 2.0 (Terminus Harness) and also transfer learnings towards better task-solving abilities in unseen task environments (e.g. harness trained on SWE-Bench tasks solving Terminal Bench tasks).
  • how this framework is built
  • learnings on what was missing in my initial version of the project (hint: determinism)

Any feedback is appreciated. Thanks!

submitted by /u/Megadragon9
[link] [comments]

Read on the original site

Open the publisher's page for the full experience

View original article