> ## Documentation Index
> Fetch the complete documentation index at: https://arize-ax.mintlify.site/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Optimize a prompt

> Align prompts with your eval criteria using Prompt Learning - UI, SDK, Alyx, or Skills.

<Frame caption="Start a prompt optimization task from Prompt Hub">
  <img src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/optimize-prompt-1.png" alt="Prompt Hub optimization task configuration with dataset, experiment, columns, and meta-prompt model" />
</Frame>

## What is prompt optimization?

**Prompt Learning** is Arize AX's automated prompt-optimization path — an LLM reads your current prompt, evaluation feedback, and examples, then proposes a revised prompt that better matches your criteria. Same engine, exposed through the UI, SDK, Alyx, and Skills.

For the conceptual frame — including how Prompt Learning compares to manual iteration and conversational refinement with Alyx — see [Optimizing prompts](/ax/concepts/prompts/optimizing-prompts).

## Workflow

<Tabs>
  <Tab title="By Skills">
    Use the [Arize skills plugin](/ax/set-up-with-ai-assistants) with the [`arize-prompt-optimization`](https://github.com/Arize-ai/arize-skills/tree/main/skills/arize-prompt-optimization) skill to optimize prompts from traces and experiments via the `ax` CLI. Try asking your agent:

    * "Optimize this classifier prompt using the last week of eval feedback."
    * "Revise my support prompt to reduce verbosity while keeping escalation rules."

    <Frame caption="Optimize prompts from your coding agent with the arize-prompt-optimization skill">
      <img src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/improve/optimize_prompt_skill.png" alt="Coding agent running the arize-prompt-optimization skill via the ax CLI" />
    </Frame>
  </Tab>

  <Tab title="By Alyx">
    <Steps>
      <Step title="Describe your goal">
        Tell Alyx what to fix, for example "Optimize my prompt to reduce verbosity" or "Rewrite this to improve formatting consistency."
      </Step>

      <Step title="Iterate in chat">
        Ask for further adjustments until the result matches what you want.
      </Step>

      <Step title="Compare versions">
        Review the changes in the **Playground** and save any version you are happy with to **Prompt Hub**.
      </Step>
    </Steps>

    <Frame caption="Optimize prompts with Alyx in the Playground">
      <img src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/ai-powered-prompt-builder-1.gif" alt="Alyx suggesting prompt edits in the Prompt Playground" />
    </Frame>
  </Tab>

  <Tab title="By UI">
    Navigate to **Prompt Hub**, find your prompt, and click **Optimize**.

    <Steps>
      <Step title="Name task and select dataset">
        Enter a task name, then select the training dataset whose rows map to your prompt variables.
      </Step>

      <Step title="Select the experiment">
        Select the experiment whose evaluation feedback will guide the optimizer.
      </Step>

      <Step title="Set the output column">
        Choose the column that contains the model output you want the optimizer to improve.
      </Step>

      <Step title="Confirm feedback columns">
        Confirm feedback columns. [Evaluator](/ax/evaluate/evaluators) results are auto-populated. **Labels paired with explanations** outperform binary labels alone.
      </Step>

      <Step title="Select meta-prompt model">
        Choose the model that reasons over your examples and feedback to propose prompt updates.
      </Step>

      <Step title="Track and ship">
        Monitor in **Task Logs**, compare versions in **Prompt Hub**, validate in the **Playground**, then tag the winner as **Production**.
      </Step>
    </Steps>

    <Frame caption="Optimization task progress in Task Logs">
      <video src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/prompt-optimization-2.mp4" width="100%" height="100%" style={{ display: "block", objectFit: "contain" }} controls muted loop />
    </Frame>

    <Frame caption="Review optimized versions in Prompt Hub">
      <img src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/prompt-optimization-3.gif" alt="Version history in Prompt Hub showing original and optimized prompt versions" />
    </Frame>

    For diffing and labels, see [Save and version prompts](/ax/improve/save-and-version-prompts).

    <Frame caption="Validate original vs optimized prompts in the Playground">
      <video src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/prompt-optimization-4.mp4" width="100%" height="100%" style={{ display: "block", objectFit: "contain" }} controls muted loop />
    </Frame>

    See [compare prompts side by side](/ax/improve/test-a-prompt#multiple-prompts-at-once) for the comparison workflow.
  </Tab>

  <Tab title="By Code">
    ### Prompt Learning via SDK

    Automate prompt optimization programmatically using the **Prompt Learning SDK**, which iteratively refines prompts based on evaluation feedback and annotations.

    The SDK supports advanced features, like built-in systems to run evaluators, and more flexibility to run multiple loops or define train/test splits.

    [Learn more about Prompt Learning via SDK →](/ax/improve/optimize-a-prompt#prompt-learning-via-sdk)
  </Tab>
</Tabs>

## Next up

When you have versions worth keeping, [**Save and version prompts**](/ax/improve/save-and-version-prompts) in **Prompt Hub** so your team can track changes, experiment on different versions, and measure improvements over time.
