Skip to main content
Back to Library
Prompt Engineering Guide

Mastering Poetry generation
on Mistral Large 2

Stop guessing. See how professional prompt engineering transforms Mistral Large 2's output for specific technical tasks.

The "Vibe" Prompt

"Write a poem about the beauty of autumn, focusing on falling leaves and crisp air. Make it melancholic yet beautiful."
Low specificity, inconsistent output

Optimized Version

STABLE
{ "task": "Poetry Generation", "parameters": { "topic": "Autumn's Beauty", "focus_elements": [ "Falling leaves", "Crisp air" ], "tone": "Melancholic yet beautiful", "style": "Free verse", "length_stanzas": 4, "rhyme_scheme": "None", "meter": "Flexible" }, "constraints": [ "Evoke sensory details: sight (colors), sound (rustling leaves), feel (cold air)", "Incorporate themes of change, impermanence, and quiet reflection", "Avoid overtly cheerful or somber language; maintain a delicate balance", "Use evocative imagery and metaphors related to aging/decay as beauty" ], "context_examples": [ "\n The oak, a monarch, sheds its crimson crown,\n Each leaf a whispered memory, drifting down.\n A chill embrace, the air, a silver breath,\n Of silent farewells, dancing, facing death.\n", "\n Amber carpets laid on forest floor,\n A quiet symphony, heard evermore.\n The sun, a painter, with a fading light,\n Prepares the landscape for the coming night.\n" ], "output_format": "Poem in free verse, 4 stanzas, melancholic and beautiful." }
Structured, task-focused, reduced hallucinations

Engineering Rationale

The optimized prompt leverages a structured JSON format to explicitly define all necessary parameters for poetry generation. Instead of just a broad 'vibe', it breaks down the request into concrete 'topic', 'focus_elements', 'tone', 'style', 'length_stanzas', 'rhyme_scheme', and 'meter'. Crucially, it includes 'constraints' that guide the model on nuance, sensory details, themes, and language to use and avoid, ensuring the 'melancholic yet beautiful' balance is achieved. The 'context_examples' provide clear demonstrations of the desired style and tone, acting as in-context learning. This level of detail minimizes ambiguity and increases the likelihood of a high-quality, on-spec output, guiding the model's 'thought process' more effectively than a simplistic instruction. The specified 'output_format' also ensures the final presentation is as expected.

0%
Token Efficiency Gain
The generated poem must be in free verse.
The poem must have exactly 4 stanzas.
The poem must explicitly mention falling leaves and crisp air.

Ready to stop burning tokens?

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

Optimize My Prompts