How to beginner to intermediate · 3 min read

How to make AI writing less generic

Quick answer
To make AI writing less generic, use detailed, specific prompts that include context, style, and examples. Incorporate constraints and explicit instructions in your prompt to guide the model towards unique, tailored outputs.

PREREQUISITES

  • Python 3.8+
  • OpenAI API key (free tier works)
  • pip install openai>=1.0

Setup

Install the openai Python package and set your API key as an environment variable for secure access.

bash
pip install openai>=1.0

Step by step

Use a detailed prompt with explicit instructions and examples to reduce generic AI writing. Below is a complete Python example using gpt-4o that requests a creative, specific style.

python
import os
from openai import OpenAI

client = OpenAI(api_key=os.environ["OPENAI_API_KEY"])

prompt = (
    "Write a short story about a futuristic city, focusing on vivid sensory details and unique cultural elements. "
    "Avoid clichés and generic descriptions. Use a poetic style with metaphors. "
    "Example: 'The neon-lit towers hummed like giant electric trees swaying in a synthetic breeze.'"
)

response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": prompt}]
)

print(response.choices[0].message.content)
output
The neon-lit towers hummed like giant electric trees swaying in a synthetic breeze, casting kaleidoscopic shadows on the bustling streets below. In this city of tomorrow, the air tasted faintly of ozone and jasmine, mingling with the chatter of hovercars and the rhythmic pulse of holographic billboards. Here, culture thrived in vibrant murals that danced with light, and every corner whispered stories of innovation and dreams woven into steel and glass.

Common variations

You can use other models like claude-3-5-sonnet-20241022 or enable streaming for real-time output. Adjust prompt length and style instructions to fit your use case.

python
import os
import anthropic

client = anthropic.Anthropic(api_key=os.environ["ANTHROPIC_API_KEY"])

system_prompt = "You are a creative assistant that writes vivid, non-generic stories."
user_prompt = (
    "Describe a futuristic city with unique cultural details and sensory imagery. "
    "Avoid generic phrases and use poetic language."
)

message = client.messages.create(
    model="claude-3-5-sonnet-20241022",
    max_tokens=300,
    system=system_prompt,
    messages=[{"role": "user", "content": user_prompt}]
)

print(message.content[0].text)
output
The city breathed in colors unseen, where lanterns floated like fireflies and the scent of spice mingled with electric rain. Streets sang with the footsteps of dreamers, and towers shimmered like crystal forests under a violet sky.

Troubleshooting

If the output remains generic, increase prompt specificity by adding examples, style constraints, or asking for unique perspectives. Also, try increasing max_tokens to allow richer responses.

Key Takeaways

  • Use detailed, explicit prompts with style and content instructions to reduce generic AI writing.
  • Include examples and constraints in your prompt to guide the model toward unique outputs.
  • Experiment with different models like gpt-4o and claude-3-5-sonnet-20241022 for varied creative styles.
Verified 2026-04 · gpt-4o, claude-3-5-sonnet-20241022
Verify ↗