Crafting high-quality prompts can be time-consuming and require specialized knowledge. Automatic prompt optimization in Alibaba Cloud Model Studio simplifies this process. It uses a model to analyze and rewrite your original prompt, generating a version with better structure, clearer instructions, and more reliable results. This enhances the performance and consistency of your model-based applications.
How it works
Automatic prompt optimization uses a model to restructure the prompts you submit. Optimization strategies include:
Restructuring: Adjusts the overall structure of the prompt to be more logical.
Assigning a role: Sets a clear expert role for the model, such as "You are an expert software engineer."
Enhancing instructions: Makes vague instructions more specific and breaks them down into steps.
Adding safeguards and constraints: Specifies output format, content limitations, and boundary conditions.
Optimize a prompt
Follow these steps to optimize a prompt in the Model Studio console.
Access the optimization feature: Go to the page, and click Automatic Optimization in the upper-right corner.
Enter the original prompt: In the Original Prompt input box, paste or enter your prompt.
Optimize and view results: Click Optimize. The system processes your request and displays the new version in the Optimized Prompt field.
Use the optimized prompt:
Copy: Click Copy to use the optimized prompt elsewhere.
Save as template: Click Save as Template to add the optimized prompt to your prompt library. This simplifies management, version control, and team collaboration. See Prompt template overview.

FAQ
Is my prompt data secure? Will it be used for model training?
No. Alibaba Cloud strictly adheres to its data privacy policies. The data you submit for optimization is not stored or used to train any models.
How is the automatic prompt optimization feature billed?
Automatic prompt optimization is free.
Why did my prompt optimization fail?
This can happen for several reasons:
The input is too long and exceeds the token limit of the model.
The input has triggered the model's safety or content moderation policies.
There are network issues, or the service is temporarily unavailable. Try again later.