Dynamic Rewarding with Prompt Optimization Enables Tuning-free Self-Alignment of Language Models

Paper · arXiv 2411.08733 · Published November 13, 2024
Test-Time ComputeReward ModelsLLM Alignment

Aligning Large Language Models (LLMs) traditionally relies on costly training and human preference annotations. Self-alignment seeks to reduce these expenses by enabling models to align themselves. To further lower costs and achieve alignment without any expensive tuning or annotations, we introduce a new tuningfree approach for self-alignment, Dynamic Rewarding with Prompt Optimization (DRPO). Our approach leverages a search-based optimization framework that allows LLMs to iteratively self-improve and craft the optimal alignment instructions, all without additional training or human intervention. The core of DRPO is a dynamic rewarding mechanism, which identifies and rectifies model-specific alignment weaknesses, allowing LLMs to adapt efficiently to diverse alignment challenges. Empirical evaluations on eight recent LLMs, both open- and closed-sourced, demonstrate that DRPO significantly enhances alignment performance, with base models outperforming their SFT/RLHF-tuned counterparts. Moreover, the prompts automatically optimized by DRPO surpass those curated by human experts, further validating the effectiveness of our approach.

Introduction. Aligning Large Language Models (LLMs, Brown et al. 2020; Chowdhery et al. 2023; Touvron et al. 2023a; Achiam et al. 2023) with human ethical standards and practical expectations is extremely crucial to prevent unintended consequences and ensure AI’s positive contribution to society. Traditional alignment methods, such as supervised finetuning (SFT) and reinforcement learning from human feedback (RLHF) (Bai et al., 2022b; Ouyang et al., 2022), are resource-intensive and require extensive human oversight, limiting their scalability and practicality. As LLMs grow more complex and widely adopted, the demand for cost-effective, annotation-efficient, and rapidly adaptable alignment strategies becomes increasingly urgent. Self-alignment aims to improve LLM alignment by leveraging the models themselves; for example, by replacing human feedback with modelgenerated feedback (Lee et al., 2023), synthesizing preference data (Kim et al., 2023; Sun et al., 2024), or self-critique (Bai et al., 2022b).

Discussion / Conclusion. This paper introduced Dynamic Rewarding with Prompt Optimization (DRPO), a tuning-free approach for self-aligning LLMs. DRPO integrates a novel dynamic rewarding mechanism into a search-based prompt optimization framework, enabling LLMs to self-improve model-specific alignment weaknesses adaptively. Experiments on eight LLMs show that DRPO-enhanced base models outperform SFT/RLHF-tuned counterparts, and its optimized prompts surpass those by human experts. DRPO’s adaptability and efficiency offer a promising path toward more personalized AI systems. While DRPO demonstrates significant advancements in tuning-free self-alignment of LLMs, there are a few potential limitations to discuss. Optimization cost. Tuning-free alignment does not come as a free lunch. Ideally, optimizing the alignment prompt for each query would probably be more effective, but its computational overhead is prohibitive. This concern is similar to the decodingbased alignment, where alignment-guided decoding needs to run per query.