Towards LLMs Robustness to Changes in Prompt Format Styles

Lilian Ngweta, Kiran Kate, Jason Tsay, Yara Rizk
4/9/2025
cs.CL

No official code found. Best implementation: lilianngweta/mof (1 star, MIT, last commit 2025-07-24).

Abstract

Large language models (LLMs) have gained popularity in recent years for their utility in various applications. However, they are sensitive to non-semantic changes in prompt formats, where small changes in the prompt format can lead to significant performance fluctuations. In the literature, this problem is commonly referred to as prompt brittleness. Previous research on prompt engineering has focused mainly on developing techniques for identifying the optimal prompt for specific tasks. Some studies have also explored the issue of prompt brittleness and proposed methods to quantify performance variations; however, no simple solution has been found to address this challenge. We propose Mixture of Formats (MOF), a simple and efficient technique for addressing prompt brittleness in LLMs by diversifying the styles used in the prompt few-shot examples. MOF was inspired by computer vision techniques that utilize diverse style datasets to prevent models from associating specific styles with the target variable. Empirical results show that our proposed technique reduces style-induced prompt brittleness in various LLMs while also enhancing overall performance across prompt variations and different datasets.

View on arXivView PDF

Code Implementations(1)

lilianngweta/mofCommunity67%
MIT

This repository contains code for the NAACL SRW paper "Towards LLMs Robustness to Changes in Prompt Format Styles".

10Shell, PythonMar 26, 20251 years agoMIT

Similar Papers

Cite this paper

@article{ngweta2025towards,
  title  = {Towards LLMs Robustness to Changes in Prompt Format Styles},
  author = {Lilian Ngweta and Kiran Kate and Jason Tsay and Yara Rizk},
  year   = {2025},
  eprint = {2504.06969},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2504.06969v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2504.06969.svg)](https://codeofpaper.com/paper/2504.06969)

Discussion