Prompt engineering is still mostly manual labor. You tweak a word here. You shuffle examples there. You pray the model behaves. Microsoft wants to change that. They just open-sourced UniPrompt, and it does something most prompt tools cannot. It builds long, complex prompts from scratch.

What UniPrompt Actually Does

UniPrompt takes a basic task description and some training examples. Then it builds a full prompt. Not a short one. Not a generic one. A structured prompt with multiple semantic sections that cover different facets of the task.

Think about how you write a prompt by hand. You add context. You add counter-examples. You add analogies. You add edge-case instructions. UniPrompt automates that whole process. It breaks the task into facets, clusters the input space, and generates candidates for each prompt section. A feedback mechanism aggregates edits across mini-batches into a coherent description for each section.

The result: prompts that are longer, more nuanced, and more accurate than what humans write by hand. The paper reports higher accuracy than human-tuned prompts and state-of-the-art methods across multiple datasets [[1]](https://arxiv.org/abs/2406.10504).

The Key Insight: Structure Matters

Most prompt optimization tools treat a prompt as one big blob of text. They iteratively edit the whole thing or swap out in-context examples. UniPrompt treats a prompt as a structured document with loosely coupled sections. Each section has a relatively independent effect on performance.

This is how humans think about prompts. You do not rewrite the entire thing from scratch every time. You tweak the section that handles edge cases. You improve the explanation section. UniPrompt formalizes that intuition.

The algorithm clusters input examples so each batch likely represents a different facet of the task. Then it proposes adding, editing, or deleting sections based on feedback from each batch. Those edits get aggregated into generalizable descriptions. The paper is appearing at ACL Findings 2025 [[1]](https://arxiv.org/abs/2406.10504).

The Bigger Picture: Microsoft's Prompt Optimization Stack

UniPrompt is not a one-off project. It sits in a growing portfolio of Microsoft prompt optimization tools:

  • PromptWizard (3,833 GitHub stars) — A task-aware, agent-driven prompt optimization framework. It uses feedback-driven self-evolving prompts. The most popular of the three by far [[2]](https://github.com/microsoft/PromptWizard).
  • SAMMO (751 stars) — Structure-aware Multi-Objective Metaprompt Optimization. A general-purpose framework for prompt engineering and optimization with a compile-time search approach [[3]](https://github.com/microsoft/sammo).
  • UniPrompt — The new unified interface. It distills common functions from different algorithms into a plug-and-play API. It also provides a benchmarking layer to compare different prompt optimization approaches [[4]](https://github.com/microsoft/uniprompt).

Three open-source tools. Three different approaches. One vendor building the full stack.

Why This Matters

Prompt optimization is fragmented right now. Everyone has their own script. Their own heuristic. Their own weekend hack. Microsoft is consolidating this space into tooling that is reusable, benchmarkable, and composable.

UniPrompt adds the unifying layer. You can plug in different algorithms through a common API. You can benchmark them against each other. You can mix and match components. This is what mature tooling looks like in any software discipline. Prompt engineering has not had that until now.

The fact that UniPrompt generates prompts that baseline algorithms cannot generate is the technical hook. The fact that Microsoft now has three complementary tools with a unified API is the strategic signal.

How to Get Started

The repo is at github.com/microsoft/uniprompt. You need Python 3.8+ and an OpenAI API key (or Azure endpoint). The config is straightforward. You define your dataset as a JSONL file with train/test/validation splits, questions, choices, and answers. Then you run the example script with your config file.

The MIT license means you can use it commercially. The code supports GPT-4o as the solver model and GPT-4 as the expert and grouping models.

The Bottom Line

Manual prompt engineering does not scale. Microsoft knows this. They are building the tooling to automate it end to end. UniPrompt is the latest piece. It handles the hard problem: generating complex, multi-faceted prompts that outperform human-written ones. If you are still writing prompts by hand for production systems, this is worth a serious look.


Citations

  1. Juneja, G., Jajoo, G., Natarajan, N., Li, H., Jiao, J., & Sharma, A. (2025). Task Facet Learning: A Structured Approach to Prompt Optimization. arXiv:2406.10504. Appearing in ACL Findings 2025. https://arxiv.org/abs/2406.10504
  1. Microsoft PromptWizard. https://github.com/microsoft/PromptWizard (3,833 stars as of May 2026)
  1. Microsoft SAMMO. https://github.com/microsoft/sammo (751 stars as of May 2026)
  1. Microsoft UniPrompt. https://github.com/microsoft/uniprompt
  1. Microsoft Research — UniPrompt: A Structured Approach to Prompt Optimization. https://www.microsoft.com/en-us/research/project/uniprompt-a-structured-approach-to-prompt-optimization/overview/
  1. Microsoft Research Blog — SAMMO: A general-purpose framework for prompt optimization. https://www.microsoft.com/en-us/research/blog/sammo-a-general-purpose-framework-for-prompt-optimization/

Fact-Check Notes

  • PromptWizard star count: Verified at 3,833 via GitHub search results (May 2026). The task briefing stated 3.8K, which is consistent.
  • SAMMO star count: Verified at 751 via GitHub search results (May 2026).
  • UniPrompt paper at ACL Findings 2025: Confirmed via arXiv page ("Appearing in ACL Findings 2025") and the v2 update dated May 19, 2025.
  • UniPrompt generates long complex prompts baseline algorithms cannot: Direct quote from both the GitHub README and the Microsoft Research project page. Confirmed.
  • UniPrompt unified interface / plug-n-play API: Direct quote from GitHub README. Confirmed.
  • UniPrompt beats human-tuned prompts: Claimed in both the paper abstract and the Microsoft Research overview. The paper reports empirical evaluation on multiple datasets. I did not verify the specific benchmark numbers independently.
  • UniPrompt open-source license: The repo does not explicitly state the license in the README, but the Microsoft Research page links to it as an open-source release. Need to verify license file in repo for exact terms. The other two tools (PromptWizard, SAMMO) are MIT licensed.

Word count: ~720