Token导航 LogoToken导航

Agent Skill · 研究检索

rlhf(rlhf 搜索)

rlhf 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

rlhf 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 61,604。

总安装 349周安装 15GitHub Stars 20下载 122核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:rlhf(rlhf 搜索)
来源仓库:https://github.com/itsmostafa/llm-engineering-skills
仓库路径:skills/rlhf
安装命令:
npx skills add https://github.com/itsmostafa/llm-engineering-skills --skill rlhf
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/itsmostafa/llm-engineering-skills --skill rlhf

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

rlhf 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

适用于研究检索类任务,如信息搜集、资料筛选和知识整理。支持主流 Agent 宿主环境,通过 npx 方式便捷安装。

来源仓库内路径:skills/rlhf

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/itsmostafa/llm-engineering-skills --skill rlhf;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

rlhf 怎么安装?

在终端执行 npx skills add https://github.com/itsmostafa/llm-engineering-skills --skill rlhf。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

rlhf 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

rlhf 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

rlhf 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

rlhf 用的人多吗?

公开数据是累计安装 349 次,近一周安装 15 次,下载 122 次,GitHub 20 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

rlhf 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。
  • 标注为只读权限,试用阶段不容易误改本地文件。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。
  • 只想先试试效果、不希望它改动本地文件的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
rlhf

rlhf 搜索 · 本页

34920只读未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Understanding RLHF

Reinforcement Learning from Human Feedback (RLHF) is a technique for aligning language models with human preferences. Rather than relying solely on next-token prediction, RLHF uses human judgment to guide model behavior toward helpful, harmless, and honest outputs.

Table of Contents

Core Concepts

Why RLHF?

Pretraining produces models that predict likely text, not necessarily *good* text. A model trained on internet data learns to complete text in ways that reflect its training distribution—including toxic, unhelpful, or dishonest patterns. RLHF addresses this gap by optimizing for human preferences rather than likelihood.

The core insight: humans can often recognize good outputs more easily than they can specify what makes an output good. RLHF exploits this by collecting human judgments and using them to shape model behavior.

The Alignment Problem

Language models face several alignment challenges:

  • Helpfulness: Following instructions and providing useful information
  • Harmlessness: Avoiding toxic, dangerous, or inappropriate outputs
  • Honesty: Acknowledging uncertainty and avoiding fabrication
  • Intent alignment: Understanding what users actually want, not just what they say

RLHF provides a framework for encoding these properties through preference data.

Key Components

  1. Preference data: Human judgments comparing model outputs
  2. Reward model: A learned function approximating human preferences
  3. Policy optimization: RL algorithms that maximize expected reward
  4. Regularization: Constraints preventing deviation from the base model

The RLHF Pipeline

The standard RLHF pipeline consists of three main stages:

Stage 1: Supervised Fine-Tuning (SFT)

Start with a pretrained language model and fine-tune it on high-quality demonstrations. This teaches the model the desired format and style of responses.

Input: Pretrained model + demonstration dataset Output: SFT model that can follow instructions

Stage 2: Reward Model Training

Train a model to predict human preferences between pairs of outputs. The reward model learns to score outputs in a way that correlates with human judgment.

Input: SFT model + preference dataset (chosen/rejected pairs) Output: Reward model that scores any output

Stage 3: Policy Optimization

Use reinforcement learning to optimize the SFT model against the reward model, while staying close to the original SFT distribution.

Input: SFT model + reward model Output: Final aligned model

Alternative: Direct Alignment

Direct alignment algorithms (DPO, IPO, KTO) skip the reward model entirely, optimizing directly from preference data. This simplifies the pipeline but trades off some flexibility.

Preference Data

Preference data encodes human judgment about model outputs. The most common format is pairwise comparisons.

Pairwise Preferences

Given a prompt, collect two or more model outputs and have humans indicate which is better:

Prompt: "Explain quantum entanglement"

Response A: [technical explanation]
Response B: [simpler explanation with analogy]

Human preference: B > A

This creates (prompt, chosen, rejected) tuples for training.

Collection Methods

Human annotation: Trained annotators compare outputs according to guidelines. Most reliable but expensive and slow.

AI feedback: Use a capable model to generate preferences. Faster and cheaper but may propagate biases. This is the basis for Constitutional AI (CAI) and RLAIF.

Implicit signals: User interactions like upvotes, regeneration requests, or conversation length. Noisy but abundant.

Data Quality Considerations

  • Annotator agreement: Low agreement suggests ambiguous criteria or subjective preferences
  • Distribution coverage: Preferences should cover the range of model behaviors
  • Prompt diversity: Diverse prompts prevent overfitting to narrow scenarios
  • Preference strength: Some comparisons are clear; others are nearly ties

Instruction Tuning

Instruction tuning (supervised fine-tuning on instruction-response pairs) serves as the foundation for RLHF.

Purpose

  • Teaches the model to follow instructions rather than just complete text
  • Establishes the format and style for responses
  • Creates a starting point that already exhibits desired behaviors
  • Provides the reference policy for KL regularization

Dataset Composition

Typical instruction tuning datasets include:

  • Single-turn QA: Questions with direct answers
  • Multi-turn dialogue: Conversational exchanges
  • Task instructions: Specific tasks with examples
  • Chain-of-thought: Reasoning traces for complex problems

Relationship to RLHF

The SFT model defines the "prior" that RLHF refines. A better SFT model means:

  • The reward model has better starting outputs to compare
  • Policy optimization has less work to do
  • The KL penalty keeps the final model closer to this baseline

Reward Modeling

The reward model transforms pairwise preferences into a scalar signal for RL optimization.

The Bradley-Terry Model

Preferences are modeled using the Bradley-Terry framework:

P(A > B) = sigmoid(r(A) - r(B))

Where r(x) is the reward for output x. This assumes preferences depend only on the difference in rewards.

The loss function is:

L = -log(sigmoid(r(chosen) - r(rejected)))

This pushes the reward model to assign higher scores to chosen outputs.

Architecture

Reward models are typically:

  • The SFT model with a scalar head instead of the language modeling head
  • Trained on (prompt, chosen, rejected) tuples
  • Output a single scalar reward for any (prompt, response) pair

Considerations

  • Scaling: Larger reward models generally produce better signals
  • Calibration: Absolute reward values are less important than rankings
  • Generalization: The model must score outputs it hasn't seen during training
  • Over-optimization: Policies can exploit reward model weaknesses

See reference/reward-modeling.md for detailed training procedures.

Policy Optimization

Policy optimization uses RL to maximize expected reward while staying close to the reference policy.

The RLHF Objective

maximize E[R(x, y)] - β * KL(π || π_ref)

Where:

  • R(x, y) is the reward for response y to prompt x
  • KL(π || π_ref) measures deviation from the reference policy
  • β controls the strength of the regularization

PPO (Proximal Policy Optimization)

PPO is the most common algorithm for RLHF:

  1. Sample responses from the current policy
  2. Score responses with the reward model
  3. Compute advantage estimates
  4. Update policy with clipped surrogate objective

The clipping prevents large policy updates that could destabilize training.

KL Regularization

The KL penalty serves multiple purposes:

  • Prevents reward hacking: Stops the policy from finding adversarial inputs to the reward model
  • Maintains capabilities: Keeps the model close to the pretrained distribution
  • Stabilizes training: Limits how far the policy can move per update

Higher β means more conservative updates; lower β allows more aggressive optimization.

REINFORCE vs PPO

REINFORCE is simpler but has higher variance:

  • Uses raw returns without value function baseline
  • Single-sample gradient estimates
  • Can work for simpler problems

PPO adds complexity but improves stability:

  • Clipped surrogate objective
  • Multiple epochs per batch
  • Better sample efficiency

See reference/policy-optimization.md for algorithm details.

Direct Alignment Algorithms

Direct alignment methods optimize the RLHF objective without training a separate reward model.

DPO (Direct Preference Optimization)

DPO reparameterizes the RLHF objective to derive a closed-form loss:

L = -log sigmoid(β * (log π(y_w|x)/π_ref(y_w|x) - log π(y_l|x)/π_ref(y_l|x)))

Where y_w is the preferred response and y_l is the dispreferred response.

Advantages:

  • No separate reward model training
  • Simpler pipeline with fewer hyperparameters
  • More stable than RL-based methods

Trade-offs:

  • Less flexible than explicit reward models
  • Cannot reuse reward model for other purposes
  • May be more sensitive to data quality

IPO (Identity Preference Optimization)

IPO addresses potential overfitting in DPO by using a different loss formulation that doesn't assume the Bradley-Terry model perfectly describes preferences.

KTO (Kahneman-Tversky Optimization)

KTO works with binary feedback (good/bad) rather than pairwise comparisons, making data collection easier. It's based on prospect theory from behavioral economics.

When to Use Direct Alignment

Direct alignment is preferred when:

  • Simplicity is important
  • Computational resources are limited
  • The reward model won't be reused

Reward-based RLHF is preferred when:

  • You need the reward model for other purposes (filtering, ranking)
  • You have a large preference dataset
  • You want maximum flexibility in optimization

See reference/direct-alignment.md for detailed algorithm comparisons.

Challenges

Over-Optimization

As optimization proceeds, the policy may exploit weaknesses in the reward model rather than improving on the true objective. Symptoms include:

  • Rising reward model scores but declining human evaluation
  • Increasingly verbose or formulaic outputs
  • Sycophantic behavior (agreeing with users regardless of correctness)

Mitigations:

  • Stronger KL regularization
  • Reward model ensembles
  • Early stopping based on held-out evaluation

Reward Hacking

The policy finds inputs that score highly with the reward model but don't represent genuine improvement:

  • Length exploitation (longer responses score higher)
  • Style mimicry (copying patterns from high-reward examples)
  • Adversarial outputs that confuse the reward model

Evaluation

Evaluating aligned models is difficult because:

  • Human preferences are subjective and context-dependent
  • Automated metrics don't capture alignment properties well
  • A/B testing is expensive and slow
  • Models may perform differently on evaluation vs deployment

Distribution Shift

The preference data comes from a specific distribution of prompts and responses. The deployed model will encounter different inputs, and the reward model may not generalize well.

Best Practices

  1. Start with a strong SFT model: RLHF refines behavior; it works best when the base model already exhibits desired patterns
  2. Invest in preference data quality: Garbage in, garbage out—clear guidelines and trained annotators matter
  3. Use KL regularization: Don't optimize reward too aggressively; the reward model is an imperfect proxy
  4. Monitor for reward hacking: Track human evaluations alongside reward model scores
  5. Consider direct alignment first: DPO is simpler and often performs comparably to PPO
  6. Iterate on reward model: Improve the reward model as you discover its weaknesses
  7. Diverse prompts: Ensure preference data covers the distribution you care about
  8. Regularize appropriately: Higher β for safety-critical applications; lower β for capability-focused training

References

Reference Files

  • reference/reward-modeling.md - Detailed reward model training procedures
  • reference/policy-optimization.md - PPO and policy gradient algorithms for RLHF
  • reference/direct-alignment.md - DPO, IPO, KTO and other direct methods

External Resources

平台分布

Codex

34.48%
按下载量换算42

Claude

28.9%
按下载量换算35

Cursor

20.15%
按下载量换算25

Gemini CLI

8.58%
按下载量换算10

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills