Skip to content

Instantly share code, notes, and snippets.

@pamelafox
pamelafox / mcp_server.py
Created March 31, 2025 16:44
MCP Server for azure-search-openai-demo (Basic)
import io
import os
import traceback
from enum import Enum
from azure.identity.aio import (
AzureDeveloperCliCredential,
)
from azure.search.documents.aio import SearchClient
from azure.search.documents.models import (
@JoaoLages
JoaoLages / RLHF.md
Last active September 2, 2025 18:59
Reinforcement Learning from Human Feedback (RLHF) - a simplified explanation

Maybe you've heard about this technique but you haven't completely understood it, especially the PPO part. This explanation might help.

We will focus on text-to-text language models 📝, such as GPT-3, BLOOM, and T5. Models like BERT, which are encoder-only, are not addressed.

Reinforcement Learning from Human Feedback (RLHF) has been successfully applied in ChatGPT, hence its major increase in popularity. 📈

RLHF is especially useful in two scenarios 🌟:

  • You can’t create a good loss function
    • Example: how do you calculate a metric to measure if the model’s output was funny?
  • You want to train with production data, but you can’t easily label your production data