Verbalized-Sampling: Random-Number-Generator
0
66 commits
2 linked in READMEs
updated Oct 29, 2025
This dataset evaluates the effectiveness of Verbalized Sampling (VS) in generating uniform random distributions, a task where LLMs typically exhibit significant mode collapse. From the paper Verbalized Sampling: How to Mitigate Mode Collapse and Unlock LLM Diversity.
The Random Number Generator (RNG) dataset contains responses from various state-of-the-art LLMs asked to perform simple random generation tasks, such as rolling a fair six-sided dice. This dataset is crucial for evaluating:
Each config represents a different prompting method:
Direct: Standard prompting without special instructions (1 sample)CoT: Direct prompting with chain-of-thought (1 sample)Sequence: Sequential verbalized generation (5 samples)Multi-turn: Multi-turn verbalized sampling (5 samples)VS-Standard: Structured output with explicit probabilities (5 samples)VS-CoT: Verbalized Sampling with chain-of-thought reasoning (5 samples)VS-Multi: Combined verbalized sampling approach (5 samples)Each split represents a different language model:
gpt_4_1: GPT-4.1gpt_4_1_mini: GPT-4.1-miniclaude_4_sonnet: Claude-4-Sonnetdeepseek_r1: DeepSeek-R1gemini_2_5_pro: Gemini-2.5-Progemini_2_5_flash: Gemini-2.5-Flasho3: o3 from OpenAIqwen3-235b: Qwen3 235B A22B Instruct 2507Each example contains:
prompt (string): The random generation task (e.g., "Roll a fair six-sided dice. Return ONLY the integer result (1-6), with no explanation or extra text.")responses (string): JSON-encoded list of response objects, each containing:
text (string): The generated responseprobability (float): The model's verbalized probability for this responsemodel (string): The model identifier (matches the split name)from datasets import load_dataset
# Load a specific method configuration
dataset = load_dataset("CHATS-Lab/Verbalized-Sampling-Random-Number-Generator", "Multi-turn")
# Access data from a specific model
gpt_data = dataset["gpt_4_1"]
print(f"Number of examples: {len(gpt_data)}")
import json
from collections import Counter
# Analyze distribution of dice rolls
all_rolls = []
for example in gpt_data:
responses = json.loads(example["responses"])
for resp in responses:
all_rolls.append(int(resp["text"]))
# Calculate distribution
distribution = Counter(all_rolls)
print("Distribution:", dict(sorted(distribution.items())))
# Calculate uniformity (ideal is 1/6 β 0.167 for each outcome)
import numpy as np
values = [distribution.get(i, 0) for i in range(1, 7)]
uniformity = np.std(values) / np.mean(values) # Lower is more uniform
print(f"Coefficient of variation: {uniformity:.3f}")
from datasets import load_dataset
import json
import numpy as np
def calculate_entropy(responses):
"""Calculate Shannon entropy of the distribution"""
from collections import Counter
import math
values = []
for example in responses:
parsed = json.loads(example["responses"])
values.extend([int(r["text"]) for r in parsed])
counts = Counter(values)
total = sum(counts.values())
probs = [c/total for c in counts.values()]
return -sum(p * math.log2(p) for p in probs if p > 0)
# Compare Direct vs Multi-turn
direct_data = load_dataset("CHATS-Lab/Verbalized-Sampling-Random-Number-Generator", "Direct")["gpt_4_1"]
multiturn_data = load_dataset("CHATS-Lab/Verbalized-Sampling-Random-Number-Generator", "Multi-turn")["gpt_4_1"]
print(f"Direct entropy: {calculate_entropy(direct_data):.3f}")
print(f"Multi-turn entropy: {calculate_entropy(multiturn_data):.3f}")
print(f"Ideal entropy (uniform): {np.log2(6):.3f}")
Random generation tasks were carefully designed to have known uniform distributions, allowing for objective evaluation of model behavior.
For each (model, method) combination:
No human annotations are present in this dataset. All data consists of model-generated outputs.
This dataset reveals inherent biases in LLMs:
These biases are intentionally preserved in the dataset to demonstrate the effectiveness of Verbalized Sampling in mitigating them.
This Agreement contains the terms and conditions that govern your access and use of the Verbalized-Sampling-Random-Number-Generator Dataset. You may not use this dataset if you do not accept this Agreement. By accessing this dataset, you hereby agree to the terms of the Agreement.
Key Terms:
Subject to your compliance with these terms, we grant you a limited, non-exclusive, non-transferable, non-sublicensable license to use the dataset for research, development, and improvement of software, algorithms, machine learning models, techniques, and technologies for both research and commercial purposes.
Limitation of Liability: IN NO EVENT WILL WE BE LIABLE FOR ANY CONSEQUENTIAL, INCIDENTAL, EXEMPLARY, PUNITIVE, SPECIAL, OR INDIRECT DAMAGES ARISING OUT OF OR RELATING TO THIS AGREEMENT.
If you use this dataset in your research, please cite:
@misc{zhang2025verbalizedsamplingmitigatemode,
title={Verbalized Sampling: How to Mitigate Mode Collapse and Unlock LLM Diversity},
author={Jiayi Zhang and Simon Yu and Derek Chong and Anthony Sicilia and Michael R. Tomz and Christopher D. Manning and Weiyan Shi},
year={2025},
eprint={2510.01171},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2510.01171}
}
For questions or issues, please open an issue on our GitHub repository.
Verbalized-Sampling: Random-Number-Generator
0
66 commits
2 linked in READMEs
updated Oct 29, 2025
This dataset evaluates the effectiveness of Verbalized Sampling (VS) in generating uniform random distributions, a task where LLMs typically exhibit significant mode collapse. From the paper Verbalized Sampling: How to Mitigate Mode Collapse and Unlock LLM Diversity.
The Random Number Generator (RNG) dataset contains responses from various state-of-the-art LLMs asked to perform simple random generation tasks, such as rolling a fair six-sided dice. This dataset is crucial for evaluating:
Each config represents a different prompting method:
Direct: Standard prompting without special instructions (1 sample)CoT: Direct prompting with chain-of-thought (1 sample)Sequence: Sequential verbalized generation (5 samples)Multi-turn: Multi-turn verbalized sampling (5 samples)VS-Standard: Structured output with explicit probabilities (5 samples)VS-CoT: Verbalized Sampling with chain-of-thought reasoning (5 samples)VS-Multi: Combined verbalized sampling approach (5 samples)Each split represents a different language model:
gpt_4_1: GPT-4.1gpt_4_1_mini: GPT-4.1-miniclaude_4_sonnet: Claude-4-Sonnetdeepseek_r1: DeepSeek-R1gemini_2_5_pro: Gemini-2.5-Progemini_2_5_flash: Gemini-2.5-Flasho3: o3 from OpenAIqwen3-235b: Qwen3 235B A22B Instruct 2507Each example contains:
prompt (string): The random generation task (e.g., "Roll a fair six-sided dice. Return ONLY the integer result (1-6), with no explanation or extra text.")responses (string): JSON-encoded list of response objects, each containing:
text (string): The generated responseprobability (float): The model's verbalized probability for this responsemodel (string): The model identifier (matches the split name)from datasets import load_dataset
# Load a specific method configuration
dataset = load_dataset("CHATS-Lab/Verbalized-Sampling-Random-Number-Generator", "Multi-turn")
# Access data from a specific model
gpt_data = dataset["gpt_4_1"]
print(f"Number of examples: {len(gpt_data)}")
import json
from collections import Counter
# Analyze distribution of dice rolls
all_rolls = []
for example in gpt_data:
responses = json.loads(example["responses"])
for resp in responses:
all_rolls.append(int(resp["text"]))
# Calculate distribution
distribution = Counter(all_rolls)
print("Distribution:", dict(sorted(distribution.items())))
# Calculate uniformity (ideal is 1/6 β 0.167 for each outcome)
import numpy as np
values = [distribution.get(i, 0) for i in range(1, 7)]
uniformity = np.std(values) / np.mean(values) # Lower is more uniform
print(f"Coefficient of variation: {uniformity:.3f}")
from datasets import load_dataset
import json
import numpy as np
def calculate_entropy(responses):
"""Calculate Shannon entropy of the distribution"""
from collections import Counter
import math
values = []
for example in responses:
parsed = json.loads(example["responses"])
values.extend([int(r["text"]) for r in parsed])
counts = Counter(values)
total = sum(counts.values())
probs = [c/total for c in counts.values()]
return -sum(p * math.log2(p) for p in probs if p > 0)
# Compare Direct vs Multi-turn
direct_data = load_dataset("CHATS-Lab/Verbalized-Sampling-Random-Number-Generator", "Direct")["gpt_4_1"]
multiturn_data = load_dataset("CHATS-Lab/Verbalized-Sampling-Random-Number-Generator", "Multi-turn")["gpt_4_1"]
print(f"Direct entropy: {calculate_entropy(direct_data):.3f}")
print(f"Multi-turn entropy: {calculate_entropy(multiturn_data):.3f}")
print(f"Ideal entropy (uniform): {np.log2(6):.3f}")
Random generation tasks were carefully designed to have known uniform distributions, allowing for objective evaluation of model behavior.
For each (model, method) combination:
No human annotations are present in this dataset. All data consists of model-generated outputs.
This dataset reveals inherent biases in LLMs:
These biases are intentionally preserved in the dataset to demonstrate the effectiveness of Verbalized Sampling in mitigating them.
This Agreement contains the terms and conditions that govern your access and use of the Verbalized-Sampling-Random-Number-Generator Dataset. You may not use this dataset if you do not accept this Agreement. By accessing this dataset, you hereby agree to the terms of the Agreement.
Key Terms:
Subject to your compliance with these terms, we grant you a limited, non-exclusive, non-transferable, non-sublicensable license to use the dataset for research, development, and improvement of software, algorithms, machine learning models, techniques, and technologies for both research and commercial purposes.
Limitation of Liability: IN NO EVENT WILL WE BE LIABLE FOR ANY CONSEQUENTIAL, INCIDENTAL, EXEMPLARY, PUNITIVE, SPECIAL, OR INDIRECT DAMAGES ARISING OUT OF OR RELATING TO THIS AGREEMENT.
If you use this dataset in your research, please cite:
@misc{zhang2025verbalizedsamplingmitigatemode,
title={Verbalized Sampling: How to Mitigate Mode Collapse and Unlock LLM Diversity},
author={Jiayi Zhang and Simon Yu and Derek Chong and Anthony Sicilia and Michael R. Tomz and Christopher D. Manning and Weiyan Shi},
year={2025},
eprint={2510.01171},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2510.01171}
}
For questions or issues, please open an issue on our GitHub repository.