#79 · Primary category: Prompt Engineering Tools

verbalized-sampling

claude creative-writing dialogue-simulation diversity gemini gpt large-language-models llm mode-collapse prompt-engineering python qwen sampling synthetic-data

Training-free prompting strategy that boosts LLM diversity 2-3x by sampling from verbalized probabilities, model-agnostic for creative writing and synthetic data.

Project last updated:01/03/26

GitHub Stars

802

Forks

84

Contributors

5

License

Apache-2.0

Why we included this project

Anyone who has watched an LLM give back the same safe answer no matter how the prompt is phrased will recognize the problem this library targets. Verbalized Sampling asks the model to produce several candidate responses with a numeric probability attached to each, then samples from that verbalized distribution instead of leaning on temperature. Because it is a prompting technique, it needs no fine-tuning and works with GPT, Claude, Gemini, Llama, and other models, so it slots into existing pipelines without much friction. The Python package wraps the flow in a single call, includes LangChain integration, and provides scripts to reproduce the paper's creative-writing, dialogue-simulation, and synthetic-data experiments, which makes it a practical way to get more variety out of models a team already runs.

Articles for this project

No articles for this project yet.

To suggest a topic or contribute an article, contact us.

Related projects in this category