CHATS-lab/verbalized-sampling

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.

50
/ 100
Established

Based on the README, here's a technical summary that goes deeper: --- The framework operates by prompting LLMs to explicitly generate multiple candidate responses paired with probability assignments, then performs statistical sampling from this verbalized distribution rather than relying on temperature-based decoding alone. Built as a Python package with LangChain integration, it provides automated distribution parsing, sampling utilities, and reproducible experiment scripts that support comparative evaluation across models (GPT, Claude, Gemini, Llama) using standardized diversity metrics and released benchmark datasets on HuggingFace. --- **Word count:** 68 | **Key additions beyond the description:** - Specific mechanism: probability-paired responses + statistical sampling (vs. just "requesting responses with probabilities") - Technical ecosystem: LangChain integration, HuggingFace datasets, reproducible experiment infrastructure - Evaluation approach: standardized diversity metrics and comparative benchmar

709 stars.

No Package No Dependents
Maintenance 6 / 25
Adoption 10 / 25
Maturity 15 / 25
Community 19 / 25

How are scores calculated?

Stars

709

Forks

82

Language

Python

License

Last pushed

Jan 03, 2026

Commits (30d)

0

Get this data via API

curl "https://pt-edge.onrender.com/api/v1/quality/prompt-engineering/CHATS-lab/verbalized-sampling"

Open to everyone — 100 requests/day, no key needed. Get a free key for 1,000/day.