dybilar

Steering LLM Creativity with Temperature and Top P

אם ירצה ה׳

Harnessing the interplay of temperature and Top P in LLMs for creative text generation, presented as a "cookbook" workflow with recipes and explanations. Distilled from stunspot article

Understanding the Parameters:

Cookbook Workflow & Recipes:

Recipe Name Temperature Top P Description Example Use Cases
Factual & Focused 0 - 0.2 0.1 - 0.5 Highly predictable and deterministic output. Focuses on the most likely next words, minimizing randomness. Summarization, factual question answering, technical documentation, code documentation
Conversational & Balanced 0.55 - 0.8 0.5 - 0.8 Similar to ChatGPT's default settings. Provides a good balance between coherence and creativity. Suitable for general-purpose conversation and creative writing where predictability is important. Chatbots, dialogue generation, story writing, general creative writing
Creative & Controlled 1.0 - 1.2 0.1 - 0.2 Encourages creative text generation while maintaining a strong focus on coherence. The LLM explores less probable words but remains grounded in the most likely options. Poetry, song lyrics, stylistic writing, creative fiction, imaginative storytelling, character backstories
Highly Creative & Unpredictable 1.2 - 1.6 0.1 - 0.2 Emphasizes creativity and unpredictability. The LLM explores a wide range of less probable words, resulting in more surprising and imaginative text. Requires careful control with low Top P to avoid incoherence. Experimental writing, brainstorming, surrealism, stream of consciousness, generating unexpected and surprising combinations of words and concepts, worldbuilding
Modelmemdump (Avoid) > 1.6 > 0.2 Highly random and often nonsensical output. The LLM jumps between unrelated topics and generates incoherent text. Generally avoid this combination unless you're specifically aiming for chaotic and unpredictable output.

Explanations and Rationale: