diverse-content-gen
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDiverse Content Generation using Verbalized Sampling
基于Verbalized Sampling(VS)的多样化内容生成
Overview
概述
This skill teaches agents how to use Verbalized Sampling (VS) - a research-backed prompting technique that dramatically increases output diversity (1.6-2.1× improvement) without sacrificing quality.
The Problem: Standard aligned LLMs suffer from "mode collapse" - they generate overly similar, safe, predictable outputs because of typicality bias in training data.
The Solution: Instead of asking for single instances ("write a blog post"), VS prompts the model to verbalize a probability distribution over multiple responses ("generate 5 blog post ideas with their probabilities").
Core Principle: Different prompt types collapse to different modes. Distribution-level prompts recover the diverse base model distribution, while instance-level prompts collapse to the most typical output.
本技能将指导Agent如何使用Verbalized Sampling(VS)——这是一种有研究支持的提示词技术,可在不牺牲质量的情况下大幅提升输出多样性(提升1.6-2.1倍)。
存在的问题: 经过对齐的标准大语言模型(LLMs)存在“模式坍缩”问题——由于训练数据中的典型性偏差,它们生成的内容过于相似、保守且可预测。
解决方案: 不同于要求生成单个实例(如“写一篇博客文章”),VS技术会提示模型针对多个输出结果描述其概率分布(如“生成5个博客文章创意及其对应概率”)。
核心原理: 不同类型的提示词会导向不同的输出模式。分布级提示词能够还原基础模型的多样化分布,而实例级提示词则会坍缩为最典型的输出结果。
Workflow Decision Tree
工作流决策树
Detect user intent, route to appropriate reference:
| User Request Pattern | Route To | Description |
|---|---|---|
| "Generate diverse [content]" | | Learn VS basics, prompt templates, execution |
| "Write 5 blog posts / captions / ideas" | | Task-specific workflows pre-configured |
| "Need higher quality" or "too wild" | | VS-CoT, VS-Multi, parameter tuning |
| "Save to file" or "batch process 50 items" | | VS + File tools, batch workflows |
| "VS outputs too similar" or errors | | Common pitfalls and solutions |
| "Which model works best?" | | Benchmarks, model compatibility |
Default workflow: Load first, then load additional references as needed.
vs-core-technique.md检测用户意图,路由至对应参考文档:
| 用户请求模式 | 路由至 | 描述 |
|---|---|---|
| “生成多样化的[内容]” | | 学习VS基础原理、提示词模板及执行方法 |
| “写5篇博客文章/文案/创意” | | 已预配置的特定任务工作流 |
| “需要更高质量”或“内容过于天马行空” | | VS-CoT、VS-Multi、参数调优 |
| “保存到文件”或“批量处理50个内容” | | VS与文件工具结合、批量工作流 |
| “VS输出内容过于相似”或出现错误 | | 常见问题及解决方案 |
| “哪个模型效果最好?” | | 基准测试、模型兼容性 |
默认工作流: 先加载,再根据需要加载其他参考文档。
vs-core-technique.mdWhen to Use This Skill
何时使用本技能
Trigger Scenarios
触发场景
Use VS when user requests:
- "Give me multiple variations/options/ideas"
- "I need diverse [content type]"
- "Brainstorm several approaches to..."
- "Generate different angles for..."
- "Avoid repetitive/similar outputs"
Use VS for these content types:
- Creative writing (blog posts, stories, poems, scripts)
- Marketing (campaign ideas, taglines, ad copy, social captions)
- Product content (descriptions, feature bullets, value props)
- Ideation (brainstorming, exploration, strategy options)
- Open-ended QA (tasks with multiple valid answers)
DON'T use VS for:
- Single-answer factual questions
- Tasks requiring deterministic output
- When user explicitly wants "the best" single answer
- Real-time low-latency applications
当用户提出以下请求时使用VS:
- “给我多种变体/选项/创意”
- “我需要多样化的[内容类型]”
- “头脑风暴几种不同的方案...”
- “生成...的不同角度”
- “避免重复/相似的输出内容”
VS适用于以下内容类型:
- 创意写作(博客文章、故事、诗歌、脚本)
- 营销内容(活动创意、标语、广告文案、社交媒体文案)
- 产品内容(描述、特性要点、价值主张)
- 创意构思(头脑风暴、探索、策略选项)
- 开放式问答(存在多个有效答案的任务)
请勿在以下场景使用VS:
- 单一答案的事实性问题
- 需要确定性输出的任务
- 用户明确要求“最佳”单一答案时
- 实时低延迟应用场景
Quick Start (30-Second Version)
快速入门(30秒版)
For agents who need VS immediately:
供需要立即使用VS的Agent参考:
1. Detect Need
1. 检测需求
User wants multiple variations → Use VS
用户需要多种变体 → 使用VS
2. Basic VS Prompt Template
2. 基础VS提示词模板
Generate {k} responses to: {user_request}
Return JSON format with key "responses" (list of dicts).
Each dict must include:
• text: the response string only
• probability: estimated probability (0.0-1.0)
Give ONLY the JSON object, no extra text.Generate {k} responses to: {user_request}
Return JSON format with key "responses" (list of dicts).
Each dict must include:
• text: the response string only
• probability: estimated probability (0.0-1.0)
Give ONLY the JSON object, no extra text.3. Standard Parameters
3. 标准参数
- k = 5 (candidates per call)
- temperature = 0.8
- threshold = 0.10 (optional, for more diversity)
- k = 5(每次调用生成的候选内容数量)
- temperature = 0.8
- threshold = 0.10(可选,用于提升多样性)
4. Process Output
4. 处理输出
python
import json
data = json.loads(llm_output)
candidates = data["responses"]python
import json
data = json.loads(llm_output)
candidates = data["responses"]Present to user ranked by probability
Present to user ranked by probability
**For detailed instructions:** Load `references/vs-core-technique.md`
---
**如需详细说明:** 加载`references/vs-core-technique.md`
---Progressive Learning Path
进阶学习路径
Recommended loading sequence:
推荐加载顺序:
Level 1: Basics (Required)
第一级:基础(必学)
- Start here:
references/vs-core-technique.md- VS theory and why it works
- Copy-paste ready prompt templates
- Step-by-step execution workflow
- Output parsing and presentation
- 从这里开始:
references/vs-core-technique.md- VS理论及工作原理
- 可直接复制使用的提示词模板
- 分步执行工作流
- 输出解析与展示
Level 2: Task-Specific (Choose based on use case)
第二级:特定任务(根据使用场景选择)
- Load:
references/task-workflows.md- Blog post ideas workflow
- Social media captions workflow
- Campaign/strategy ideas workflow
- Story/narrative generation workflow
- 加载:
references/task-workflows.md- 博客文章创意工作流
- 社交媒体文案工作流
- 活动/策略创意工作流
- 故事/叙事生成工作流
Level 3: Advanced (On-demand)
第三级:进阶(按需加载)
- When needed:
- Higher quality needed: (VS-CoT, VS-Multi)
references/advanced-techniques.md - File operations: (Write, batch processing)
references/tool-integration.md - Issues/errors: (Pitfalls & fixes)
references/troubleshooting.md - Model selection: (Benchmarks)
references/research-findings.md
- Higher quality needed:
- 有需要时加载:
- 需要更高质量: (VS-CoT、VS-Multi)
references/advanced-techniques.md - 文件操作: (结合文件工具、批量处理)
references/tool-integration.md - 问题/错误: (常见问题及修复方案)
references/troubleshooting.md - 模型选择: (基准测试)
references/research-findings.md
- 需要更高质量:
Quick Reference Card
快速参考卡
Copy this for quick lookup:
| Parameter | Default Value | When to Adjust |
|---|---|---|
| k (candidates) | 5 | Use 3 for quick, 10 for exploration |
| Temperature | 0.7-1.0 | Combine with VS for extra diversity |
| Probability threshold | 0.10 (optional) | Lower (0.01) for more creative outputs |
Troubleshooting shortcuts:
- Outputs too similar? → Lower threshold OR increase k OR load
advanced-techniques.md - Quality too low? → VS-Multi workflow (see )
advanced-techniques.md - JSON parsing errors? → Emphasize "ONLY JSON" OR use regex extraction
- Not sure which model? → Load
research-findings.md
Quality checklist before presenting:
- Diversity achieved (different angles/styles)
- Quality maintained (baseline standards)
- User intent matched
- Clean formatting (no JSON artifacts)
可复制用于快速查阅:
| 参数 | 默认值 | 调整时机 |
|---|---|---|
| k(候选内容数量) | 5 | 快速生成用3个,深度探索用10个 |
| Temperature | 0.7-1.0 | 与VS结合使用以提升多样性 |
| 概率阈值 | 0.10(可选) | 降低至0.01以获得更具创意的输出 |
故障排除快捷方式:
- 输出内容过于相似? → 降低阈值或增加k值,或加载
advanced-techniques.md - 内容质量过低? → 使用VS-Multi工作流(详见)
advanced-techniques.md - JSON解析错误? → 强调“仅返回JSON”或使用正则表达式提取
- 不确定用哪个模型? → 加载
research-findings.md
展示前的质量检查清单:
- 已实现多样性(不同角度/风格)
- 质量达标(符合基线标准)
- 匹配用户意图
- 格式整洁(无JSON残留)
Resources
资源
This skill uses progressive disclosure for optimal token efficiency:
本技能采用渐进式披露方式,以优化Token使用效率:
references/
references/
Documentation loaded on-demand based on agent needs:
- vs-core-technique.md - Core VS concepts, prompt templates, execution steps
- task-workflows.md - Pre-configured workflows for common content types
- advanced-techniques.md - VS-CoT, VS-Multi, parameter tuning, refinement
- tool-integration.md - Combining VS with file tools, batch processing
- troubleshooting.md - Common pitfalls and solutions
- research-findings.md - Performance benchmarks, model compatibility data
Pattern: Agent loads SKILL.md first (routing), then loads specific references as needed during execution.
根据Agent需求按需加载的文档:
- vs-core-technique.md - VS核心概念、提示词模板、执行步骤
- task-workflows.md - 针对常见内容类型的预配置工作流
- advanced-techniques.md - VS-CoT、VS-Multi、参数调优、内容优化
- tool-integration.md - VS与文件工具结合、批量处理
- troubleshooting.md - 常见问题及解决方案
- research-findings.md - 性能基准测试、模型兼容性数据
模式: Agent先加载SKILL.md(用于路由),然后在执行过程中按需加载特定参考文档。
Examples in Context
场景示例
Example 1: Simple Brainstorming
示例1:简单头脑风暴
User: "Give me 5 tagline ideas for a coffee shop"
Agent workflow:
- Detect: "5 ideas" → VS needed
- Load: (if not already loaded)
vs-core-technique.md - Execute: VS prompt with k=5
- Parse & present: 5 diverse taglines
用户: “给我5个咖啡店的标语创意”
Agent工作流:
- 检测:“5个创意” → 需要使用VS
- 加载:(若尚未加载)
vs-core-technique.md - 执行:使用k=5的VS提示词
- 解析并展示:5个多样化的标语
Example 2: Production Content
示例2:生产级内容
User: "Write 10 blog post ideas about AI, I need them saved to a file"
Agent workflow:
- Detect: "10 ideas" + "saved to file" → VS + file tools
- Load: +
vs-core-technique.mdtool-integration.md - Execute: VS with k=5, make 2 calls
- Process: Format as markdown
- Write: Use Write tool to save file
用户: “写10个关于AI的博客文章创意,我需要保存到文件中”
Agent工作流:
- 检测:“10个创意” + “保存到文件” → VS+文件工具
- 加载:+
vs-core-technique.mdtool-integration.md - 执行:使用k=5的VS,调用2次
- 处理:格式化为markdown
- 保存:使用Write工具保存到文件
Example 3: Quality Refinement
示例3:质量优化
User: "These are good but need more polish for production use"
Agent workflow:
- Detect: Quality improvement needed
- Load:
advanced-techniques.md - Execute: VS-Multi workflow (initial VS → user selects → refine)
- Deliver: Polished output
Ready to start? Load to begin using VS.
references/vs-core-technique.md用户: “这些内容不错,但需要更精细化以用于生产环境”
Agent工作流:
- 检测:需要提升质量
- 加载:
advanced-techniques.md - 执行:VS-Multi工作流(初始VS生成→用户选择→优化)
- 交付:精细化后的输出内容
准备开始了吗? 加载即可开始使用VS。
references/vs-core-technique.md