Feedback is a data pipeline, not a widget
A thumbs-up button on a chat response looks like a product detail and behaves like the intake valve of a training pipeline. The moments when users signal satisfaction or irritation are the only direct measurement of alignment you will ever get from real traffic, and they degrade exactly like any other data source if nobody owns their schema, their volume, or their quality. Teams that bolt feedback collection on without a downstream plan end up with a million unstructured ratings and nothing to train on.
The discipline starts by naming the consumers. Preference data feeds reward models and reranking sets. Free-text corrections become supervised fine-tuning examples. Aggregate rates become product metrics that gate releases. Each consumer needs a different shape of data, so the collection layer must capture context â the prompt, the completion, the model and prompt version, the conversation position, and a stable trace identifier â at the moment the signal arrives. Feedback joined to a completion you can no longer retrieve is worthless for training and barely useful for analysis.
The second principle is that feedback is biased by design. Users who are delighted or furious respond; the satisfied middle rarely does. Corrections come disproportionately from expert users whose phrasing differs from the median. Any training or evaluation built on this data inherits those skews unless you correct for them â through stratified sampling, through explicit weighting, or by pairing passive signals with active annotation for under-represented segments.
Designing collection so people actually respond
Response rates for inline feedback sit in the low single percent, and that is fine if the signal is clean. What suppresses quality more than volume is friction and ambiguity. A binary thumb next to the response outperforms a five-star widget, which outperforms a feedback form. Add a lightweight "what was wrong?" taxonomy â wrong facts, ignored instructions, bad tone, refused when it should not have â and you convert a bit of sentiment into a labelled defect class.
Timing matters. Asking immediately after the response captures reaction to that response; asking after the user's task completes captures whether the answer actually helped, which is a different and more valuable label. Some products do both, briefly, and treat disagreement between the two as its own interesting case: a liked answer that did not help is often a fluent wrong answer, the characteristic LLM failure.
| Signal | Shape | Training use | Main bias |
|---|---|---|---|
| Thumbs up/down | Binary | Preference pairs | Extreme users over-represented |
| Task completion | Binary event | Evaluation, reward proxy | Attribution ambiguity |
| Text correction | Paired text | Supervised fine-tuning | Expert-user phrasing |
| Side-by-side choice | Ranked pair | Reward model training | Position bias |
| Explicit rating | 1â5 ordinal | Monitoring, gating | Scale-use differences |
From raw signals to preference pairs
Reward training needs comparisons, not absolute scores. The cheapest genuine pairs come from two completions to the same prompt where one was positively rated and another in the same segment was not â careful construction required, because pairing across different prompts teaches the reward model about prompt difficulty rather than answer quality. The highest-quality pairs come from explicit side-by-side annotation, where a labeller chooses between two candidates for one prompt; these cost more and are reserved for the domains where errors are expensive.
Before anything is used for training, deduplicate near-identical prompts, drop conversations with unresolved tool errors, and filter pairs where the "preferred" answer contains factual claims unsupported by available context. A preference pair that rewards hallucination trains a reward model that will confidently prefer hallucination forever after.
import time
import uuid
from dataclasses import dataclass, field
@dataclass
class FeedbackRecord:
trace_id: str
prompt: str
completion: str
model_version: str
prompt_version: str
signal: str # thumbs | correction | choice
value: object
segment: str = "default"
at: float = field(default_factory=time.time)
class PreferenceBuilder:
def __init__(self):
self.records: list[FeedbackRecord] = []
def add(self, record: FeedbackRecord) -> None:
self.records.append(record)
def pairs_from_contrast(self, min_segment_size: int = 4) -> list[dict]:
"""Pair positively and negatively rated completions of similar prompts."""
by_segment: dict[str, list[FeedbackRecord]] = {}
for r in self.records:
if r.signal == "thumbs":
by_segment.setdefault(r.segment, []).append(r)
pairs = []
for segment, rows in by_segment.items():
if len(rows) < min_segment_size:
continue
positive = [r for r in rows if r.value is True]
negative = [r for r in rows if r.value is False]
for pos in positive:
for neg in negative:
if pos.trace_id == neg.trace_id:
continue
if pos.model_version != neg.model_version:
continue
pairs.append({
"prompt": pos.prompt,
"chosen": pos.completion,
"rejected": neg.completion,
"segment": segment,
})
return pairs
def correction_examples(self) -> list[dict]:
return [
{
"prompt": r.prompt,
"incorrect": r.completion,
"correct": r.value["corrected"],
}
for r in self.records
if r.signal == "correction"
]
Guard against the trivial-pair problem: if every chosen answer is longer than every rejected answer, the reward model learns length preference, which is one of the most well-documented failure modes of reward modelling. Balance the pair set on length, tone markers, and format before training.
import math
class PairwiseRewardModel:
"""Scores completions; trained so chosen beats rejected per prompt."""
def __init__(self, scorer):
self.scorer = scorer
def score(self, prompt: str, completion: str) -> float:
return self.scorer(prompt, completion)
def preference_loss(self, chosen_scores: list[float],
rejected_scores: list[float]) -> float:
losses = []
for win, lose in zip(chosen_scores, rejected_scores):
margin = win - lose
losses.append(math.log(1.0 + math.exp(-margin)))
return sum(losses) / max(len(losses), 1)
def accuracy(self, chosen_scores: list[float],
rejected_scores: list[float]) -> float:
if not chosen_scores:
return 0.0
correct = sum(
1 for win, lose in zip(chosen_scores, rejected_scores) if win > lose
)
return correct / len(chosen_scores)
def kl_to_reference(self, policy_logprobs: list[float],
reference_logprobs: list[float]) -> float:
total = 0.0
for p, q in zip(policy_logprobs, reference_logprobs):
total += math.exp(p) * (p - q)
return total
The KL term is the leash. During policy optimisation it penalises drift from the reference model that produced the original, broadly competent behaviour; raising the coefficient makes the optimisation more conservative, lowering it lets the policy chase the reward model harder â usually into hacking.
Reward models: training and failure modes
A reward model is a classifier over pairs: it learns a scalar scoring function such that chosen completions score higher than rejected ones for the same prompt. The loss is a pairwise logistic objective over score differences, which is simple to implement and easy to get subtly wrong. Two failure modes dominate. Reward hacking â the optimised policy discovers surface features the reward model over-values, such as confident tone, lists, or particular openers, and produces them regardless of correctness. And distribution shift â the reward model was trained on yesterday's policy outputs and scores today's optimised outputs outside its experience, where its scores are meaningless.
Mitigations are operational rather than theoretical. Keep an held-out pair set the reward model never sees, monitor its accuracy there after every policy update, and maintain a red-team set of adversarial completions designed to score high while being wrong. Cap how far the policy may drift from the reference model, which bounds how far outside the reward model's training distribution the optimised outputs can travel.
Policy optimisation and the KL constraint
Reinforcement learning from human feedback adjusts the policy to maximise reward while a KL-divergence penalty keeps it near the reference model that produced the original, broadly competent behaviour. The penalty coefficient is the alignment dial: too low and the policy exploits the reward model into degenerate text; too high and nothing changes. Practically, teams sweep the coefficient and pick the point where reward rises while held-out quality metrics stay flat.
Modern alternatives â direct preference optimisation and its relatives â skip the separate reward model and the reinforcement learning loop entirely, optimising the policy directly on preference pairs. They are cheaper, stabler, and often sufficient; keep them on the table rather than treating PPO as the only path.
Closing the loop without waiting for a full RLHF run
Most teams will run full RLHF rarely. The weekly loop is different and still valuable: mine negative-feedback conversations for retrieval and prompt fixes, add corrected answers to a supervised fine-tuning set, update the few-shot examples inside system prompts with the highest-rated completions, and re-weight routing so the models that score best on each segment receive more traffic. These interventions take days rather than quarters, and they consume the same feedback corpus that a later RLHF run would use.
Metrics that tell you the loop is working
Track feedback rate per thousand conversations, positive ratio by segment, correction rate, and inter-annotator agreement on the side-by-side set. Then track the outcome metrics that justify the whole enterprise: change in task completion after a reward-informed prompt update, reduction in correction rate after a fine-tuning cycle, and reward-model accuracy on held-out pairs after each retraining. If feedback volume rises while those outcome metrics stay flat, the loop is collecting data and not learning â which is the single most common failure state, and the one these metrics exist to expose.
Common Mistakes
Storing feedback without the prompt, completion, and model version that produced it
Fix: Capture a trace identifier and join feedback to retrievable completions at the moment of the signal.
Building preference pairs across different prompts
Fix: Pair completions of the same or closely matched prompts so the reward model learns answer quality, not prompt difficulty.
Ignoring length bias in preference data
Fix: Balance chosen and rejected completions on length and format before training, and monitor for length-only reward.
Treating rising feedback volume as evidence the loop works
Fix: Pair volume metrics with outcome metrics like correction rate and task completion to prove learning is happening.
Key Takeaways
- Treat feedback as a versioned data pipeline: every signal joins to its prompt, completion, and model version at capture time.
- Design for the biases you will always have â extreme users, expert corrections â with stratification and weighting rather than hope.
- Reward training needs same-prompt comparisons; balance them on length and format to avoid teaching surface preferences.
- Reward models fail by hacking and by drift: hold out pair sets, run adversarial complements, and cap policy distance from the reference.
- The KL coefficient is the alignment dial; sweep it and pick the point where reward rises without held-out quality falling.
- You do not need full RLHF to benefit â weekly mining of negatives into prompts, retrieval, and fine-tuning data closes most of the loop.
- Judge the loop by outcome metrics, not by how many thumbs were collected.