English

SafeTune: Search-based Harmfulness Minimisation for Large Language Models

Software Engineering 2026-05-11 v1

Abstract

The widespread adoption of Large Language Models (LLMs) raises concerns about the potential harmfulness of their responses. In this paper, we first investigate the harmfulness of responses from four general-purpose LLMs. Next, we propose SafeTune, a multi-objective search-based approach to mitigate harmfulness while increasing response relevance through hyperparameter tuning and system prompt engineering. Our initial evaluation shows that SafeTune significantly reduces the rate of harmful responses generated by Qwen3.5 0.8B and increases prompt-response relevance (both with a large effect size). Among the parameters we explore, we also find that encouraging greater repetition in responses is most impactful in reducing harmfulness while increasing relevance.

Keywords

Cite

@article{arxiv.2605.07709,
  title  = {SafeTune: Search-based Harmfulness Minimisation for Large Language Models},
  author = {Giordano d'Aloisio and David Williams and Giusy Annunziata and Zhiwei Fei and Antinisca Di Marco and Federica Sarro},
  journal= {arXiv preprint arXiv:2605.07709},
  year   = {2026}
}

Comments

Accepted at SSBSE 2026 Challenge Track

R2 v1 2026-07-01T12:57:42.714Z