Reading the Results: Baseline vs. Optimized, and the Opik Dashboard

~10 min read

After optimization completes, result.display() shows the best prompt found and its score against the baseline — with full results also available in the Opik dashboard for deeper analysis.

Running the optimizer (previous subtopic) produces a result object — this subtopic covers what to actually do with it.

Once optimize_prompt(...) finishes, it prints the most optimal prompt it found. You can invoke result.display() to see a summary of the optimization, the best prompt found and its score — this gives you a direct, in-notebook comparison: the baseline score (from evaluating your original base prompt) against the best score achieved by one of the LLM-generated candidate prompts, plus the actual text of that winning prompt so you can inspect exactly what changed.

Beyond the inline summary, the optimization results are also available in the Opik dashboard for further analysis and visualization — this is valuable specifically because a single printed 'best prompt + best score' doesn't show you the full iteration history: which candidate prompts were tried, how each one scored, and whether the optimization converged smoothly or bounced around before landing on its final answer. The dashboard gives visibility into that full trajectory, not just the endpoint.

One important closing note from this course: while the worked example uses GPT-4o as both the model being tested and the model doing the optimizing, everything here can be executed 100% locally since you can use any other LLM, and Opik itself is fully open-source. This matters practically — it means you're not locked into a specific paid API to use this workflow; you could run the same optimization loop against a locally-hosted open model if cost, privacy, or offline requirements make that preferable.

Tying this back to the first subtopic's framing: what you get at the end of this workflow is a prompt that's been improved against a measurable, dataset-grounded score — not one person's subjective sense that it 'looks better' after a few rounds of manual tweaking. That's the concrete payoff of replacing the manual iteration loop with this automated one.

💻 Code example

# Reading the optimization results — inline summary plus what the
# Opik dashboard adds on top of just the final best prompt.

# result comes from optimizer.optimize_prompt(...) in the previous subtopic
result.display()
# Prints something like:
#   Baseline prompt score:  0.62
#   Best prompt score:      0.89
#   Best prompt: "Summarize the sentence in one clear, complete sentence,
#                 preserving the original subject and action."

print(f"Baseline score:  {result.baseline_score:.2f}")
print(f"Best score:      {result.best_score:.2f}")
print(f"Improvement:     {(result.best_score - result.baseline_score):.2f}")
print(f"Winning prompt:  {result.best_prompt}")

# Full iteration history (every candidate prompt tried + its score)
# is available in the Opik dashboard, not just this inline summary —
# useful for understanding HOW the optimizer converged, not just
# where it landed

💬 Deep Dive with AI

Key points

  • result.display() shows a summary: the best prompt found and its score, directly comparable against the baseline
  • The full optimization results (every candidate prompt + score, not just the winner) are also available in the Opik dashboard
  • The dashboard adds visibility into the optimization trajectory, not just the final endpoint
  • Everything in this workflow can run 100% locally with any LLM — Opik is fully open-source, not tied to one provider
  • The payoff: a prompt improved against a measurable, dataset-grounded score, not one person's subjective sense of 'looks better'