Skip to main content
Back to Library
Prompt Engineering Guide

Mastering Poetry generation
on Gemini 1.5 Pro

Stop guessing. See how professional prompt engineering transforms Gemini 1.5 Pro's output for specific technical tasks.

The "Vibe" Prompt

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

Optimized Version

STABLE
{ "task": "Poetry Generation", "instructions": "Generate a poem that evokes specific emotions and imagery based on the provided theme. The poem should follow a structured format with clear stylistic choices. Consider the emotional arc from loss to a glimmer of hope or acceptance.", "theme": { "subject": "Lost Cat", "key_elements": ["Absence/Emptiness", "Searching/Longing", "Memories/Comfort", "Uncertainty/Fear", "Hope/Resignation"], "focal_points": ["Empty food bowl", "Silent purr", "Door left ajar", "Whispers of wind"] }, "style": { "form": "Free Verse", "meter": "Varied", "rhyme_cell": "AABB, ABAB (optional, sparse)", "tone": "Melancholy transitioning to wistful", "language_level": "Evocative, descriptive, accessible" }, "length": { "stanzas": 4, "lines_per_stanza": "4-6" }, "audience": "General readers, animal lovers", "example_output_guidance": "Focus on sensory details and internal monologue of the searching owner. Avoid overly simplistic rhymes. Stanza 1: Initial realization of loss. Stanza 2: Active searching and growing unease. Stanza 3: Recalling memories, a moment of solace/pain. Stanza 4: Reflection, a sense of lingering hope or quiet acceptance.", "chain_of_thought": ["Deconstruct the theme: 'Lost Cat' implies sadness, searching, and memory. Identify key emotional stages.", "Select Free Verse for flexibility to convey emotion without strict rhyme/meter constraints, allowing natural flow.", "Outline the emotional arc: Start with deep melancholy, gradually introduce wistfulness or subtle hope.", "Determine sensory details: Empty bowl, silent purr, a draft from an open door - these are relatable and poignant.", "Structure the poem into 4 stanzas for a managed progression of thought and emotion. Assign a focus to each stanza to build narrative.", "Choose accessible yet evocative language to resonate with a broad audience, particularly those who have experienced pet loss.", "Prioritize vivid imagery and internal reflection over external action to deepen emotional impact." ] }
Structured, task-focused, reduced hallucinations

Engineering Rationale

The optimized prompt leverages a highly structured YAML-like format to provide 'Gemini 1.5 Pro' with a detailed blueprint for generation. It breaks down the poetic task into granular components such as 'theme', 'style', 'length', and 'audience', ensuring comprehensive guidance. The 'chain_of_thought' explicitly outlines the reasoning behind each choice, guiding the model through a logical poetic construction process. This minimizes ambiguity, encourages higher-quality and more nuanced output, and allows the model to 'think' through its creative process.

50%
Token Efficiency Gain
Output poem will consistently adhere to the requested 'Free Verse' form.
Output poem will predominantly convey a 'Melancholy transitioning to wistful' tone.
Output poem will incorporate at least 3 of the specified 'key_elements' from the theme.

Ready to stop burning tokens?

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

Optimize My Prompts