Demystifying optimized prompts in language models

Rimon Melamed, Lucas H. McCabe, H. Howie Huang
5/4/2025
cs.CL

No official code found. Best implementation: rimon15/demyst_optim_prompts (7 stars, last commit 2025-12-02).

Abstract

Modern language models (LMs) are not robust to out-of-distribution inputs. Machine generated (``optimized'') prompts can be used to modulate LM outputs and induce specific behaviors while appearing completely uninterpretable. In this work, we investigate the composition of optimized prompts, as well as the mechanisms by which LMs parse and build predictions from optimized prompts. We find that optimized prompts primarily consist of punctuation and noun tokens which are more rare in the training data. Internally, optimized prompts are clearly distinguishable from natural language counterparts based on sparse subsets of the model's activations. Across various families of instruction-tuned models, optimized prompts follow a similar path in how their representations form through the network.

View on arXivView PDF

Code Implementations(1)

Code for the EMNLP 2025 paper "Demystifying optimized prompts in language models"

70C++, PythonAug 31, 202510 months ago

Similar Papers

Cite this paper

@article{melamed2025demystifying,
  title  = {Demystifying optimized prompts in language models},
  author = {Rimon Melamed and Lucas H. McCabe and H. Howie Huang},
  year   = {2025},
  eprint = {2505.02273},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.02273v2}
}

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/2505.02273.svg)](https://codeofpaper.com/paper/2505.02273)

Discussion