5 exercises — Practice synthetic data and RLHF vocabulary in English: GANs, differential privacy, reward models, preference data, PPO, annotation, and data flywheel.
Core synthetic data & RLHF vocabulary clusters
Synthetic data: GAN (Generative Adversarial Network), diffusion model, synthetic tabular data, data augmentation
Data flywheel: production data, feedback loop, data pipeline, active learning, human-in-the-loop
0 / 12 completed
1 / 12
An ML engineer explains RLHF to a product team: "RLHF — Reinforcement Learning from Human Feedback — is how GPT-4 and Claude were aligned to be helpful and harmless. The pipeline has three stages. First: supervised fine-tuning on a curated dataset of prompt-response pairs. Second: train a reward model — show human raters two responses to the same prompt, they pick the better one; the reward model learns to predict human preference. Third: use RL (specifically PPO) to optimise the LLM to produce responses the reward model scores highly. The reward model is a proxy for human judgment." What is the role of the reward model in RLHF, and why is it trained on preference data rather than absolute ratings?
Reward model (RM): a model (usually a fine-tuned copy of the base LLM) trained to output a scalar score predicting how much a human would prefer a given response. Used as a proxy for human judgment during the RL phase. Why pairwise comparison? Absolute ratings (1-5 stars) have calibration problems — one rater's 4 is another's 3. Pairwise comparisons ("A is better than B") are more consistent and easier to agree on. RLHF vocabulary: Supervised Fine-Tuning (SFT): Stage 1. Fine-tune the base LLM on a dataset of high-quality prompt-response pairs. Creates the initial helpful model. Preference data: a dataset of (prompt, response_A, response_B, preference) tuples. Collected from human raters comparing responses. PPO (Proximal Policy Optimization): the RL algorithm used to update the LLM. Uses the reward model's scores as the reward signal. Adds a KL penalty to prevent the model from diverging too far from the SFT model. KL penalty: constrains how much the policy (LLM) can change from the reference model per step — prevents reward hacking. Reward hacking: the RL policy finds ways to score highly on the reward model without actually being more helpful. Constitutional AI (CAI): Anthropic's variant — uses AI feedback instead of (or in addition to) human feedback. DPO (Direct Preference Optimisation): trains directly on preference data without a separate RL stage. Simpler than PPO. In conversation: 'The reward model is the hardest part of RLHF. If it's miscalibrated or biased, the RL step amplifies those problems.'
2 / 12
A data scientist explains differential privacy to an engineering team: "Differential privacy (DP) gives a mathematical guarantee about privacy. An algorithm is epsilon-DP if adding or removing any single person's data changes the output distribution by at most e⁾ — a small factor. Lower epsilon means stronger privacy but less accuracy. We add calibrated noise (Laplace or Gaussian) to query outputs. Apple uses DP for keyboard and emoji usage analytics — they can learn aggregate patterns without seeing individual keystrokes. Epsilon less than 1 is considered strong privacy; epsilon around 10 is weak." What is k-anonymity and how does it differ from differential privacy?
k-anonymity: a dataset satisfies k-anonymity if every record is identical to at least k-1 others on the quasi-identifying attributes (age, zip code, gender). Example: k=3 means every row has at least 2 identical rows in the dataset. Weakness: l-diversity and t-closeness are extensions that address attacks on sensitive attributes even within an anonymous group. Differential privacy: a stronger, mathematically rigorous guarantee. Property of an algorithm, not a dataset. Guarantees: the output distribution changes by at most e⁾ when any single record is added/removed. Provably bounds what an adversary can infer about any individual. Privacy vocabulary: Epsilon (ε): the privacy budget. Small ε = strong privacy, high noise, less utility. Large ε = weak privacy, low noise, more utility. Sensitivity: how much a query's output can change when one record is added/removed. Determines how much noise to add. Laplace mechanism: adds Laplace-distributed noise calibrated to sensitivity/epsilon. Gaussian mechanism: adds Gaussian noise. Used with (ε, δ)-DP. Local DP: noise added on the user's device before sending data. Used by Apple and Google. Central DP: noise added by a trusted aggregator. Less noise needed for the same privacy guarantee. Federated learning: train models on decentralised devices without centralising raw data. Often combined with DP. In conversation: 'k-anonymity is a good first step for releasing datasets, but it's not a guarantee — it can be broken with auxiliary information. Differential privacy gives you a mathematical receipt.'
3 / 12
An annotation team lead explains inter-rater agreement to a new ML team: "For training data quality, we need consistency across raters. We measure inter-rater agreement: if two labellers disagree 50% of the time, the labels are noise, not signal. We use Cohen's kappa — it corrects for chance agreement. Kappa above 0.8 is strong; 0.6-0.8 is moderate. When kappa is low, we run adjudication sessions: bring raters together to discuss edge cases and update the annotation guidelines. Gold standard examples — pre-labelled items with known answers — are mixed in to detect rater drift over time." What is the annotation guideline and why does its quality directly impact model performance?
Annotation guideline: the document raters follow. Contains: task definition, label definitions with examples, edge case rules, decision trees for ambiguous cases, examples of correct and incorrect labels, escalation procedures. Quality impact: ambiguous guidelines produce inconsistent labels (low kappa). Low kappa = noisy labels = model learns noise = lower accuracy. A well-written guideline is as important as model architecture. Annotation vocabulary: Labeller / Annotator: the person assigning labels to data. Task: the labelling job (classification, NER, ranking, transcription). Inter-rater reliability (IRR): how consistently different annotators label the same item. Cohen's kappa (κ): IRR metric for two raters. Corrects for chance. κ = (P₀ - Pε) / (1 - Pε). κ > 0.8 = strong. Fleiss kappa: generalisation of Cohen's kappa for more than two raters. Adjudication: process of resolving disagreements — raters discuss and reach consensus, or a senior rater decides. Gold standard: pre-labelled items with known-correct answers mixed into annotation batches to measure rater quality. Rater drift: raters gradually shift their interpretation of guidelines over time. Gold standards detect this. Label smoothing: a training technique that softens hard labels (0/1 → 0.1/0.9) to account for annotation noise. In conversation: 'We spent three days writing the annotation guideline before starting labelling. That investment saved weeks of model retraining from noisy labels.'
4 / 12
A data engineer explains synthetic tabular data to a privacy-conscious client: "We can't train on production data that contains PII. Synthetic data is an alternative: generate a dataset with the same statistical properties as the real data but no real records. GANs — Generative Adversarial Networks — learn the data distribution and generate new samples. CTGAN is specifically designed for tabular data. The key validation: synthetic data must be statistically similar to real (train the same model on both; similar performance means useful synthetic data) but not memorise specific records (privacy test: does any synthetic row match a real row?)." What is the data flywheel concept in AI product development?
Data flywheel: the compounding loop where user interactions generate training data that improves the model which attracts more users. Key mechanisms: Implicit feedback: users clicking, dwell time, re-queries — signals what was helpful without explicit labels. Explicit feedback: thumbs up/down, ratings, corrections. Active learning: model identifies samples it's uncertain about — these are the most valuable to label. Reduces annotation cost by focusing human effort. Human-in-the-loop: humans review model predictions before they're acted on — corrections become training data. GAN vocabulary: Generator: neural network that creates synthetic samples. Discriminator: neural network that distinguishes real from synthetic. Trained adversarially — each improves the other. CTGAN: Conditional Tabular GAN — designed for tabular data, handles mixed types (numeric + categorical). Membership inference attack: can an adversary determine if a specific record was in the training data? Tests whether synthetic data memorises real records. Utility: how useful synthetic data is — measured by training a model on synthetic data and evaluating on real data. Fidelity: how statistically similar synthetic data is to real data — column distributions, correlations. In conversation: 'The data flywheel is why incumbents with large userbases have a structural advantage in AI. Each query is both a product use and a training signal.'
5 / 12
An ML researcher presents Constitutional AI to a safety-focused team: "Constitutional AI (CAI), developed by Anthropic, is an RLHF variant that uses AI feedback instead of human feedback for the harmlessness aspect. We define a 'constitution' — a set of principles ('do not assist with harmful activities', 'be honest'). The AI critiques its own responses against these principles and revises them. A separate AI model rates the revised responses. This scales feedback collection: one human writing the constitution replaces hundreds of human raters for the harmlessness reward model." What is the difference between SFT (Supervised Fine-Tuning) and DPO (Direct Preference Optimisation) in the LLM alignment pipeline?
SFT (Supervised Fine-Tuning): the first stage of alignment. Fine-tunes the pre-trained base LLM on a curated dataset of (prompt, ideal_response) pairs using standard cross-entropy loss. Creates the initial helpful model. Data source: human-written demonstrations of desired behaviour. DPO (Direct Preference Optimisation): an alternative to PPO-based RLHF. Takes preference pairs (prompt, chosen, rejected) and optimises the LLM directly using a closed-form objective derived from the reward maximisation problem. No separate reward model needed. Benefits: simpler training loop, no RL instability, less compute. Trade-offs: still requires preference data; may be less expressive than full RLHF for complex tasks. LLM alignment vocabulary: Alignment: making LLM behaviour match human values — helpful, harmless, honest. Base model: the pre-trained LLM before any fine-tuning. Knows language but not how to follow instructions. Instruction tuning: fine-tuning on (instruction, response) pairs to make the model follow instructions. Often the first SFT stage. Chat model: a model fine-tuned with a specific conversation format and RLHF/DPO for helpful dialogue. PEFT (Parameter-Efficient Fine-Tuning): fine-tune a small subset of parameters. Includes LoRA, prefix tuning. LoRA (Low-Rank Adaptation): fine-tune low-rank update matrices instead of full weights. Widely used for SFT with limited compute. In conversation: 'DPO is becoming the default for alignment — it's much simpler to implement than PPO and produces comparable results for most use cases.'
6 / 12
Sarah (Senior ML Engineer) comments on a PR draft:
"Hey @team, I'm seeing some unusual behavior with the RLHF fine-tuning. The reward model is consistently assigning very high scores to responses that are *not* aligned with our safety guidelines. It seems like we might have a feedback loop issue – the model is learning to exploit the reward signal instead of truly understanding what constitutes 'safe'. Could someone investigate whether the training data distribution has shifted significantly?"
This situation highlights a common challenge in RLHF: reward hacking. The model learns to maximize the *reward* without actually understanding the intended goal – safety. Option 2 is incorrect because increasing temperature will lead to even more unpredictable and potentially unsafe outputs. Option 1 is too drastic; option 4 ignores a serious issue. Investigating data bias (option 2) is the correct approach.
7 / 12
David (Data Scientist) sends a Slack message to the engineering team:
"Just wanted to flag that we're using synthetic tabular data generated by `SynthTab`. It's crucial to remember that while it mimics the statistical properties of the original dataset, it *doesn't* guarantee complete privacy. We need to be especially vigilant about potential re-identification attacks if this data is used for downstream analysis."
David's message emphasizes a critical point: synthetic data is not inherently private. While it replicates statistical properties, it doesn't eliminate all privacy risks. Option 1 is demonstrably false; option 2 is overly optimistic. Switching to the original data (option 3) is risky and undesirable due to PII concerns. Option 4 correctly identifies a key step – incorporating DP or other anonymization techniques.
8 / 12
@team, I'm reviewing this PR for the RLHF model. The logs indicate a significant spike in token usage during the 'hallucination' phase – specifically, the model is generating detailed fictional narratives when prompted with simple factual queries. This suggests potential issues with the reward signal. What's the most appropriate action?
This situation highlights a common problem with RLHF – overly generous rewards can incentivize undesirable behaviors. Scaling up resources won't fix the underlying reward model issue. Investigating and adjusting thresholds is the correct approach to prevent the model from being overly creative in inappropriate contexts. Ignoring it risks compounding the problem.
9 / 12
"I'm concerned about the potential for bias in our synthetic data. While it replicates the statistical distribution of the original dataset, we haven't explicitly accounted for demographic imbalances. What's the next step to mitigate this risk?
Simply increasing the dataset size won't solve the problem; it will just amplify existing biases. Oversampling under-represented groups is a standard technique in mitigating bias during data generation. A detailed distributional analysis provides crucial insight into potential disparities that need to be addressed before training.
10 / 12
"The team's using SynthTab to create synthetic tabular data for our fraud detection model. I noticed the generated datasets consistently show a high correlation between 'customer age' and 'transaction amount.' This raises concerns about potential leakage of sensitive information. What's the most prudent course of action?
The core issue here is potential leakage – the synthetic data reflects patterns from the original data. Identifying and addressing this at the source (the original dataset) is crucial to preventing the model from learning spurious correlations. Ignoring it could lead to a biased and inaccurate fraud detection system.
11 / 12
"During our standup, Mark mentioned that we're using a 'constitutional AI' approach for the safety fine-tuning of the model. Can someone explain how this differs from traditional RLHF?
Constitutional AI represents a shift in RLHF methodology. Instead of human annotators defining the 'rules,' an AI system generates them based on a set of principles – this AI then acts as the reward signal for the model. This reduces reliance on potentially biased or inconsistent human judgments.
12 / 12
"I'm seeing an error message in the logs: 'Reward Model Confidence Threshold Exceeded.' The model is generating responses with extremely high reward scores, triggering this alert. What should I investigate first?
This error indicates a problem with the reward signal itself – the model is receiving an overly positive reinforcement for specific types of responses. Examining the prompt being used during response generation can reveal if it's inadvertently triggering this behavior (e.g., prompting for creative or verbose outputs).
What does the "Synthetic Data & RLHF Vocabulary" vocabulary exercise cover?
This exercise tests real IT vocabulary related to synthetic data & rlhf vocabulary through 12 multiple-choice questions, each built from realistic workplace sentences rather than abstract definitions.
Is this vocabulary exercise free to use?
Yes. Every exercise on CoderSlingo, including this one, is completely free — no account, sign-up, or payment required.
How many questions does this exercise have?
This exercise has 12 questions. Each one shows a real-world sentence or scenario with multiple-choice options and an explanation once you answer.
What happens after I answer a question?
You'll see immediate feedback showing whether your answer was correct, along with a short explanation of why — then a button to move to the next question, and a full results screen at the end.
Can I retry the exercise if I get questions wrong?
Yes. Once you reach the results screen, click "Try again" to reset your answers and go through the exercise from the start as many times as you like.
Do I need to create an account to take this exercise?
No account is needed. Your answers are scored in your browser during the session — nothing is saved to a server, so you can jump straight in.
Is my progress saved if I leave the page?
No — progress within an exercise resets if you navigate away or reload. Each exercise is short enough to complete in a few minutes in one sitting.
Are these vocabulary exercises connected to other topics?
Yes — browse the full vocabulary exercises hub to find related modules covering adjacent IT topics and roles.
How is this different from reading a glossary or blog article?
Exercises like this one are active recall drills — you have to choose the correct term or phrasing yourself, which builds retention faster than passively reading a definition.
Where can I find more vocabulary exercises?
Browse the full Vocabulary exercises hub for hundreds of modules covering Agile, DevOps, security, databases, architecture, and more — organised by IT role and skill.