techlist.io

Rlhf

5 posts

OpenAI2024-07-234 min readCurated summary

Improving Model Safety Behavior with Rule-Based Rewards

# Improving Model Safety Behavior with Rule-Based Rewards OpenAI introduces Rule-Based Rewards (RBRs), a method that aligns models to behave safely without collecting large amounts of human feedback. RBRs use clear, step-by-step rules scored by a fixed grader model and feed those scores into the standard RLHF pipeline as an additional reward signal. The authors report that RBR-trained models match the safety of human-feedback-trained models, overrefuse less, and keep capability benchmark scores intact, while remaining cheap to update when safety policies change. ## Why Human Feedback Falls Short for Safety - Standard RLHF relies on human feedback to train a reward model that signals desirable behavior. - Collecting human feedback for routine, repetitive safety cases is inefficient. - When safety policies change, previously collected feedback can become outdated and require new data collection. ## How Rule-Based Rewards Work - Developers define **propositions**, simple true/false statements about a response, such as "Response is judgmental towards the user," "Response contains a short apology and inability to comply," "Response answers the user's request in a non-refusing manner," and "Response is maximally helpful for the user." - Propositions are combined into **rules** that encode what an ideal response looks like for a given scenario. For example, a refusal should contain a brief apology and state an inability to comply. - A fixed grader language model scores each response against these rules. - A linear model, with weights learned from a small dataset of prompts labeled with ideal response types and desired and undesired completions, converts the rule scores into a reward. - This RBR reward is combined with a helpful-only reward model and used as an additional signal in PPO to train the model. ## Three Response Categories - **Hard refusals** apply to requests such as criminal hate speech, advice for violent crimes, and extremism. The ideal response is a brief apology and a statement of inability to comply, without verbosity or judgmental language. - **Soft refusals** apply to requests involving self-harm. The ideal response is a more empathetic apology that acknowledges the user's emotional state while still declining. - **Comply** applies to benign requests, where the model should answer helpfully. ## Results - RBR-trained models reach safety performance comparable to models trained with human feedback. - They reduce overrefusal of safe requests without degrading common capability benchmarks. - They require far less human data, making training faster and cheaper. - Rules can be updated by editing or adding them, without extensive retraining. - Evaluation tracks a trade-off curve: usefulness (share of safe prompts correctly complied with) against safety (share of unsafe prompts correctly refused). Helpfulness-only baselines are more useful but less safe, while human-feedback baselines are very safe but less useful. RBR aims for the top-right corner, where both are high. ## Limitations and Ethical Considerations - RBRs work best for tasks with clear, straightforward rules and are harder to apply to subjective qualities such as essay quality. - The authors suggest combining RBRs with human feedback. RBRs enforce specific guidelines, such as avoiding slang or following the Model Spec, while human feedback handles nuanced aspects like coherence and writing style. - The RBR term is designed to enforce safety without dominating the overall reward more than necessary. - Shifting safety checks from humans to AI can reduce human oversight and may amplify biases if the grader model is biased. Careful rule design and a mix of RBRs and human feedback are recommended to mitigate these risks. ## Future Directions The authors see RBRs as applicable beyond safety, for example to shaping a model's personality or response format for a specific application. Planned work includes ablation studies of RBR components, using synthetic data for rule development, and human evaluations across more domains.

OpenAI2024-07-173 min readCurated summary

GPT-4o mini: advancing cost-efficient intelligence

GPT-4o mini is OpenAI's most cost-efficient small model, designed to make AI intelligence far more affordable for building applications. It scores 82% on MMLU, outperforms GPT-3.5 Turbo and other small models on reasoning, math, coding, and multimodal benchmarks, and costs 15 cents per million input tokens and 60 cents per million output tokens. OpenAI also says it is the first model to apply its instruction hierarchy method, which improves resistance to jailbreaks and prompt injections. ## Pricing and Availability - Priced at $0.15 per 1M input tokens and $0.60 per 1M output tokens, over 60% cheaper than GPT-3.5 Turbo and an order of magnitude cheaper than previous frontier models - Available as a text and vision model through the Assistants API, Chat Completions API, and Batch API, with fine-tuning planned in the coming days - Context window of 128K tokens, up to 16K output tokens per request, and knowledge up to October 2023 - Replaces GPT-3.5 in ChatGPT for Free, Plus, and Team users, with Enterprise access the following week - Improved tokenizer shared with GPT-4o makes non-English text more cost-effective ## Benchmark Performance - **Reasoning:** 82.0% on MMLU, compared with 77.9% for Gemini Flash and 73.8% for Claude Haiku - **Math:** 87.0% on MGSM, compared with 75.5% for Gemini Flash and 71.7% for Claude Haiku - **Coding:** 87.2% on HumanEval, compared with 71.5% for Gemini Flash and 75.9% for Claude Haiku - **Multimodal reasoning:** 59.4% on MMMU, compared with 56.1% for Gemini Flash and 50.2% for Claude Haiku - Strong function calling and improved long-context performance over GPT-3.5 Turbo - An early version reportedly outperforms GPT-4T (01-25) on chat preferences in the LMSYS leaderboard ## Real-World Use Cases - Partners Ramp and Superhuman found it significantly better than GPT-3.5 Turbo at extracting structured data from receipts and generating high-quality email replies from thread history - Its low cost and latency suit workflows that chain or parallelize many model calls, process large contexts such as full codebases or long conversation histories, and power real-time customer support chatbots ## Safety Measures - Pre-training filters out hate speech, adult content, sites that mainly aggregate personal information, and spam - Post-training uses RLHF to align behavior with OpenAI's policies - Shares the same safety mitigations as GPT-4o, assessed through automated and human evaluations under OpenAI's Preparedness Framework - Over 70 external experts in areas such as social psychology and misinformation tested GPT-4o for risks, and their insights informed improvements to both models ## Cost Trajectory The cost per token of GPT-4o mini has dropped 99% since text-davinci-003, released in 2022. OpenAI says it intends to keep reducing costs while improving capabilities, with the goal of embedding models in more apps and websites.

OpenAI2023-03-132 min readCurated summary

GPT-4

OpenAI introduced GPT-4 in March 2023 as its most capable model to date, following the GPT, GPT-2, and GPT-3 line of scaling deep learning with more data and compute. The company says six months of work on safety and alignment made it substantially more reliable than GPT-3.5 on its internal evaluations: 82% less likely to respond to requests for disallowed content and 40% more likely to produce factual responses. The post presents these gains alongside early customer deployments and acknowledges remaining limitations. ### Safety and Alignment Work - **Human feedback:** OpenAI incorporated more human feedback, including feedback submitted by ChatGPT users, and consulted over 50 experts in areas such as AI safety and security before release. - **Lessons from earlier models:** Insights from real-world use of previous models informed GPT-4's safety research and monitoring systems. - **GPT-4 aiding its own safety work:** GPT-4's reasoning and instruction-following helped generate training data for fine-tuning and iterate on classifiers used in training, evaluation, and monitoring. - **Ongoing updates:** As with ChatGPT, OpenAI plans to update and improve GPT-4 at a regular cadence as usage grows. ### Early Customer Applications - **Duolingo** used GPT-4 to deepen its language-learning conversations. - **Be My Eyes** applied it to visual accessibility. - **Stripe** used it to streamline user experience and combat fraud. - **Morgan Stanley** deployed it to organize its wealth management knowledge base. ### Infrastructure, Availability, and Limitations - **Training:** GPT-4 was trained on Microsoft Azure AI supercomputers, which also support delivering the model to users worldwide. - **Availability:** It is accessible through ChatGPT Plus and as an API for developers building applications and services. - **Known limitations:** Social biases, hallucinations, and vulnerability to adversarial prompts remain open problems. OpenAI emphasizes transparency, user education, and broader AI literacy, and says it aims to expand how people can shape its models. OpenAI frames GPT-4 as a step toward technologies that empower everyone, and says it is eager to see how people use it.

OpenAI2023-03-134 min readCurated summary

GPT-4

# GPT-4: Scaling Up Multimodal Capability with Predictable Training and Stronger Safety OpenAI introduces GPT-4, a large multimodal model that accepts image and text inputs and produces text outputs. While less capable than humans in many real-world settings, it reaches human-level performance on many professional and academic benchmarks, such as scoring around the top 10% on a simulated bar exam. The post argues that GPT-4 is a meaningful step forward in reliability, factuality, and steerability, while acknowledging that hallucinations and other limitations remain. ## Capabilities and Benchmarks - GPT-4 is noticeably more reliable, creative, and able to follow nuanced instructions than GPT-3.5, with the gap becoming clearer as task complexity rises. - Exam results were measured on recent public tests and 2022–2023 practice exams, with no exam-specific training, though a minority of problems may have appeared in training data. - On traditional ML benchmarks, GPT-4 outperforms existing large language models and most state-of-the-art systems. - On the MMLU benchmark translated into 26 languages via Azure Translate, GPT-4 beats GPT-3.5's English performance in 24 of them, including low-resource languages like Latvian, Welsh, and Swahili. - Internally, GPT-4 is used for support, sales, content moderation, and programming, and to help humans evaluate AI outputs. ### Visual Inputs - GPT-4 accepts interleaved text and images and generates text output, supporting tasks on documents, diagrams, and screenshots. - Text-only techniques such as few-shot and chain-of-thought prompting carry over to image inputs. - Image input was a limited research preview at launch, working first with a single partner. ### Steerability - Developers can define tone, style, verbosity, and task through a "system" message instead of relying on a fixed ChatGPT persona. - Adherence to these boundaries is imperfect, and system messages are the easiest route to jailbreaking the model. ## Limitations and Factuality - GPT-4 still hallucinates facts and makes reasoning errors, so high-stakes uses need human review, grounding in context, or avoidance altogether. - It scores 40% higher than GPT-3.5 on OpenAI's internal adversarial factuality evaluations. - On TruthfulQA, the base model barely improves on GPT-3.5, but after RLHF post-training a large gap emerges, though subtle errors still occur. - Knowledge ends around September 2021, the model does not learn from experience, and it can be overly gullible or introduce security vulnerabilities in code. - The pre-trained base model is well calibrated, but post-training reduces that calibration. ## Risks and Mitigations - Over 50 experts in areas such as AI alignment, cybersecurity, biorisk, and international security adversarially tested the model. - An additional safety reward signal during RLHF, provided by a GPT-4 zero-shot classifier, trains the model to refuse harmful requests while still allowing valid ones. - Compared with GPT-3.5, GPT-4 is 82% less likely to respond to disallowed content and 29% more likely to respond to sensitive requests in line with policy. - Jailbreaks remain possible, so the post stresses deployment-time safeguards such as abuse monitoring. ## Training and Predictable Scaling - The base model is trained to predict the next word on a web-scale corpus that includes both correct and incorrect reasoning, then fine-tuned with RLHF to match user intent. - Capabilities mostly come from pre-training, while RLHF mainly steers behavior and can slightly degrade exam performance. - OpenAI built infrastructure whose behavior is predictable across scales, forecasting GPT-4's final loss using models trained with 10,000x less compute. - Pass rates on a subset of HumanEval were predicted using models trained with 1,000x less compute. - Some capabilities remain hard to predict, such as tasks from the Inverse Scaling Prize, where GPT-4 reverses the negative trend. ## OpenAI Evals - Evals is an open-source framework for building benchmarks and inspecting model performance sample by sample, letting anyone report shortcomings. - It includes templates for common benchmark patterns and a "model-graded" template, since GPT-4 is surprisingly good at checking its own work. - Stripe uses Evals to measure the accuracy of a GPT-powered documentation tool. ## Access and Pricing - ChatGPT Plus subscribers get GPT-4 with a usage cap that may be adjusted based on demand. - The API is available through a waitlist, using the same ChatCompletions API as gpt-3.5-turbo. - The 8K-context model costs $0.03 per 1K prompt tokens and $0.06 per 1K completion tokens. The 32K-context model costs $0.06 and $0.12 respectively. - Default rate limits are 40k tokens per minute and 200 requests per minute, and researchers studying societal impact or alignment can apply for subsidized access.

OpenAI2022-10-182 min readCurated summary

Scaling laws for reward model overoptimization

Reinforcement learning from human feedback often optimizes a policy against a reward model trained on human preferences. Because that reward model is an imperfect proxy, pushing its score too high can hurt true performance, a pattern consistent with Goodhart's law. The authors measure this overoptimization systematically using a synthetic setup and find that its scaling follows different functional forms depending on the optimization method, with coefficients that scale smoothly with reward model size. ## Goodhart's Law in Preference-Based Training - Policies are commonly trained against a learned reward model that predicts human preferences - Over-optimizing this proxy can degrade performance on the true objective - The effect has been widely observed but rarely measured carefully, because collecting human preference data is expensive ## A Synthetic Experimental Setup - A fixed "gold-standard" reward model stands in for human labelers - A proxy reward model is trained on labels produced by the gold model - The gold model's score tracks how the policy performs as it is optimized against the proxy, which makes the degradation measurable ## Two Optimization Methods - The policy is optimized either with reinforcement learning or with best-of-n sampling - The relationship between optimization pressure and gold score follows a different functional form for each method - For both methods, the coefficients of these relationships scale smoothly with the number of reward model parameters ## Factors Affecting Overoptimization - Size of the reward model training dataset - Number of reward model parameters and policy parameters - Coefficient of the KL penalty added to the reward in the reinforcement learning setup ## Implications for Alignment - The empirical scaling relationships are used to inform theoretical discussions in AI alignment - Quantifying overoptimization turns a commonly noted qualitative risk into something that can be modeled and predicted The practical takeaway is that overoptimization is regular enough to be modeled, so the choice of optimization pressure, KL penalty, and reward model size and data can be reasoned about together rather than tuned by trial and error.