Can you clarify for me the process of collecting data for RLHF? As I understand we have an LLM that generates a text for a giving prompt, and we should have different texts for the same query prompt to rank these texts based on human preferences. How we generate different texts for the same query? Do we make that via temperature of an LLM or we use different models?
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
You've captured the core idea perfectly! Let me clarify the data collection process for RLHF step-by-step, focusing specifically on how we generate different responses for the same prompt:
RLHF Data Collection Process (Simplified)
Prompt Collection
First, gather a diverse set of prompts (e.g., user queries, instructions).
Response Generation
For each prompt, generate multiple candidate responses. Key methods to create variation:
Temperature Sampling:
Use the same base LLM but generate responses at different temperatures.
Example: For prompt "Explain quantum physics", generate 4 responses:
Temp=0.3 (conservative)
Temp=0.7 (balanced)
Temp=1.0 (creative)
Temp=1.5 (high-risk/high-reward)
Sampling Techniques:
Top-p (nucleus) sampling
Beam search variants
Explicitly seed different random seeds
Model Variants (Less Common):
Occasionally use slightly different fine-tuned versions of the same base model, but this introduces complexity.
Human Annotation
Present pairs/groups of responses to humans for ranking:
Pairwise Comparison: "Is Response A or Response B better for this prompt?"
Ranking: "Order these 4 responses from best to worst"
Absolute Scoring: "Rate Response A on 1-5 scale" (less common)
Dataset Construction
Format collected preferences into: (prompt, chosen_response, rejected_response) pairs
or (prompt, response_rankings)
Key Clarifications
1. Generating Diverse Responses
Primary Method: Temperature sampling with a single base model (e.g., the initial SFT model).
Why one model?
Using different models would introduce confounding variables (e.g., "Is this response better because of content or model capability?"). Consistency matters.
Temperature Ranges:
Typically 0.2 → 1.5. Higher temps yield more diverse (but riskier) outputs.
2. Real-World Workflow
For a single prompt P:
Generate 4-8 responses using:
python
responses = [llm.generate(P, temperature=t) for t in [0.3, 0.7, 1.0, 1.5]]
Humans compare/rank these responses.
Repeat for 10k-100k+ prompts.
3. Why Diversity Matters
Teaches the reward model to distinguish:
Factual accuracy
Conciseness vs. verbosity
Creativity vs. safety
Subtle alignment nuances
4. Edge Cases
For high-stakes domains (medical/legal), use constrained decoding instead of pure temperature.
Some advanced setups use reward-model-guided generation for hard prompts.
Example
Prompt: "Write a tweet about AI safety"
Generated Responses (same base model, different temps):
(Temp=0.3) "AI safety is important for responsible innovation."
(Temp=0.7) "Ensuring AI systems align with human values is crucial for our future."
(Temp=1.0) "As AI advances, we must prioritize safety measures to prevent unintended consequences. #ResponsibleAI"
(Temp=1.5) "Stop AI apocalypse now! Researchers must build safer algorithms before Skynet emerges. 🤖☠️"
Human Feedback:
Annotators might rank #3 > #2 > #1 > #4, creating training pairs like:
(prompt, #3, #4), (prompt, #2, #1), etc.
Why This Works
By using controlled variations (temperature) from one consistent model, we:
Isolate preference learning from capability differences
Capture diverse behaviors humans might prefer
Enable the reward model to learn relative quality, not absolute scores
This approach is foundational to how RLHF systems like ChatGPT learn nuanced preferences!