LatentPrompt: Optimizing Promts in Latent Space

Mateusz Bystroński, Grzegorz Piotrowski, Nitesh V. Chawla, Tomasz Kajdanowicz
8/4/2025
cs.CL

No confident code implementation found for this paper.

Abstract

Recent advances have shown that optimizing prompts for Large Language Models (LLMs) can significantly improve task performance, yet many optimization techniques rely on heuristics or manual exploration. We present LatentPrompt, a model-agnostic framework for prompt optimization that leverages latent semantic space to automatically generate, evaluate, and refine candidate prompts without requiring hand-crafted rules. Beginning with a set of seed prompts, our method embeds them in a continuous latent space and systematically explores this space to identify prompts that maximize task-specific performance. In a proof-of-concept study on the Financial PhraseBank sentiment classification benchmark, LatentPrompt increased classification accuracy by approximately 3 percent after a single optimization cycle. The framework is broadly applicable, requiring only black-box access to an LLM and an automatic evaluation metric, making it suitable for diverse domains and tasks.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{bystroski2025latentprompt,
  title  = {LatentPrompt: Optimizing Promts in Latent Space},
  author = {Mateusz Bystroński and Grzegorz Piotrowski and Nitesh V. Chawla and Tomasz Kajdanowicz},
  year   = {2025},
  eprint = {2508.02452},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2508.02452v1}
}

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

Discussion