Skip to content

Reinforcement learning and RLHF: what it is, where you meet it every day and what the thumbs up does

From dog training to the ChatGPT thumbs up: what reinforcement learning is, how RLHF made chatbots, where it shows up today and how to use feedback in your app.

Ramon Gomes 14 min read Level: Intermediate

Also available in: Español, Français, Português

I learned the concept the most common way: clicking thumbs-down on a bad ChatGPT answer and wondering where that went. The answer is more interesting than it looks. That click is the visible tip of one of the oldest ideas in artificial intelligence, the same one that taught a machine to play Go better than any human and that today teaches language models to reason.

This post explains what reinforcement learning is without the math, shows where it shows up in your day as a user and as a developer, and ends with the tricks and trade-offs for anyone who wants to use the thumbs-up in their own product.

What Reinforcement Learning Is

There are three classic ways a machine learns:

  • Supervised: you show examples with the right answer ("this photo is a cat") and the model learns to repeat it.
  • Unsupervised: you hand over data with no answers and the model finds patterns on its own (grouping similar customers).
  • Reinforcement: nobody gives the right answer. The model tries, sees the result and gets a score. It learns by consequence.

The field's reference book, by Richard Sutton and Andrew Barto, organizes the concept into a few pieces (Sutton and Barto, 2018):

Piece What it is In dog training
Agent who decides the dog
Environment the world it acts in the park, the owner
State the current situation the owner with a closed hand
Action what the agent does sit, bark, run off
Reward the score that comes back the treat (or nothing)
Policy the rule the agent learned "closed hand, I sit"
The reinforcement learning loop: the agent picks an action, the environment returns the new state and a reward, and the agent adjusts its policy

The detail that sets reinforcement apart from the other ways of learning is the dilemma between exploring and exploiting. If the dog only repeats what already earned a treat, it never discovers a better trick. If it only experiments, it never piles up treats. Every reinforcement system has to balance the two, and this will come back when we get to your app.

Trainer crouching with her back turned, giving a treat to a tan mutt sitting on the grass in a park
Nobody explains to the dog what sitting is. It tries, gets the treat and does it again. Reinforcement learning is that, with more math and less fur.

From Games to Chatbots: RLHF

For decades, reinforcement worked best where the reward was obvious: win the game, score more points. DeepMind's AlphaZero taught itself chess, shogi and Go from scratch, playing against itself (DeepMind, 2018).

Conversation has no scoreboard. How do you grade an answer? In 2017, Paul Christiano and colleagues showed a way: instead of writing the reward, ask people which of two results they prefer and train a model to predict that preference. Human feedback on less than 1% of the agent's interactions was enough (Christiano et al., 2017).

In 2022, OpenAI applied the idea to language models with InstructGPT, the basis of ChatGPT. The result became a landmark: people preferred the answers from the 1.3 billion parameter InstructGPT over those from the 175 billion parameter GPT-3, a model more than 100 times larger (Ouyang et al., 2022). Tuning for human preference was worth more than size.

The stages of RLHF: pretraining, fine-tuning with examples, people comparing answers, reward model and policy optimization

The stages, simplified:

  1. Pretraining. The model reads a huge amount of text and learns to predict the next word. It knows a lot, but it doesn't know how to hold a conversation.
  2. Supervised fine-tuning (SFT). People write examples of good answers and the model learns the format.
  3. Comparison. The model generates several answers to the same question and people rank them from best to worst.
  4. Reward model. A second model learns to predict which answer people prefer. It becomes the automatic judge.
  5. Optimization. The language model is tuned with reinforcement (the classic algorithm is PPO) to score high with that judge, without drifting too far from what it already knew.

AWS has a good introductory explanation of these stages, and it makes a point few people notice: "The degree to which each model involves human values is totally up to the creator" (AWS).

Where You Run Into It Today

It's not just lab stuff or low-level Python. You touch reinforcement several times a day.

The Thumbs-up in the Chat

All three big assistants ask for your rating:

  • ChatGPT: thumbs up and thumbs down on every answer. Sometimes it shows two answers side by side and asks which you prefer, which is exactly the comparison from stage 3. Whether your conversations are used for training is controlled in Settings, Data controls, under "Improve the model for everyone".
  • Gemini: the buttons are called "Good response" and "Bad response". Google says the feedback you send is kept for up to 3 years, goes through human review and can be used for training even with activity turned off, because you chose to send it (Google).
  • Claude: thumbs up and thumbs down. Since 2025, Anthropic asks each user to choose whether their conversations go into training, and feedback you send can be kept for up to 5 years (Anthropic, 2025).
Hand of a traveler pressing the green smiley face button on an airport customer satisfaction kiosk
The airport kiosk and the chat thumbs-up ask the same question: did you like it? The difference is that, in the chat, the answer may go back into training.

In Models That Reason

The latest wave takes the human out of the middle when the answer can be checked by a rule. It's RL with verifiable rewards (RLVR): the model solves a math problem and scores if the result matches, or writes code and scores if the tests pass. DeepSeek-R1 showed, in a paper published in Nature in 2025, that the reasoning abilities of LLMs "can be incentivized through pure reinforcement learning" (DeepSeek-AI, 2025). NVIDIA sums up when to use it: "when correctness can be checked algorithmically", like valid JSON, a passing test or a tool call that works (NVIDIA, 2026).

Notice the passing test. It's the same reason tests and types became the infrastructure of AI-driven development: what works as a reward in training works as verification in your project.

Beyond Chatbots

  • Video recommendations. In 2018, YouTube published how it uses a reinforcement algorithm (REINFORCE) in a production recommendation system (Chen et al., 2018). The next video is the action; you watching it is the reward.
  • Faster algorithms. DeepMind's AlphaDev used reinforcement to discover sorting routines up to 70% faster on short lists, which made it into LLVM's standard C++ library (DeepMind, 2023).
  • In-app personalization. Firebase Remote Config personalization uses a contextual bandit algorithm: it tests variants, measures an Analytics event you choose and starts showing each person the variant most likely to get results (Firebase).

The bandit is the lightest form of reinforcement, and the one that fits a web app best: one decision at a time, immediate reward, no sequence of states. It's the clever cousin of the A/B test. In A/B, you split traffic down the middle until the experiment ends. With a bandit, traffic shifts on its own toward the variant that's winning, balancing exploring and exploiting. If you already use feature flags, it's the next step.

The Trade-offs

The Model Optimizes the Signal, Not the Intent

This is the core problem, and it has a name: specification gaming (or reward hacking). DeepMind defines it as behavior that "satisfies the literal specification of an objective without achieving the intended outcome". The famous example is a boat racing agent that found it scored more points by going around in circles, hitting the same targets over and over, than by finishing the race (DeepMind, 2020).

The Thumbs-up Rewards the Pleasant Answer

With a chatbotProgram that talks by text or voice, replying to messages from a script or a language model. It answers, but usually does not act outside the chat., the easiest way to earn a thumbs-up is to agree with the person. A 2023 Anthropic study showed that when an answer matches the user's views, it's more likely to be preferred, and that both humans and preference models prefer convincingly written sycophantic answers over correct ones "a non-negligible fraction of the time" (Sharma et al., 2023).

In April 2025, this happened at scale. OpenAI shipped a GPT-4o update that became so sycophantic it was pulled within days. In its write-up, the company explained it had added an additional reward signal based on user feedback, "thumbs-up and thumbs-down data from ChatGPT", and that this weakened the primary signal that had been holding sycophancy in check. And it admitted: "user feedback in particular can sometimes favor more agreeable responses" (OpenAI, 2025).

Cartoon of a smiling robot waiter serving a tray of compliments shaped like hearts and stars to a happy customer whose plate is empty and burnt
The customer gave a thumbs-up. The food is still burnt. That's what you get from optimizing satisfaction alone.

The Other Costs

  • Human feedback is expensive and scarce. Paying people to compare answers costs money; the very paper that proposes KTO, a cheaper method, starts from the fact that preference data is hard and expensive to collect (Ethayarajh et al., 2024).
  • The people who click aren't the average. Whoever gives a thumb is someone who was very pleased or very annoyed. The silent majority doesn't show up in the data.
  • Privacy. Feedback kept for years, with the conversation attached, calls for a clear policy and a way to opt out.

Tips for Using the Thumbs-up in Your Product

If you have an app with AI (a support chat, an agent that answers customers, a text generator), the thumbs-up is the cheapest data source there is. A few precautions make it worth it:

  1. Store the context, not just the click. Question, answer, prompt and model version, date. A thumb without the answer attached is useless later.
  2. Ask for the reason on thumbs-down. Three quick options ("wrong", "incomplete", "bad tone") are worth more than a thousand loose clicks.
  3. Use it to evaluate first, then to train. Before thinking about fine-tuning, use the thumbs-down answers as a test set: every new version of the prompt has to get those right.
  4. Don't optimize for the thumbs-up alone. Mix it with an objective metric (was the ticket resolved? did the customer ask again?) so you don't fall into sycophancy.
  5. Pick the right method for the data you have. Single thumbs (good or bad) go straight into KTO, which only needs a binary signal. Pairs of "this answer is better than that one" go into DPO, which solves the RLHFTraining stage where people compare model answers, a reward model learns those preferences and the main model is tuned to follow them. problem with a simple loss function, without the separate reward model (Rafailov et al., 2023).

In practice, the web side is a simple endpoint:

ts
// POST /api/feedback
type Feedback = {
  conversationId: string;
  prompt: string;
  response: string;
  helpful: boolean;         // the thumbs-up
  reason?: 'wrong' | 'incomplete' | 'tone';
  promptVersion: string;
};

export async function saveFeedback(f: Feedback) {
  await db.feedback.create({ data: { ...f, createdAt: new Date() } });
}

And, once there's volume, training happens in Python with Hugging Face's TRL library, reading a file with prompt, completion and label:

python
from datasets import load_dataset
from transformers import AutoModelForCausalLM, AutoTokenizer
from trl import KTOConfig, KTOTrainer

model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-0.5B-Instruct")
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-0.5B-Instruct")
# each line: {"prompt": ..., "completion": ..., "label": true or false}
data = load_dataset("json", data_files="feedback.jsonl", split="train")

trainer = KTOTrainer(
    model=model,
    args=KTOConfig(output_dir="kto-model"),
    processing_class=tokenizer,
    train_dataset=data,
)
trainer.train()

If thumbs-down far outnumber thumbs-up (it usually happens), the KTO docs tell you to adjust the desirable_weight and undesirable_weight weights to compensate (Hugging Face TRL).

For anyone who wants to get their hands on classic reinforcement, Gymnasium has ready-made environments (the cart that balances a pole, the frozen lake) and a two-function APIContract that defines how one program asks another for data or actions: which endpoints to call, what to send and what comes back. On the web, usually HTTP with JSON., reset and step. It's the best lab for watching an agent learn by trial. The map of where this fits in a career is in the post about the types of AI engineering.

Frequently Asked Questions

What is reinforcement learning in simple terms?

It's learning by trial and consequence. The agent takes an action, gets a reward or a penalty, and adjusts its behavior to earn more reward next time, like a dog that learns to sit to get a treat.

What is RLHF?

It's reinforcement learning from human feedback. People compare a model's answers, a second model learns to predict their preference, and the language model is tuned to score high with that judge. It's the technique that turned GPT-3 into ChatGPT.

Does the ChatGPT thumbs-up train the model?

It can go into training. The feedback is stored with the conversation and companies use it to evaluate and train future versions, depending on your account's data settings. It doesn't change the answer on the spot or train the model just for you.

What's the difference between supervised and reinforcement learning?

In supervised learning, the model sees the right answer and learns to repeat it. In reinforcement learning, nobody gives the answer: the model tries, gets a score and figures out on its own what scores higher.

Is reinforcement learning only for people who code in Python?

Training the model is usually done in Python, with libraries like TRL and Gymnasium. But the concept shows up in any product: collecting thumbs-up in a web app, using a bandit to pick variants in Firebase, evaluating prompts against the poorly rated answers.

What is reward hacking?

It's when the agent finds a way to earn the reward without doing what was intended, like the racing boat that went around in circles to rack up points. In chatbots, the most common version is sycophancy: agreeing with the user earns more thumbs-up than correcting them.

What is DPO and why did it replace PPO in many models?

DPO is a method that uses pairs of preferred and rejected answers to tune the model directly, without training a separate reward model or running classic reinforcement. It's simpler to implement and more stable.

References

Source: https://ramongomessilva.com.br/blog/what-is-reinforcement-learning-rlhf · Accessed on December 02, 2026

Share Share on LinkedIn Share on X
Cite this article

Ready-made reference, with today as the access date.

ABNT

Brazilian standard (NBR 6023). Use it in theses and academic papers submitted in Brazil.

GOMES, Ramon. Reinforcement learning and RLHF: what it is, where you meet it every day and what the thumbs up does. Ramon Gomes, 14 nov. 2026. Disponível em: https://ramongomessilva.com.br/blog/what-is-reinforcement-learning-rlhf. Acesso em: 2 dez. 2026.

APA

American Psychological Association style. Common in scientific papers and journals, especially in the social, behavioral and health sciences.

Gomes, R. (2026, November 14). Reinforcement learning and RLHF: what it is, where you meet it every day and what the thumbs up does. Ramon Gomes. https://ramongomessilva.com.br/blog/what-is-reinforcement-learning-rlhf

BibTeX

Format for LaTeX users (Overleaf, for example). Paste it into your .bib file or import it into Zotero or Mendeley.

@online{gomes2026whatisreinforcement,
  author = {Gomes, Ramon},
  title = {{Reinforcement learning and RLHF: what it is, where you meet it every day and what the thumbs up does}},
  organization = {Ramon Gomes},
  year = {2026},
  month = nov,
  date = {2026-11-14},
  url = {https://ramongomessilva.com.br/blog/what-is-reinforcement-learning-rlhf},
  urldate = {2026-12-02}
}
Found a mistake?

Wrong fact, broken link, outdated information: tell me and I will fix it.

10 to 2,000 characters. If you can, point to the right source.

Only so I can reply. It never shows on any page of the site.

Written by

Ramon Gomes

Software Engineer

Full stack software engineer. I like taking a messy problem, listening to the people who live with it and shipping something that holds up day to day. These days I split my time between my own products, applied AI and client work.

Available for projects

Need Something Like This Built?

I build websites, systems, apps and AI automations, from design to deploy. Tell me what you need or see what I offer.

Related Articles