Skip to main content
Back to Library
Prompt Engineering Guide

Mastering Poetry generation
on GPT-4o-mini

Stop guessing. See how professional prompt engineering transforms GPT-4o-mini's output for specific technical tasks.

The "Vibe" Prompt

"Write a poem about a lost cat."
Low specificity, inconsistent output

Optimized Version

STABLE
You are a highly skilled and creative poet. Your task is to generate a poem, precisely 16 lines long, divided into four stanzas of four lines each. The poem should explore the theme of a lost cat. Focus on evoking feelings of longing, a sense of searching, and the eventual hope of reunion. Use vivid imagery related to twilight, a warm home, and the cat's unique features (e.g., 'eyes like emeralds', 'fur like midnight'). The rhyming scheme should be AABB for each stanza. Maintain a consistent meter, preferably iambic tetrameter. Before writing the poem, first outline the core emotional arc stanza by stanza, and identify key visual metaphors you will use. [Thought Process] 1. **Theme Breakdown:** Lost cat, focus on longing, search, hope. 2. **Structure:** 16 lines, 4 stanzas, 4 lines/stanza. 3. **Rhyme Scheme:** AABB per stanza. 4. **Meter:** Iambic tetrameter (or close equivalent). 5. **Imagery/Metaphors:** Twilight (loneliness), warm home (longing), emerald eyes, midnight fur. 6. **Stanza 1 (Setup):** Introduce the lost cat, the beginning of the search, initial sadness. 7. **Stanza 2 (Searching):** Describe the active search, obstacles, growing concern. 8. **Stanza 3 (Reflection/Longing):** Focus on memories of the cat, the empty home, deeper emotional impact. 9. **Stanza 4 (Hope/Resolution):** Introduce a glimmer of hope, the promise of reunion, the enduring bond. Now, write the poem based on this plan.
Structured, task-focused, reduced hallucinations

Engineering Rationale

The optimized prompt leverages several best practices for instructing large language models, especially for creative tasks. Firstly, it establishes a clear 'persona' ('highly skilled and creative poet') which guides the model's tone and style. Secondly, it provides extremely specific constraints on length, stanza structure, rhyming scheme, meter, and thematic elements, reducing ambiguity. Thirdly, and most crucially, it incorporates a Chain-of-Thought (CoT) prompting technique by asking the model to first outline its thought process and content before generating the final output. This internal planning step helps the model organize its ideas, align with all constraints, and produce a more coherent and higher-quality poem. The specific imagery suggestions also guide the creative output effectively. This structured approach significantly improves the consistency and quality of the generated poem compared to a vague prompt.

0%
Token Efficiency Gain
The 'vibe_prompt' is short and generic, offering minimal guidance.
The 'optimized_prompt' is significantly longer but provides detailed instructions for structure, theme, style, and includes a CoT section.
The 'why_it_works' explains the benefits of persona, specific constraints, and CoT.

Ready to stop burning tokens?

Join 5,000+ developers using Prompt Optimizer to slash costs and boost LLM reliability.

Optimize My Prompts