# MoMHa: Multi-Objective Optimization of LLM Harnesses over Accuracy, Safety, and Tokens

DevFeed: [MoMHa: Multi-Objective Optimization of LLM Harnesses over Accuracy, Safety, and Tokens](<https://devfeed.tech/articles/momha-multi-objective-optimization-of-llm-harnesses-over-accuracy-safety-and-tokens-124477.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2609.30967>)

Author: Subhojyoti Mukherjee, Md Mehrab Tanjim

Published: 2026-11-09T05:00:00Z

Content type: article

Language: en

Sources: [arXiv: Artificial Intelligence](<https://devfeed.tech/sources/arxiv-artificial-intelligence.md>)

Topics: [Agent Harness](<https://devfeed.tech/topics/agent-harness.md>), [LLM evaluation / benchmarking](<https://devfeed.tech/topics/llm-evaluation-benchmarking.md>), [LLM optimization](<https://devfeed.tech/topics/llm-optimization.md>), [Large Language Model](<https://devfeed.tech/topics/llm.md>), [LLM security](<https://devfeed.tech/topics/llm-security.md>)

Tags: [ablation](<https://devfeed.tech/tags/ablation.md>), [agentic](<https://devfeed.tech/tags/agentic.md>), [benchmarks](<https://devfeed.tech/tags/benchmarks.md>), [claude](<https://devfeed.tech/tags/claude.md>), [claude-code](<https://devfeed.tech/tags/claude-code.md>), [code](<https://devfeed.tech/tags/code.md>), [cost](<https://devfeed.tech/tags/cost.md>), [cs-ai](<https://devfeed.tech/tags/cs-ai.md>), [harness](<https://devfeed.tech/tags/harness.md>), [humaneval](<https://devfeed.tech/tags/humaneval.md>), [llm](<https://devfeed.tech/tags/llm.md>), [mbpp](<https://devfeed.tech/tags/mbpp.md>), [meta-harness](<https://devfeed.tech/tags/meta-harness.md>), [objectives](<https://devfeed.tech/tags/objectives.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [python](<https://devfeed.tech/tags/python.md>), [real-world](<https://devfeed.tech/tags/real-world.md>), [safety](<https://devfeed.tech/tags/safety.md>), [token](<https://devfeed.tech/tags/token.md>), [token-cost](<https://devfeed.tech/tags/token-cost.md>), [tokens](<https://devfeed.tech/tags/tokens.md>)

## AI overview

The paper treats the Python harness around an LLM--prompt construction, call routing, and output parsing--as a design target to optimize for accuracy, behavioral safety, and token cost together. Its Meta-Harness uses an agentic proposer with access to prior harness code, execution traces, and scoring artifacts. Across 17 domains and a 12-model fleet, the single-phase joint-reward approach MoMHa outperformed the tested alternatives: it scored 0.482 on the synthetic track and 0.461 on real-world benchmarks, versus 0.377 for the strongest real-world baseline, DSPy. It also achieved a U-SafeBench safety composite of 0.781 and used 95 fewer tokens per example than the two-phase accuracy-then-tokens approach. The abstract reports transfer to benchmarks and models not used in retraining; it does not provide further methodological detail or results beyond these summary figures.

## Source excerpt

arXiv:2609.30967v2 Announce Type: replace Abstract: Most work on improving large language models treats accuracy as the sole objective. We argue that the harness, the Python code surrounding the model that constructs prompts, routes calls, and parses outputs, is a first-class design surface whose quality is inherently multi-objective: an accurate harness that refuses no unsafe request, or that consumes an order of magnitude more tokens, is not a good harness. We present Meta-Harness, a system that casts harness design as search over three per-domain objectives (accuracy, behavioural safety, and token cost) solved by an agentic proposer (Claude Code) with full filesystem access to prior harness source, execution traces, and scoring artifacts. Our central finding is that a singlephase joint-reward proposer (MoMHa) outperforms every alternative, including a two-phase "accuracy then tokens" ablation, scalar-only feedback, and an accuracy-only baseline. We evaluate on seventeen domains: seven synthetic capability suites, seven real-world public benchmarks (HumanEval, MBPP, Spider, FEVER, MMLU-Pro, LawBench, NuminaMath), and three U-SafeBench-derived user-specific safety domains, using a 12-model fleet spanning four families. On the synthetic track MoMHa achieves a joint mean of 0.482 versus 0.198-0.422 for ten baselines, winning $7 / 10$ per-domain columns; on the real-world track it scores 0.461 versus 0.377 for the strongest baseline (DSPy), winning 5/7 columns, demonstrating that harness strategies transfer to unseen benchmarks without retraining on 8 of 12 target models. MoMHa attains the highest measured behavioral safety composite (U-SafeBench, 0.781) and uses 95 fewer tokens per example than the two-phase alternative. We will release all harness code, evaluation infrastructure, and crossmodel logs.