LogoLogo
Continuum WebsiteContinuum ApplicationsContinuum KnowledgeAxolotl Platform
Continuum Knowledge
Continuum Knowledge
  • Continuum
  • Data
    • Datasets
      • Pre Training Data
      • Types of Fine Tuning
      • Self Instruct Paper
      • Self-Alignment with Instruction Backtranslation
      • Systematic Evaluation of Instruction-Tuned Large Language Models on Open Datasets
      • Instruction Tuning
      • Instruction Fine Tuning - Alpagasus
      • Less is More For Alignment
      • Enhanced Supervised Fine Tuning
      • Visualising Data using t-SNE
      • UMAP: Uniform Manifold Approximation and Projection for Dimension Reduction
      • Training and Evaluation Datasets
      • What is perplexity?
  • MODELS
    • Foundation Models
      • The leaderboard
      • Foundation Models
      • LLama 2 - Analysis
      • Analysis of Llama 3
      • Llama 3.1 series
      • Google Gemini 1.5
      • Platypus: Quick, Cheap, and Powerful Refinement of LLMs
      • Mixtral of Experts
      • Mixture-of-Agents (MoA)
      • Phi 1.5
        • Refining the Art of AI Training: A Deep Dive into Phi 1.5's Innovative Approach
      • Phi 2.0
      • Phi-3 Technical Report
  • Training
    • The Fine Tuning Process
      • Why fine tune?
        • Does Fine-Tuning LLMs on New Knowledge Encourage Hallucinations?
        • Explanations in Fine Tuning
      • Tokenization
        • Tokenization Is More Than Compression
        • Tokenization - SentencePiece
        • Tokenization explore
        • Tokenizer Choice For LLM Training: Negligible or Crucial?
        • Getting the most out of your tokenizer for pre-training and domain adaptation
        • TokenMonster
      • Parameter Efficient Fine Tuning
        • P-Tuning
          • The Power of Scale for Parameter-Efficient Prompt Tuning
        • Prefix-Tuning: Optimizing Continuous Prompts for Generation
        • Harnessing the Power of PEFT: A Smarter Approach to Fine-tuning Pre-trained Models
        • What is Low-Rank Adaptation (LoRA) - explained by the inventor
        • Low Rank Adaptation (Lora)
        • Practical Tips for Fine-tuning LMs Using LoRA (Low-Rank Adaptation)
        • QLORA: Efficient Finetuning of Quantized LLMs
        • Bits and Bytes
        • The Magic behind Qlora
        • Practical Guide to LoRA: Tips and Tricks for Effective Model Adaptation
        • The quantization constant
        • QLORA: Efficient Finetuning of Quantized Language Models
        • QLORA and Fine-Tuning of Quantized Language Models (LMs)
        • ReLoRA: High-Rank Training Through Low-Rank Updates
        • SLoRA: Federated Parameter Efficient Fine-Tuning of Language Models
        • GaLora: Memory-Efficient LLM Training by Gradient Low-Rank Projection
      • Hyperparameters
        • Batch Size
        • Padding Tokens
        • Mixed precision training
        • FP8 Formats for Deep Learning
        • Floating Point Numbers
        • Batch Size and Model loss
        • Batch Normalisation
        • Rethinking Learning Rate Tuning in the Era of Language Models
        • Sample Packing
        • Gradient accumulation
        • A process for choosing the learning rate
        • Learning Rate Scheduler
        • Checkpoints
        • A Survey on Efficient Training of Transformers
        • Sequence Length Warmup
        • Understanding Training vs. Evaluation Data Splits
        • Cross-entropy loss
        • Weight Decay
        • Optimiser
        • Caching
      • Training Processes
        • Extending the context window
        • PyTorch Fully Sharded Data Parallel (FSDP)
        • Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation
        • YaRN: Efficient Context Window Extension of Large Language Models
        • Sliding Window Attention
        • LongRoPE
        • Reinforcement Learning
        • An introduction to reinforcement learning
        • Reinforcement Learning from Human Feedback (RLHF)
        • Direct Preference Optimization: Your Language Model is Secretly a Reward Model
  • INFERENCE
    • Why is inference important?
      • Grouped Query Attention
      • Key Value Cache
      • Flash Attention
      • Flash Attention 2
      • StreamingLLM
      • Paged Attention and vLLM
      • TensorRT-LLM
      • Torchscript
      • NVIDIA L40S GPU
      • Triton Inference Server - Introduction
      • Triton Inference Server
      • FiDO: Fusion-in-Decoder optimised for stronger performance and faster inference
      • Is PUE a useful measure of data centre performance?
      • SLORA
  • KNOWLEDGE
    • Vector Databases
      • A Comprehensive Survey on Vector Databases
      • Vector database management systems: Fundamental concepts, use-cases, and current challenges
      • Using the Output Embedding to Improve Language Models
      • Decoding Sentence-BERT
      • ColBERT: Efficient and Effective Passage Search via Contextualized Late Interaction over BERT
      • SimCSE: Simple Contrastive Learning of Sentence Embeddings
      • Questions Are All You Need to Train a Dense Passage Retriever
      • Improving Text Embeddings with Large Language Models
      • Massive Text Embedding Benchmark
      • RocketQAv2: A Joint Training Method for Dense Passage Retrieval and Passage Re-ranking
      • LLM2Vec: Large Language Models Are Secretly Powerful Text Encoders
      • Embedding and Fine-Tuning in Neural Language Models
      • Embedding Model Construction
      • Demystifying Embedding Spaces using Large Language Models
      • Fine-Tuning Llama for Multi-Stage Text Retrieval
      • Large Language Model Based Text Augmentation Enhanced Personality Detection Model
      • One Embedder, Any Task: Instruction-Finetuned Text Embeddings
      • Vector Databases are not the only solution
      • Knowledge Graphs
        • Harnessing Knowledge Graphs to Elevate AI: A Technical Exploration
        • Unifying Large Language Models and Knowledge Graphs: A Roadmap
      • Approximate Nearest Neighbor (ANN)
      • High Dimensional Data
      • Principal Component Analysis (PCA)
      • Vector Similarity Search - HNSW
      • FAISS (Facebook AI Similarity Search)
      • Unsupervised Dense Retrievers
    • Retrieval Augmented Generation
      • Retrieval-Augmented Generation for Large Language Models: A Survey
      • Fine-Tuning or Retrieval?
      • Revolutionising Information Retrieval: The Power of RAG in Language Models
      • A Survey on Retrieval-Augmented Text Generation
      • REALM: Retrieval-Augmented Language Model Pre-Training
      • Retrieve Anything To Augment Large Language Models
      • Generate Rather Than Retrieve: Large Language Models Are Strong Context Generators
      • Active Retrieval Augmented Generation
      • DSPy: LM Assertions: Enhancing Language Model Pipelines with Computational Constraints
      • DSPy: Compiling Declarative Language Model Calls
      • DSPy: In-Context Learning for Extreme Multi-Label Classification
      • Optimizing Instructions and Demonstrations for Multi-Stage Language Model Programs
      • HYDE: Revolutionising Search with Hypothetical Document Embeddings
      • Enhancing Recommender Systems with Large Language Model Reasoning Graphs
      • Retrieval Augmented Generation (RAG) versus fine tuning
      • RAFT: Adapting Language Model to Domain Specific RAG
      • Summarisation Methods and RAG
      • Lessons Learned on LLM RAG Solutions
      • Stanford: Retrieval Augmented Language Models
      • Overview of RAG Approaches with Vector Databases
      • Mastering Chunking in Retrieval-Augmented Generation (RAG) Systems
    • Semantic Routing
    • Resource Description Framework (RDF)
  • AGENTS
    • What is agency?
      • Rephrase and Respond: Let Large Language Models Ask Better Questions for Themselves
      • Types of Agents
      • The risk of AI agency
      • Understanding Personality in Large Language Models: A New Frontier in AI Psychology
      • AI Agents - Reasoning, Planning, and Tool Calling
      • Personality and Brand
      • Agent Interaction via APIs
      • Bridging Minds and Machines: The Legacy of Newell, Shaw, and Simon
      • A Survey on Language Model based Autonomous Agents
      • Large Language Models as Agents
      • AI Reasoning: A Deep Dive into Chain-of-Thought Prompting
      • Enhancing AI Reasoning with Self-Taught Reasoner (STaR)
      • Exploring the Frontier of AI: The "Tree of Thoughts" Framework
      • Toolformer: Revolutionising Language Models with API Integration - An Analysis
      • TaskMatrix.AI: Bridging Foundational AI Models with Specialised Systems for Enhanced Task Completion
      • Unleashing the Power of LLMs in API Integration: The Rise of Gorilla
      • Andrew Ng's presentation on AI agents
      • Making AI accessible with Andrej Karpathy and Stephanie Zhan
  • Regulation and Ethics
    • Regulation and Ethics
      • Privacy
      • Detecting AI Generated content
      • Navigating the IP Maze in AI: The Convergence of Blockchain, Web 3.0, and LLMs
      • Adverse Reactions to generative AI
      • Navigating the Ethical Minefield: The Challenge of Security in Large Language Models
      • Navigating the Uncharted Waters: The Risks of Autonomous AI in Military Decision-Making
  • DISRUPTION
    • Data Architecture
      • What is a data pipeline?
      • What is Reverse ETL?
      • Unstructured Data and Generatve AI
      • Resource Description Framework (RDF)
      • Integrating generative AI with the Semantic Web
    • Search
      • BM25 - Search Engine Ranking Function
      • BERT as a reranking engine
      • BERT and Google
      • Generative Engine Optimisation (GEO)
      • Billion-scale similarity search with GPUs
      • FOLLOWIR: Evaluating and Teaching Information Retrieval Models to Follow Instructions
      • Neural Collaborative Filtering
      • Federated Neural Collaborative Filtering
      • Latent Space versus Embedding Space
      • Improving Text Embeddings with Large Language Models
    • Recommendation Engines
      • On Interpretation and Measurement of Soft Attributes for Recommendation
      • A Survey on Large Language Models for Recommendation
      • Model driven recommendation systems
      • Recommender AI Agent: Integrating Large Language Models for Interactive Recommendations
      • Foundation Models for Recommender Systems
      • Exploring the Impact of Large Language Models on Recommender Systems: An Extensive Review
      • AI driven recommendations - harming autonomy?
    • Logging
      • A Taxonomy of Anomalies in Log Data
      • Deeplog
      • LogBERT: Log Anomaly Detection via BERT
      • Experience Report: Deep Learning-based System Log Analysis for Anomaly Detection
      • Log-based Anomaly Detection with Deep Learning: How Far Are We?
      • Deep Learning for Anomaly Detection in Log Data: A Survey
      • LogGPT
      • Adaptive Semantic Gate Networks (ASGNet) for log-based anomaly diagnosis
  • Infrastructure
    • The modern data centre
      • Enhancing Data Centre Efficiency: Strategies to Improve PUE
      • TCO of NVIDIA GPUs and falling barriers to entry
      • Maximising GPU Utilisation with Kubernetes and NVIDIA GPU Operator
      • Data Centres
      • Liquid Cooling
    • Servers and Chips
      • The NVIDIA H100 GPU
      • NVIDIA H100 NVL
      • Lambda Hyperplane 8-H100
      • NVIDIA DGX Servers
      • NVIDIA DGX-2
      • NVIDIA DGX H-100 System
      • NVLink Switch
      • Tensor Cores
      • NVIDIA Grace Hopper Superchip
      • NVIDIA Grace CPU Superchip
      • NVIDIA GB200 NVL72
      • Hopper versus Blackwell
      • HGX: High-Performance GPU Platforms
      • ARM Chips
      • ARM versus x86
      • RISC versus CISC
      • Introduction to RISC-V
    • Networking and Connectivity
      • Infiniband versus Ethernet
      • NVIDIA Quantum InfiniBand
      • PCIe (Peripheral Component Interconnect Express)
      • NVIDIA ConnectX InfiniBand adapters
      • NVMe (Non-Volatile Memory Express)
      • NVMe over Fabrics (NVMe-oF)
      • NVIDIA Spectrum-X
      • NVIDIA GPUDirect
      • Evaluating Modern GPU Interconnect
      • Scalable Hierarchical Aggregation and Reduction Protocol (SHARP)
      • Next-generation networking in AI environments
      • NVIDIA Collective Communications Library (NCCL)
    • Data and Memory
      • NVIDIA BlueField Data Processing Units (DPUs)
      • Remote Direct Memory Access (RDMA)
      • High Bandwidth Memory (HBM3)
      • Flash Memory
      • Model Requirements
      • Calculating GPU memory for serving LLMs
      • Transformer training costs
      • GPU Performance Optimisation
    • Libraries and Complements
      • NVIDIA Base Command
      • NVIDIA AI Enterprise
      • CUDA - NVIDIA GTC 2024 presentation
      • RAPIDs
      • RAFT
    • Vast Data Platform
      • Vast Datastore
      • Vast Database
      • Vast Data Engine
      • DASE (Disaggregated and Shared Everything)
      • Dremio and VAST Data
    • Storage
      • WEKA: A High-Performance Storage Solution for AI Workloads
      • Introduction to NVIDIA GPUDirect Storage (GDS)
        • GDS cuFile API
      • NVIDIA Magnum IO GPUDirect Storage (GDS)
      • Vectors in Memory
Powered by GitBook
LogoLogo

Continuum - Accelerated Artificial Intelligence

  • Continuum Website
  • Axolotl Platform

Copyright Continuum Labs - 2023

On this page
  • Breaking Down RLHF
  • Exploring the Possibilities
  • Safety versus Usefulness
  • The problem with human feedback

Was this helpful?

  1. Training
  2. The Fine Tuning Process
  3. Training Processes

Reinforcement Learning from Human Feedback (RLHF)

Most often useful when creating domain specific models

PreviousAn introduction to reinforcement learningNextDirect Preference Optimization: Your Language Model is Secretly a Reward Model

Last updated 1 year ago

Was this helpful?

Neural language models can generate text that is not only diverse but also contextually relevant and compelling has been remarkable. However, a significant challenge lies in defining what constitutes "good" text.

This is inherently subjective and varies widely depending on the context - be it creative writing, informative text, or executable code snippets.

Traditionally, language models have been trained using simple next-token prediction loss functions, such as cross-entropy. While this approach has its merits, it falls short in capturing the nuanced preferences of human readers.

A technique called Reinforcement Learning from Human Feedback (RLHF) was developed to train models to be more useful in human interactions - by using an approach incorporating human feedback directly into the model training process.

RLHF leverages methods from reinforcement learning to optimise language models based on actual human responses and preferences. This technique enables models to align more closely with complex human values, a feat that was previously unattainable with general corpus training alone.

Breaking Down RLHF

Pretraining Language Models

RLHF begins with a language model that's already been pretrained using classical objectives.

For instance, OpenAI used a smaller version of GPT-3 for InstructGPT, while other organisations like Anthropic and DeepMind have employed models ranging from 10 million to 280 billion parameters.

These models can be further fine-tuned, but the primary requirement is their ability to respond effectively to diverse instructions.

Reward Model Training

Central to RLHF is the generation of a reward model calibrated with human preferences. The goal is to create a system that evaluates a sequence of text and outputs a scalar reward representing human preference.

This model can either be a fine-tuned language model or one trained from scratch on preference data.

The training data consists of prompt-generation pairs, with human annotators ranking the outputs. This ranking is crucial as it normalises various assessment methods into a singular reward signal.

Fine-Tuning with Reinforcement Learning

Historically, training language models with RL was seen as a daunting task. However, recent advancements have made it possible to fine-tune a model using Proximal Policy Optimization (PPO), albeit with some parameters frozen due to the prohibitive costs of training extremely large models.

The RL process involves the model generating text based on a prompt, which is then evaluated by the reward model to assign a scalar 'preferability' score. Additionally, a penalty is applied for deviating too far from the initial pretrained model, ensuring coherence in the generated text.

Exploring the Possibilities

RLHF is still a burgeoning field with many uncharted territories.

The choice of the base model, the dynamics of reward model training, and the specific implementation of the RL optimizer all present a vast landscape of research opportunities.

Advanced algorithms like ILQL, which align well with offline RL optimisation, are beginning to emerge, offering new pathways to refine the RLHF process further.

Despite its potential, RLHF does face challenges, particularly in generating human preference data, which can be costly and time-consuming. Additionally, human annotators often have varying opinions, adding to the complexity and potential variance in training data. Yet, these limitations only underscore the vast potential for innovation in RLHF.

Safety versus Usefulness

Navigating the Balance Between Helpfulness and Harmlessness in RLHF Training

In the dynamic field of Reinforcement Learning from Human Feedback (RLHF), a critical challenge is achieving an optimal balance between the safety and utility of models. This balance is crucial as increasing the harmlessness of a model often leads to a decrease in its helpfulness.

The Concept of the 'Hostage Negotiator' Model

To address this issue, a nuanced approach, termed the 'hostage negotiator' model, is proposed.

This concept extends beyond the basic idea of harmlessness, which might traditionally involve a model refraining from responding to potentially harmful queries.

Instead, the 'hostage negotiator' model would enable the system to understand and articulate why certain requests might be harmful and engage in a dialogue that could lead users to reconsider their queries.

The challenge in training models to adopt this 'hostage negotiation' tactic lies in the nature of data collection for harmlessness. Typically, data collection processes may inadvertently focus on identifying clearly harmful responses without providing exposure to more sophisticated interactions.

As a result, models learn to avoid certain responses but do not necessarily learn how to navigate complex interactions constructively.

Advancing Towards Subtler Interaction Models

To evolve beyond this limitation, training efforts are shifting towards a higher emphasis on helpfulness prompts.

Future training strategies are expected to involve collecting harmlessness data where human annotators can identify the most constructive possible responses from models.

This method aims to enable models not just to avoid harmful interactions but to actively engage in nuanced and thoughtful dialogue.

Implications and Future Directions

While these concepts and methods are at an exploratory stage, they represent significant progress in the quest to develop RLHF models that are safe yet effectively useful.

These models are envisioned to adeptly handle the complexities of human interaction with both sophistication and sensitivity.

As this area of research advances, it is anticipated that RLHF systems will become more adept at balancing safety with practical utility, thereby enhancing their applicability and effectiveness in real-world scenarios.

The problem with human feedback

One of the most significant challenges lies in effectively incorporating human feedback into the learning process.

This task is far from straightforward, as it demands a deep understanding of various factors, including the intricacies of the acquisition function and the nuances of human psychology.

The Critical Role of Acquisition Function in RLHF

At the core of RLHF training is the acquisition function. This function is pivotal in determining the quality of queries presented to human labellers for feedback.

Unlike traditional active learning, which typically operates under a supervised learning setting, RLHF involves reinforcement learning.

This means the agent not only influences the data distribution but also decides which data should be labeled. As the policy of the RL agent changes, it necessitates the active generation of queries that are more informative.

Let's consider an example. In a customer service chatbot scenario, the acquisition function must weigh factors like the complexity of customer queries, the diversity of responses needed, and the cost of generating these responses quickly and effectively.

Here, uncertainty plays a crucial role, as the chatbot must navigate through ambiguous customer requests and provide helpful and precise responses.

Adaptive Choice of Feedback Type in RLHF

Choosing the right feedback type is crucial in RLHF.

This choice can depend on a variety of factors, including the rationality of the human labeler and task-specific requirements, which may evolve over time. For instance, in a medical diagnosis assistant application, the feedback type might need to adapt to the evolving complexity of medical cases and the varying expertise levels of medical professionals providing feedback.

Navigating Human Labelling Challenges in RLHF

Human labelling in RLHF intersects with disciplines like psychology and social sciences, as it encompasses designing interactions for informative query responses.

Understanding human psychology is essential for effective preference elicitation.

For instance, consider a language model used for educational content creation. The preference elicitation process must account for cognitive biases of educators and varying emotional responses of different age groups of students.

Ensuring High-Quality Labels and Researcher-Labeller Agreement

A significant challenge in RLHF is the mismatch between the researcher’s goals and the labeller's actual labels, known as researcher-labeler disagreement.

To combat this, methods like on-boarding, maintaining open communication, and providing labellers with feedback are crucial.

Imagine a scenario in an e-commerce recommendation system where labellers might have differing opinions on what constitutes a 'good' recommendation. Ensuring alignment between the researchers' objectives and labellers' understanding is critical for the system’s accuracy and effectiveness.

Conclusion: A Multidisciplinary Approach for Optimizing RLHF Systems

Active Learning in RLHF is a multifaceted process that requires careful consideration of factors ranging from the technical aspects of acquisition functions to the psychological elements of human interaction.

Addressing the complexities of human feedback and integrating insights from various fields are essential for creating RLHF systems that align closely with human behavior and preferences. This approach not only enhances the efficacy of RLHF models but also paves the way for their broader and more effective application across diverse domains.

LogoA Survey of Reinforcement Learning from Human FeedbackarXiv.org
A survey of Reinforcement Learning from Human Feedback
Page cover image