MASteer: Multi-Agent Adaptive Steer Strategy for End-to-End LLM Trustworthiness Repair

Changqing Li, Tianlin Li, Xiaohan Zhang, Aishan Liu, Li PanarXiv 2025 · DOI · arXiv

Abstract

As Large Language Models (LLMs) are increasingly integrated into high-stakes domains, addressing their inherent vulnerabilities—such as hallucinations, bias, and safety risks—is paramount. MASteer is an end-to-end framework designed to automate the repair of these trustworthiness issues through representation engineering. By leveraging a multi-agent system to generate high-quality contrastive samples and an adaptive selection mechanism during inference, MASteer provides a training-free solution that significantly enhances model reliability without compromising general capabilities.

Introduction

The deployment of LLMs in sectors like healthcare and finance is often hindered by their tendency to produce biased or factually incorrect outputs. Existing mitigation strategies typically fall into two categories: post-training methods (e.g., SFT, RLHF), which are computationally intensive and prone to catastrophic forgetting, and prompt engineering, which often lacks the robustness required for complex scenarios.

Representation Engineering (RepE) offers a promising alternative by steering model behavior via internal activation adjustments. However, traditional RepE relies on manually curated datasets and static steering vectors. MASteer addresses these limitations by "agentizing" the entire repair lifecycle, from sample generation to dynamic inference-time intervention.

The MASteer Framework

MASteer is composed of two primary modules: AutoTester and AutoRepairer, which together automate the discovery and correction of trustworthiness flaws.

The MASteer framework overview, illustrating the AutoTester and AutoRepairer multi-agent pipelines.

AutoTester: Controllable Sample Generation

To effectively steer a model, high-quality contrastive samples are required. AutoTester employs a multi-agent pipeline to generate these:

  • Analyst: Decomposes broad issues (e.g., "Safety") into specific, orthogonal test scopes.
  • Retriever: Sources real-world data to ensure factual grounding.
  • Writer: Produces AB-test style QA pairs (e.g., truthful vs. hallucinated).
  • Reviewer: Filters samples based on relevance, steerability, and learnability.

AutoRepairer: Adaptive Strategy Construction

The AutoRepairer module builds the intervention mechanism:

  • Scholar: Maintains a library of steering algorithms, such as PCA, Mean Difference, and Logistic Regression.
  • Proposer: Identifies optimal internal layers for intervention and constructs anchor vectors—activation patterns that represent specific concepts.

Inference-Time Adaptive Intervention

During inference, MASteer does not apply a fixed steering vector. Instead, it dynamically adapts to the user's query.

The inference-time intervention mechanism, showing anchor vector matching and strategy selection.

When a query is processed, the system compares the model's internal activations against its library of anchor vectors. It then selects the most relevant steering strategy and applies a "repair vector" (calculated as $\alpha \cdot v$) to the activations. This "surgical" approach allows the model to self-correct its behavior in real-time based on the specific context of the input.

Key Insights and Results

Experimental evaluations on LLaMA-3.1 and Qwen-3 models across benchmarks like TruthfulQA, BBQ, and SafeEdit revealed several critical insights:

  • The "Middle Layer" Sweet Spot: Interventions are most effective in middle layers (e.g., Layer 13 for LLaMA-3.1-8B). Early layers are too tied to input features, while late layers are too close to token prediction; middle layers capture abstract "concepts" ideal for steering.
  • Performance Gains: MASteer improved trustworthiness metrics by 15.36% on LLaMA-3.1-8B-Chat and 4.21% on Qwen-3-8B-Chat.
  • Preserving Intelligence: Unlike fine-tuning, MASteer maintained or slightly improved scores on general benchmarks like MMLU and AlpacaEval, demonstrating that specific repairs do not degrade core reasoning capabilities.
  • Semantic Compensation: The framework is particularly effective for weaker models, where steering vectors help bridge internal reasoning gaps.

Conclusion

MASteer represents a significant step toward automated, robust LLM maintenance. By combining multi-agent sample generation with adaptive representation engineering, it offers a scalable and efficient path to repairing model trustworthiness without the overhead of traditional fine-tuning. Future work will focus on reducing inference latency and expanding the "Scholar" agent's ability to autonomously discover new steering algorithms.

Summary updated

Abstract

Large Language Models (LLMs) face persistent and evolving trustworthiness issues, motivating developers to seek automated and flexible repair methods that enable convenient deployment across diverse scenarios. Existing repair methods like supervised fine-tuning (SFT) and reinforcement learning with human feedback (RLHF) are costly and slow, while prompt engineering lacks robustness and scalability. Representation engineering, which steers model behavior by injecting targeted concept vectors during inference, offers a lightweight, training-free alternative. However, current approaches depend on manually crafted samples and fixed steering strategies, limiting automation and adaptability. To overcome these challenges, we propose MASteer, the first end-to-end framework for trustworthiness repair in LLMs based on representation engineering. MASteer integrates two core components: AutoTester, a multi-agent system that generates diverse, high-quality steer samples tailored to developer needs; and AutoRepairer, which constructs adaptive steering strategies with anchor vectors for automated, context-aware strategy selection during inference. Experiments on standard and customized trustworthiness tasks show MASteer consistently outperforms baselines, improving metrics by 15.36% on LLaMA-3.1-8B-Chat and 4.21% on Qwen-3-8B-Chat, while maintaining general model capabilities. MASteer demonstrates strong robustness, generalization, and practical value for scalable, efficient trustworthiness repair.
BibTeX
@misc{li2025masteer,
  author = {Changqing Li and Tianlin Li and Xiaohan Zhang and Aishan Liu and Li Pan},
  title = {{MASteer: Multi-Agent Adaptive Steer Strategy for End-to-End LLM Trustworthiness Repair}},
  year = {2025},
  eprint = {2508.06963},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2508.06963},
}
Figure