{"repo":"CHATS-lab/verbalized-sampling","free":true,"listed":false,"github":"https://github.com/CHATS-lab/verbalized-sampling","clone":"git clone https://github.com/CHATS-lab/verbalized-sampling.git","description":"Verbalized Sampling, a training-free prompting strategy to mitigate mode collapse in LLMs by requesting responses with probabilities. Achieves 2-3x diversity improvement while maintaining quality. Model-agnostic framework with CLI/API for creative writing, synthetic data generation, and dialogue simulation.","language":"Python","stars":797,"topics":["claude","creative-writing","diversity","gemini","gpt","large-language-models","llm","mode-collapse","prompt-engineering","python"],"license":null,"category":"ai-agents","readme_excerpt":"Verbalized Sampling: How to Mitigate Mode Collapse and Unlock LLM Diversity --- Quickstart Install Colab Reproduce Results Paper Blog Examples Practical Tips Podcast Citation Verbalized Sampling (VS) is a simple prompting strategy that improves LLM diversity by 2-3x. It works by asking the model to generate multiple responses with their probabilities, then sampling from this distribution. VS is training-free (works with any LLM via prompting), model-agnostic (GPT, Claude, Gemini, Llama, etc.), orthogonal to temperature , and effective across tasks like creative writing , social simulation , synthetic data generation , and open-ended QA . Quickstart To try Verbalized Sampling, just copy and paste this into any chatbot (ChatGPT, Claude, Gemini, etc.). For best results, we recommend starting with models like GPT-5, Claude 4 Opus, and Gemini 2.5 Pro: If you want more stories, just respond and ask Tell me 5 more stories in the same conversation. For even better results, paste this into a system prompt instead: For practical tips on getting the most out of this technique and general troubleshooting, please refer to this X/Twitter thread! Installation and Usage For all of the above in a single function call, the ability to automatically sample from the verbalized responses, and LangChain integration, use our Python package: Colab Notebooks Here are some examples of how to use verbalized sampling for generating more diverse stories, ideas, images, and how to use our package: Notebook","default_branch":null,"files":null,"tree":[],"storefront":"/r/CHATS-lab","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/CHATS-lab/verbalized-sampling/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}