verbalized-sampling
Increase LLM output diversity without retraining by asking the model to generate N responses with probabilities, then sampling from that distribution.
Skill by V-Sekai-fire
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/v-sekai-fire-verbalized-sampling
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: data, ml, agent-building
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/verbalized-sampling
What's inside
- Skill name
verbalized-sampling- Description
- Increase LLM output diversity without retraining by asking the model to generate N responses with probabilities, then sampling from that distribution. Use when a single prompt yields repetitive or mode-collapsed outputs (creative generation, synthetic data, dialogue variety).
- License
- MIT
- Metadata
- author: V-Sekai-fire
- Instructions
- 139 lines in SKILL.md · view on GitHub
Before installing
- Instructions call the network
Files (2)
- SKILL.md
- references.bib · references/
SKILL.md (first lines)
# SOP: Verbalized sampling — diversity without retraining
How to apply verbalized sampling \[zhang2025verbalized\] to any Claude prompt
so that outputs span the full distribution rather than collapsing to the most
probable response.
## Background
After alignment training, LLMs exhibit **mode collapse**: repeated calls to
the same prompt cluster around a narrow peak of high-probability outputs.
Verbalized sampling sidesteps this at inference time by asking the model to
explicitly enumerate `N` options and assign each a probability. The caller
then draws one option from that distribution with a weighted random draw —
no fine-tuning required, no temperature hacks, no model changes.
Papers report **1.6–2.1× diversity gain** (distinct-n-gram ratio) over
standard prompting across creative tasks.
## 1. Rewrite the prompt
Prepend or append the following instruction to any existing prompt:
```
Generate {N} distinct responses to the task below and assign each a
probability (0 < p_i ≤ 1, ∑p_i = 1.0) reflecting how likely that response
is relative to the others. Return JSON with this schema:
{"samples": [{"response": "<text>", "weight": <float>}, ...]}
Task: {original_prompt}
```
Replace `{N}` with the desired candidate count (5 is a good default).
Replace `{original_prompt}` with the original task text verbatim.
## 2. Call the model
Use `claude-opus-4-7` with `output_config` forcing JSON schema compliance so
the weighted list is machine-readable without post-hoc parsing:
```sh
curl https://api.anthropic.com/v1/messages \
-H "Content-Type: application/json" \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-d '{
"model": "claude-opus-4-7",
"max_tokens": 4096,
"output_config": {
"format": {
"type": "json_schema",
"schema": {
"type": "object",
"properties": {
"samples": {
"type": "array",
"items": {
"type": "object",
"properties": {
"response": {"type": "string"},
"weight": {"type": "number"}
},
"required": ["response", "weight"],
"additionalProperties": false
}
}
},
"required": ["samples"],
"additionalProperties": false
}
}
},
"messages": [{"role": "user", "content": "<verbalized prompt from step 1>"}]
}'
```
Cache the system prompt if it is large and stable — add
`"cache_control": {"type": "ephemeral"}` to the last system text block.
## 3. Sample from the distribution
Parse `samples`, normalise weights in case they do not sum exactly to 1.0,
then draw one entry:
```python
import json, random
data = json.loads(api_response_text) # text block from response
items = data["samples"]
total = sum(s["weight"] for s in items)
probs = [s["weight"] / total for s in items]
chosen = random.choices(items, weights=probs, k=1)[0]["response"]
print(chosen)
```
For batch synthetic-data generation, repeat step 2–3 `M` times; each call
independently samples a different region of the distribution.
## 4. Measure diversity (optional gate)
Compare verbalized-sampling outputs against standard outputs using
distinct-n-gram ratio. Expect ≥1.5× improvement on creative tasks:
```python
from collections import Counter
def distinct_ngrams(texts, n=2):
all_ng, uniq_ng = 0, set()
for t in texts:
toks = t.split()
ngs = [tuple(toks[i:i+n]) for i in range(len(toks)-n+1)]
all_ng += len(ngs)
uniq_ng |= set(ngs)
return len(uniq_ng) / max(all_ng, 1)
baseline = distinct_ngrams(standard_outputs)
verbalized = distinct_ngrams(verbalized_outputs)
print(f"diversity ratio: {verbalized/baseline:.2f}x") # target ≥ 1.5
```From V-Sekai-fire/contract-multiplayer-fabric-skills, MIT.
More from V-Sekai-fire/contract-multiplayer-fabric-skills
- 0.414score
local-build-check
V-Sekai-fire
Build multiplayer-fabric-godot locally to reproduce CI failures when GitHub Actions is clogged.
SkillDFreshness: DClaude Code +9 - 0.414score
simplify-then-add-lightness-audit
V-Sekai-fire
Run a verbalized-sampling audit of the multiplayer-fabric monorepo against the Simplify-Then-Add-Lightness ADR.
SkillDFreshness: DClaude Code +9 - 0.411score
ci-check
V-Sekai-fire
Verify gitassembly branch references are consistent and no branch in multiplayer-fabric-godot has failing GitHub Actions runs.
SkillDFreshness: DClaude Code +9 - 0.409score
extract-to-submodule
V-Sekai-fire
Pull a vendored directory out of an existing repo, publish it as a standalone GitHub repo under V-Sekai-fire, and wire it back in as a git submodule.
SkillDFreshness: DClaude Code +9 - 0.409score
local-sim-stack
V-Sekai-fire
Run the multiplayer-fabric Quest 3 smoke test locally on macOS using Meta XR Simulator v85 + Godot.
SkillDFreshness: DClaude Code +9 - 0.409score
assembly-conflict
V-Sekai-fire
Fix merge conflicts that stop the multiplayer-fabric-merge assembler.
SkillDFreshness: DClaude Code +9 - 0.409score
branch-versioning
V-Sekai-fire
Create versioned branches (feat/foo-001, feat/foo-002) instead of force-pushing.
SkillDFreshness: DClaude Code +9 - 0.409score
cloudflare-networking
V-Sekai-fire
Set up Cloudflare DNS, SSL, and direct port-443 serving for multiplayer-fabric.
SkillDFreshness: DClaude Code +9 - 0.407score
platform-header-check
V-Sekai-fire
Verify a C/C++ header in multiplayer-fabric-godot parses cleanly on macOS (clang), Windows (mingw), and Web (emscripten) without a full Godot build.
SkillDFreshness: DClaude Code +9 - 0.406score
dependency-audit
V-Sekai-fire
Review a plan or TODO for hidden risks using known knowns, known unknowns, and unknown unknowns categories.
SkillDFreshness: DClaude Code +9 - 0.406score
sync-check
V-Sekai-fire
Verify all submodules and the root multiplayer-fabric repo are fully pushed to origin with no unpushed commits.
SkillDFreshness: DClaude Code +9 - 0.406score
sync-submodule-pointers
V-Sekai-fire
Advance the multiplayer-fabric monorepo's submodule pointers to match the current HEAD of each submodule and push.
SkillDFreshness: DClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Apr 20, 2026 (6 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from V-Sekai-fire
- 0.414score
local-build-check
V-Sekai-fire
Build multiplayer-fabric-godot locally to reproduce CI failures when GitHub Actions is clogged.
SkillDFreshness: DClaude Code +9 - 0.414score
simplify-then-add-lightness-audit
V-Sekai-fire
Run a verbalized-sampling audit of the multiplayer-fabric monorepo against the Simplify-Then-Add-Lightness ADR.
SkillDFreshness: DClaude Code +9 - 0.411score
ci-check
V-Sekai-fire
Verify gitassembly branch references are consistent and no branch in multiplayer-fabric-godot has failing GitHub Actions runs.
SkillDFreshness: DClaude Code +9 - 0.409score
extract-to-submodule
V-Sekai-fire
Pull a vendored directory out of an existing repo, publish it as a standalone GitHub repo under V-Sekai-fire, and wire it back in as a git submodule.
SkillDFreshness: DClaude Code +9 - 0.409score
branch-versioning
V-Sekai-fire
Create versioned branches (feat/foo-001, feat/foo-002) instead of force-pushing.
SkillDFreshness: DClaude Code +9 - 0.409score
cloudflare-networking
V-Sekai-fire
Set up Cloudflare DNS, SSL, and direct port-443 serving for multiplayer-fabric.
SkillDFreshness: DClaude Code +9
Cite this page
verbalized-sampling skill. Agent Mart. https://agentmart.dev/skills/v-sekai-fire-verbalized-sampling (last updated 2026-10-24)