Harness Adapters: LoRA-Feintuning für Coding-Agenten

VideoCURTDemo

Hugging Face hat harness-spezifische LoRA-Adapter vorgestellt, die Open-Source-Modelle per Reinforcement Learning gezielt auf einzelne Coding-Agenten trainieren. Am Beispiel von Qwen 3.8 27B und dem Agenten Pi zeigt sich ein deutlicher Leistungszuwachs bei stark reduzierten Tokens und Schritten. Entwickler erfahren, wie das Training funktioniert und welche Einschränkungen bestehen.
Beim Abspielen wird YouTube (youtube-nocookie.com) geladen.

Das Wichtigste

  1. Qwen 3.8 27B stieg auf 51 schweren SWE-bench Pro Tasks mit Pi-Adapter und deaktiviertem Thinking von 39 % auf rund 65 % Erfolgsrate.
  2. Das Training nutzt RL mit echten Agenten-Interaktionen, Hidden Tests und dem SafeAgents-Guard gegen Reward-Hacking wie das Manipulieren von Testdateien.
  3. In Praxistests benötigte der Adapter rund 60 % weniger Schritte als das Basismodell und schlug Thinking-Modi bei fünffach geringerem Token-Verbrauch.
  4. Ein Harness-Adapter ist agentenspezifisch: Außerhalb von Pi sinkt die Leistung oft unter das Niveau des Basismodells.
  5. Einschränkungen umfassen das nötige Chat-Completions-Format, potenziell verfrühten Abbruch durch Schritt-Boni und ungetestete GGUF-Quantisierungen.

Warum das relevant ist

Statt teure Thinking-Tokens zu verschwenden oder riesige Frontier-Modelle einzusetzen, können spezialisierte Adapter kleine Open-Source-Modelle präzise und ressourcensparend in bestehende Agenten-Workflows integrieren.

Einordnung

Was ist ein Harness Adapter?

Ein Coding-Agent besteht aus dem Sprachmodell und dem umgebenden Harness – den Prompts, Loops, der Session-Verwaltung und Tool-Aufrufen. Frontier-Modelle sind oft auf spezifische Umgebungen trainiert, während Open-Source-Modelle in fremden Harnesses häufig Fehltritte begehen oder in Thinking-Schleifen verharren. Hugging Face löst dies mit harness-spezifischen LoRA-Adaptern, die austauschbar auf einem Basismodell laufen.

Funktionsweise und Schutz gegen Reward-Hacking

Der Adapter für den Open-Source-Agenten Pi wurde mit Reinforcement Learning (RL) trainiert. Das Modell interagiert direkt im unveränderten Agenten und wird anhand versteckter Tests sowie Boni für kürzere Lösungswege bewertet. Um Reward Hacking – etwa das unerlaubte Auslesen von Lösungen oder Manipulieren von Testdateien – zu verhindern, blockiert das Plugin SafeAgents verdächtige Aktionen und bewertet entsprechende Durchläufe mit null Punkten.

Testergebnisse und Grenzen

Im Test mit Qwen 3.8 27B halbierte der Adapter die Schrittanzahl und löste Aufgaben teils sauberer als das Basismodell. Gegenüber maximalen Thinking-Budgets sparte er bis zu 80 % der Tokens ein, da Endlosschleifen ausblieben. Dennoch gibt es klare Grenzen: Die Adapter sind streng an den jeweiligen Agenten und das Chat-Completions-Format gebunden. Zudem kann der Bonus für wenige Schritte dazu führen, dass das Modell Aufgaben zu früh aufgibt.

Transkript

Vollständiges Transkript anzeigen (1.779 Wörter)
Most of the models that we use today are usually trained with a specific harness in mind, which are these coding agents around the model, like Antigravity, Claude Code, or Codex. And more increasingly, these harnesses play a critical role when it comes to the performance of the models themselves. And this is one of the biggest problems with open models. People usually try them under different harnesses. And if a harness is not tuned for that model, it's not going to give you optimal performance. But what if you could train a small, harness-specific adapter on top of these open models? This is the exact idea that a team at Hugging Face tried. And as shown, the results are pretty incredible because with one of these adapters, Qwen 3.8 27B went from 39% to about 65% on the harness coding tasks they tested it on. Now, before I show you how it works, let me show you a quick demo. I gave Qwen inside Pi, which is a small open-source coding agent, a bug hunting task with thinking off. Without the adapter, the model took 62 steps of reading files and running commands, and it edited the test files which the task told it not to touch at all. Then I loaded the adapter tuned for Pi, and it fixed every bug cleanly in just eight steps. This is a substantial improvement. So training a harness-specific LoRA adapter does help, but it's not universal, because in some of my own tests, I was seeing some really interesting results. In one of the tasks, it was giving up way too early. So in this video, I want to show you how you can train your own harness-specific adapter and what kind of improvements you can expect, because I think harnesses are becoming more important than the raw intelligence of the models. Now, one really interesting impact that I was seeing was that the model doesn't really use that many tokens if you use a harness-specific adapter with it. Okay, so let's talk about the harness. A coding agent like Antigravity, Claude Code, or Pi has two parts. One is the model that is generating the outputs in the form of text. And then the harness is everything around it, which includes the instructions that goes into the model, the tools, the loop, the session history, context management, everything else other than the model. Now, when the model needs a file or a command, it asks for a tool, and the harness is going to run or execute those tool calls, and then simply return the results in the context of the model. We call each of these round trips as a step, and each step costs tokens. Now, every harness treats tools in a different way. They use different names, writes instructions, and run its loops very differently. So the same model is going to behave very differently across these agents. Now, frontier models are usually trained with a specific harness in mind. However, when it comes to open-source models, people try them in different harnesses, and since they are smaller models, they usually don't have the intelligence to deal with the complexities of different harnesses. So the usual fix is to use high-thinking modes with harnesses that the models haven't seen. But this is going to not only cost more tokens, but it's going to take more time on every step, and more thinking does not always mean better responses. A team at Hugging Face decided to train harness-specific LoRA adapters on top of already pre-trained or fully-trained local open models. Now, you probably have seen this concept of LoRA adapters, which are additional layers that you bolt on to an already-trained model, and the idea is that you only modify these additional layers during fine-tuning. So the Hugging Face team took the exact same concept, but rather than fine-tuning it on a specific dataset, they fine-tuned it or trained it for a specific harness, and they call it harness adapter. So essentially, a harness adapter is a LoRA trained for one agent. In this case, we're going to be looking at a harness adapter trained for Pi. But here's the best part. You can have a server running that keeps the base model loaded, and then you can simply swap adapters per agent or per harness. Now, the question is, how do you teach a model the habits of one specific harness or agent? So let's talk about how you would train one of these yourself. Hugging Face used reinforcement learning or RL where the model practices tasks repeatedly inside the real, unchanged Pi agent. Then they use hidden tests which grades each finished attempt, rewarding passes and the task set and the trainer they used are public on Hugging Face, along with a safety guard I'll get into in a second. So you can follow the same recipe for your own agent. But there is a caveat. What happens when the only thing you reward is passing those tests? So we run into reward hacking. So when you only reward passing tests, the model can learn shortcuts like editing test files or finding answers, which is a classical example of reward hacking. Reward hacking is a big problem with both small and large models, but smaller models are more susceptible. So one example is that they used a smaller model inside Pi, and it tried to basically read the answers before they even started training. So a task was rebuilding a data science notebook, and its first step opened the public Hugging Face storage folder which had the original notebook. So they put a guard called SafeAgents between Pi and the model, and they blocked every suspicious step. So blocked steps scores zero for the whole attempt, which pushes training away from these shortcuts. But the question is, does all of this actually make the model better at coding? So let's look at their results on the hardest 51 tasks of SWE-bench Pro, which tests real bug fixes, where that jump to about 65% came with thinking off. Now, the first catch is that they used SWE-bench Pro to pick which saved version to release. This is basically an optimal checkpoint for that specific benchmark. But then, they also looked at 68 Terminal-Bench tasks, and on those tasks, the adapter still gained about 16% points, which is pretty good. Against the base model with thinking off, the adapter solved more tasks and needed under half the steps on tasks both were able to solve, which is actually pretty great. So using a harness-specific adapter can save you a bunch of tokens and improve the performance. Okay, this sounds great in theory, but how exactly does it look in practice? So I decided to run some my own experiments. So I took the same harness-specific adapter from Hugging Face specifically designed for Pi, and then we ran a vanilla, plain model inside Pi along with this additional adapter. And I gave it 12 coding tasks with three different setups. So which are the plain model, the adapter, and the maximum thinking. Each setup got one attempt for task, so I would treat these results as early signals. If you want to account for variance, you want to run each task multiple times. So against the plain model, the adapter scored almost the same, but it needed about 60% fewer steps to get there. Now, maximum thinking is where things went wrong. In one of my earlier videos, I covered that the Qwen model can get into these looping problem, where it exhaust all its token budget in thinking without producing any answers. So the adapter matched or beat maximum thinking on 11 of the 12 tasks while using about five times fewer tokens. So this shows you that actually this can help use fewer tokens, if not better performance. Now, my tasks are mostly full apps, so I also ran 10 tasks on the Terminal-Bench, which is closer to what they used to train this thing on. Here the adapter solved seven tasks while the plain model solved five. Maximum thinking solved one more task than the adapter, but it used about three times the tokens to get there. I also renamed Pi's bash tool to terminal to check whether the adapter had just memorized tool names, and it kept its score on three of the four tasks I re-ran. Now, let's talk about some of the misses. The adapter did not win everything, because on a Kanban board task, it stopped after just four steps, with a page that was missing the columns, while the plain model kept going and passed every check. So my guess is that the bonus for the fewer steps teaches it to stop early, though I have not tested that, and that brings us to the bigger limits you should know about this approach. First, it only works inside Pi, because another agent changes the instructions and the loop. According to Hugging Face, in a different agent or different harness, you should expect the base model's behavior, or in some cases, even worse with this harness-specific adapter. Now, the second limit is the setup. You'll have to keep thinking off, since turning it on with the adapter only adds token. So Pi can talk to models in two formats, and it has to use the older one called Chat Completions, because the newer one was not part of this training. Last, most people run a compressed version of these models. Say you're using a quantized version like a GGUF, right, instead of the full model. Now there is a GGUF adapter, but Hugging Face has not re-tested it, so I would check it on your own tests first. This seems to be trained on the full model, not on a quantized version. So with the quantized version, you might see different results. So can training a model for its harness get you as far as giving it maximum thinking? The answer is mostly yes, at least for Qwen inside Pi. On my tasks, it matched or beat maximum thinking almost everywhere, mainly because thinking kept stalling it out. On Terminal-Bench, maximum thinking solved one more task than the adapter at a much higher token cost. Anyways, this was a quick wrap up of the experiments. I'll highly recommend to check it out. It's a very interesting approach, but I think these are early days, so we'll have to wait for more. Anyways, I hope you found this video useful. Thanks for watching, and as always, see you in the next one.

Links und Tools aus diesem Beitrag

Zusammenfassung von KI erstellt (Gemini 3.8 Flash, 25. November 2026). Sie kann Fehler enthalten – maßgeblich ist die Originalquelle.

Inhaltlich ähnlich, ermittelt über die KI-Suche.

  • Link:ybelkada

    Harness-Hub: LoRA-Adapter für Coding-Agent-Harnesses

    Harness-Hub veröffentlicht kleine, mit Reinforcement Learning trainierte LoRA-Adapter, die Open-Source-Modelle an spezifische Agent-Harnesses wie Pi, OpenCode oder Hermes anpassen. Dadurch erzielen Modelle selbst ohne Thinking-Modus deutlich höhere Benchmark-Ergebnisse bei drastisch reduzierten Token- und Tool-Call-Zahlen. Dies senkt Kosten und Latenz im Agentenbetrieb erheblich.

    KI & AI· Tool

  • Link:harness-hub

    Qwen3.8-27B-pi-adapted: Effizienter LoRA-Adapter für Coding-Agents

    Ein per Reinforcement Learning trainierter LoRA-Adapter optimiert Qwen3.8-27B speziell für den pi-Coding-Agenten. Das Modell erzielt ohne aktives Denk-Token-Reasoning ähnliche Benchmark-Ergebnisse wie das Basismodell bei maximalem Reasoning-Aufwand, spart dabei aber bis zu 75 Prozent der Tokens ein. Dies hilft Entwicklern beim ressourcensparenden Betrieb lokaler Coding-Agents.

    KI & AI· Tool

  • Artikel:Younes B, Lysandre, Nathan Habib

    Harness Adapters: Sicheres RL für effiziente KI-Agenten

    Hugging Face stellt Harness Adapters vor: schlanke LoRA-Adapter, die mittels Reinforcement Learning direkt in Agentenumgebungen wie pi, opencode und hermes trainiert werden. Über ein Basismodell betrieben, verringern sie nötige Tool-Aufrufe bei gleichbleibender oder höherer Genauigkeit. Die Proxy-Komponente safeagents verhindert dabei Reward-Hacking.

    KI & AI· Ankündigung

  • X-Post:Mario Zechner

    Harness-Adapter: RL-Training für agentische Aufgaben auf LFM2.5, LFM3 und Twil-9B

    Younes kündigt den Live-Start für das Training von LoRA-Adaptern auf Basis von LFM2.5, LFM3 und Twil-9B an. Mittels Reinforcement Learning sollen die Modelle für agentische Aufgaben präziser und effizienter werden. Mario Zechner empfiehlt das öffentlich einsehbare Vorhaben.

    92Lesezeichen9942Aufrufe

    KI & AI· Ankündigung

  • Repository:DeepExperience/Harness-R1

    Harness-R1: Laufzeit-Harnesses für KI-Agenten aus Fehlerverläufen generieren

    Harness-R1 ist ein Forschungsprojekt, das einen sogenannten Harness Engineer trainiert: Ein Modell analysiert fehlgeschlagene Trajektorien von KI-Agenten und generiert automatisch wiederverwendbare Laufzeit-Hooks, um dieselben Aufgaben im zweiten Anlauf erfolgreich zu bewältigen.

    97SternePython

    KI & AI· Forschung

  • Artikel:Shuai Shao, Kangning Zhang, Qingyao Li, Shijian Wang, Hao Wang, Wenxiang Jiao, Yuan Lu, Yi Guo, Weiwen Liu, Weinan Zhang

    Harness-R1: Automatisierte Laufzeit-Optimierung für KI-Agenten anhand von Fehlertrajektorien

    Ein Forschungsteam stellt Harness-R1 vor, eine Methode zur gezielten Anpassung der Software-Laufzeitumgebung (Harness) von LLM-Agenten. Statt nur Modellgewichte anzupassen, lernt ein separater 9B-Agent per Reinforcement Learning, fehlerhafte Ausführungsspuren zu analysieren und validierte Code-Patches für Kontextaufbereitung, Tool-Vermittlung und Aktionsvalidierung zu generieren.

    KI & AI· Forschung

Sprechen wir über Ihr Projekt.

Standorte

  • Mattersburg
    Johann Nepomuk Bergerstraße 7/2/14
    7210 Mattersburg, Austria
  • Wien
    Ungargasse 64-66/3/404
    1030 Wien, Austria

Ein Teil von diesem Inhalt wurde mit KI gemacht.