RAIN: Your Language Models Can Align Themselves without Finetuning

Authors: Yuhui Li, Fangyun Wei, Jinjing Zhao, Chao Zhang, Hongyang Zhang

Submitted to arXiv on 13 Sep. 2023
Abstract

Large language models (LLMs) often demonstrate inconsistencies with human preferences. Previous research gathered human preference data and then aligned the pre-trained models using reinforcement learning or instruction tuning, the so-called finetuning step. In contrast, aligning frozen LLMs without any extra data is more appealing. This work explores the potential of the latter setting. We discover that by integrating self-evaluation and rewind mechanisms, unaligned LLMs can directly produce responses consistent with human preferences via self-boosting. We introduce a novel inference method, Rewindable Auto-regressive INference (RAIN), that allows pre-trained LLMs to evaluate their own generation and use the evaluation results to guide backward rewind and forward generation for AI safety. Notably, RAIN operates without the need of extra data for model alignment and abstains from any training, gradient computation, or parameter updates; during the self-evaluation phase, the model receives guidance on which human preference to align with through a fixed-template prompt, eliminating the need to modify the initial prompt. Experimental results evaluated by GPT-4 and humans demonstrate the effectiveness of RAIN: on the HH dataset, RAIN improves the harmlessness rate of LLaMA 30B over vanilla inference from 82% to 97%, while maintaining the helpfulness rate. Under the leading adversarial attack llm-attacks on Vicuna 33B, RAIN establishes a new defense baseline by reducing the attack success rate from 94% to 19%.

The papers around it, by date and closeness

Higher is closer to this paper; left is older. Lines join papers close to each other: groups of lines are sub-topics. Select a point to see why it is there. Back to the summary of this paper

How to read this map? Illustrated guide

Closest papers Prior work it builds on Papers that cite it

Papers around this one

Ranked by how close their title and abstract are to this paper’s. Select some to read them together.

Closest papers

  1. Very close Another approach to the problem
    Fine-tuning Language Models with Generative Adversarial Feedback
    Zhang Ze Yu, Lau Jia Jaw, Wong Qin Jiang et al. · 2023 · Computation and Language · cited 10 times · AI summary available

    Generative Adversarial Feedback aligns language model outputs through reinforcement learning, whereas RAIN aligns frozen models during inference.

    Abstract

    Reinforcement Learning with Human Feedback (RLHF) has been demonstrated to significantly enhance the performance of large language models (LLMs) by aligning their outputs with desired human values. However, RLHF is constrained by the expertise and productivity limitations of human evaluators. In this study, we investigate an alternative approach: Reinforcement Learning with Generative Adversarial Feedback (RLGAF) to RLHF. Our preliminary findings indicate that RLGAF can help align LLMs outputs while not suffering from the inherent restrictions of RLHF, suggesting promising avenues for further research on automating AI alignment.

  2. Very close Same question
    Meta-Rewarding Language Models: Self-Improving Alignment with LLM-as-a-Meta-Judge
    Tianhao Wu, Weizhe Yuan, Olga Golovneva et al. · 2024 · Computation and Language · cited 236 times · Not summarized yet

    Meta-Rewarding improves alignment through models judging their own responses and judgments, while RAIN uses self-evaluation to guide generation without training.

    Abstract

    Large Language Models (LLMs) are rapidly surpassing human knowledge in many domains. While improving these models traditionally relies on costly human data, recent self-rewarding mechanisms (Yuan et al., 2024) have shown that LLMs can improve by judging their own responses instead of relying on human labelers. However, existing methods have primarily focused on improving model responses rather than judgment capabilities, resulting in rapid saturation during iterative training. To address this issue, we introduce a novel Meta-Rewarding step to the self-improvement process, where the model judges its own judgements and uses that feedback to refine its judgment skills. Surprisingly, this unsupe…

  3. Very close Another approach to the problem Cited by this paper
    LIMA: Less Is More for Alignment
    Chunting Zhou, Pengfei Liu, Puxin Xu et al. · 2023 · Computation and Language · cited 1,557 times · AI summary available

    LIMA aligns a LLaMa model by supervised fine-tuning on curated examples, while RAIN avoids fine-tuning and extra alignment data.

    Abstract

    Large language models are trained in two stages: (1) unsupervised pretraining from raw text, to learn general-purpose representations, and (2) large scale instruction tuning and reinforcement learning, to better align to end tasks and user preferences. We measure the relative importance of these two stages by training LIMA, a 65B parameter LLaMa language model fine-tuned with the standard supervised loss on only 1,000 carefully curated prompts and responses, without any reinforcement learning or human preference modeling. LIMA demonstrates remarkably strong performance, learning to follow specific response formats from only a handful of examples in the training data, including complex querie…

  4. Very close Another approach to the problem
    Aligning Large Language Models via Fully Self-Synthetic Data
    Shang-Jian Yin, Zhepei Wei, Xin-Yu Zhu et al. · 2025 · Annual Meeting of the Association for Computational Linguistics · cited 5 times · Not summarized yet

    Self-Alignment Optimization trains on model-generated prompts, responses, and preferences, while RAIN aligns frozen models without training.

    Abstract

    Traditional reinforcement learning from human feedback (RLHF) for large language models (LLMs) relies on expensive human-annotated datasets, while Reinforcement Learning from AI Feedback (RLAIF) also incurs significant costs, requiring the collection of diverse prompts and corresponding responses, often necessitating external reward models or proprietary models like GPT-4 to annotate preference pairs. In this work, we introduce Self-Alignment Optimization (SAO), a fully self-synthetic framework for LLM alignment, where all training data, including prompts (i.e., user queries), responses, and preferences, are generated by the model itself. Specifically, SAO first instructs the LLM to engage i…

  5. Very close Same question Cites this paper
    Linear Alignment: A Closed-form Solution for Aligning Human Preferences without Tuning and Feedback
    Songyang Gao, Qi-Ming Ge, Wei Shen et al. · 2024 · International Conference on Machine Learning · cited 28 times · Not summarized yet

    Linear Alignment targets human-preference alignment without tuning or feedback, as RAIN does, using a different inference-time algorithm.

    Abstract

    The success of AI assistants based on Language Models (LLMs) hinges on Reinforcement Learning from Human Feedback (RLHF) to comprehend and align with user intentions. However, traditional alignment algorithms, such as PPO, are hampered by complex annotation and training requirements. This reliance limits the applicability of RLHF and hinders the development of professional assistants tailored to diverse human preferences. In this work, we introduce \textit{Linear Alignment}, a novel algorithm that aligns language models with human preferences in one single inference step, eliminating the reliance on data annotation and model training. Linear alignment incorporates a new parameterization for …

  6. Very close Another approach to the problem
    Teaching Language Models to Self-Improve by Learning from Language Feedback
    Chi Hu, Yi-Ming Hu, Hang Cao et al. · 2024 · Annual Meeting of the Association for Computational Linguistics · cited 15 times · Not summarized yet

    Self-Refinement Tuning uses critiques and refinements to align models through continued learning, while RAIN self-evaluates during inference without training.

    Abstract

    Aligning Large Language Models (LLMs) with human intentions and values is crucial yet challenging. Current methods primarily rely on human preferences, which are costly and insufficient in capturing nuanced feedback expressed in natural language. In this paper, we present Self-Refinement Tuning (SRT), a method that leverages model feedback for alignment, thereby reducing reliance on human annotations. SRT uses a base language model (e.g., Tulu2) to generate initial responses, which are critiqued and refined by a more advanced model (e.g., GPT-4-Turbo). This process enables the base model to self-evaluate and improve its outputs, facilitating continuous learning. SRT further optimizes the mod…

  7. Very close Another approach to the problem Cited by this paper A method it uses
    RRHF: Rank Responses to Align Language Models with Human Feedback without tears
    Zheng Yuan, Hongyi Yuan, Chuan-Qi Tan et al. · 2023 · Neural Information Processing Systems · cited 580 times · Not summarized yet

    RRHF aligns models by ranking sampled responses during training, while RAIN uses self-evaluation and rewind during inference.

    Abstract

    Reinforcement Learning from Human Feedback (RLHF) facilitates the alignment of large language models with human preferences, significantly enhancing the quality of interactions between humans and models. InstructGPT implements RLHF through several stages, including Supervised Fine-Tuning (SFT), reward model training, and Proximal Policy Optimization (PPO). However, PPO is sensitive to hyperparameters and requires multiple models in its standard implementation, making it hard to train and scale up to larger parameter counts. In contrast, we propose a novel learning paradigm called RRHF, which scores sampled responses from different sources via a logarithm of conditional probabilities and lear…

  8. Very close Another approach to the problem
    Parameter-Efficient Tuning Helps Language Model Alignment
    Tianci Xue, Ziqi Wang, Heng Ji · 2023 · arXiv.org · preprint, not peer reviewed · cited 8 times · Not summarized yet

    Parameter-efficient tuning supports controllable alignment to multiple preferences through training, unlike RAIN's training-free inference method.

    Abstract

    Aligning large language models (LLMs) with human preferences is essential for safe and useful LLMs. Previous works mainly adopt reinforcement learning (RLHF) and direct preference optimization (DPO) with human feedback for alignment. Nevertheless, they have certain drawbacks. One such limitation is that they can only align models with one preference at the training time (e.g., they cannot learn to generate concise responses when the preference data prefers detailed responses), or have certain constraints for the data format (e.g., DPO only supports pairwise preference data). To this end, prior works incorporate controllable generations for alignment to make language models learn multiple pre…

Prior work it builds on

  1. Close Review Used in depth by this paper A method it uses
    Open Problems and Fundamental Limitations of Reinforcement Learning from Human Feedback
    Stephen Casper, Xander Davies, Claudia Shi et al. · 2023 · Trans. Mach. Learn. Res. · cited 1,011 times · AI summary available

    This paper surveys RLHF's limitations and related methods, while RAIN presents a training-free approach to alignment.

    Abstract

    Reinforcement learning from human feedback (RLHF) is a technique for training AI systems to align with human goals. RLHF has emerged as the central method used to finetune state-of-the-art large language models (LLMs). Despite this popularity, there has been relatively little public work systematizing its flaws. In this paper, we (1) survey open problems and fundamental limitations of RLHF and related methods; (2) overview techniques to understand, improve, and complement RLHF in practice; and (3) propose auditing and disclosure standards to improve societal oversight of RLHF systems. Our work emphasizes the limitations of RLHF and highlights the importance of a multi-faceted approach to the…

  2. Close Groundwork for this paper A method it uses
    Fine-Tuning Language Models from Human Preferences
    Daniel M. Ziegler, Nisan Stiennon, Jeffrey Wu et al. · 2019 · Computation and Language · preprint, not peer reviewed · cited 2,840 times · AI summary available

    This work applies reward learning from human judgments to language tasks, providing an earlier training-based approach to preference alignment.

    Abstract

    Reward learning enables the application of reinforcement learning (RL) to tasks where reward is defined by human judgment, building a model of reward by asking humans questions. Most work on reward learning has used simulated environments, but complex information about values is often expressed in natural language, and we believe reward learning for language is a key to making RL practical and safe for real-world tasks. In this paper, we build on advances in generative pretraining of language models to apply reward learning to four natural language tasks: continuing text with positive sentiment or physically descriptive language, and summarization tasks on the TL;DR and CNN/Daily Mail datase…

  3. Close Groundwork for this paper A method it uses
    Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedback
    Yuntao Bai, Andy Jones, Kamal Ndousse et al. · 2022 · Computation and Language · preprint, not peer reviewed · cited 4,479 times · AI summary available

    This work uses human preference modeling and reinforcement learning to make assistants helpful and harmless, the training-based alignment setting RAIN contrasts with.

    Abstract

    We apply preference modeling and reinforcement learning from human feedback (RLHF) to finetune language models to act as helpful and harmless assistants. We find this alignment training improves performance on almost all NLP evaluations, and is fully compatible with training for specialized skills such as python coding and summarization. We explore an iterated online mode of training, where preference models and RL policies are updated on a weekly cadence with fresh human feedback data, efficiently improving our datasets and models. Finally, we investigate the robustness of RLHF training, and identify a roughly linear relation between the RL reward and the square root of the KL divergence be…

  4. Close Groundwork for this paper A method it uses
    Principle-Driven Self-Alignment of Language Models from Scratch with Minimal Human Supervision
    Zhiqing Sun, Yikang Shen, Qinhong Zhou et al. · 2023 · Machine Learning · cited 478 times · AI summary available

    SELF-ALIGN uses principles and LLM generation to align models with minimal human supervision, an earlier self-alignment approach that RAIN contrasts with.

    Abstract

    Recent AI-assistant agents, such as ChatGPT, predominantly rely on supervised fine-tuning (SFT) with human annotations and reinforcement learning from human feedback (RLHF) to align the output of large language models (LLMs) with human intentions, ensuring they are helpful, ethical, and reliable. However, this dependence can significantly constrain the true potential of AI-assistant agents due to the high cost of obtaining human supervision and the related issues on quality, reliability, diversity, self-consistency, and undesirable biases. To address these challenges, we propose a novel approach called SELF-ALIGN, which combines principle-driven reasoning and the generative power of LLMs for…

  5. Close Groundwork for this paper
    RLAIF: Scaling Reinforcement Learning from Human Feedback with AI Feedback
    Harrison Lee, Samrat Phatale, Hassan Mansoor et al. · 2023 · Computation and Language · cited 773 times · AI summary available

    RLAIF substitutes AI-generated preference labels for human feedback in reinforcement learning, addressing the costly feedback problem that motivates training-free alignment.

    Abstract

    Reinforcement learning from human feedback (RLHF) is effective at aligning large language models (LLMs) to human preferences, but gathering high quality human preference labels is a key bottleneck. We conduct a head-to-head comparison of RLHF vs. RL from AI Feedback (RLAIF) - a technique where preferences are labeled by an off-the-shelf LLM in lieu of humans, and we find that they result in similar improvements. On the task of summarization, human evaluators prefer generations from both RLAIF and RLHF over a baseline supervised fine-tuned model in ~70% of cases. Furthermore, when asked to rate RLAIF vs. RLHF summaries, humans prefer both at equal rates. These results suggest that RLAIF can y…

Papers that cite it

  1. Close Builds on this paper Uses this paper in depth
    Amulet: ReAlignment During Test Time for Personalized Preference Adaptation of LLMs
    Zhaowei Zhang, Fengshuo Bai, Qi-Zhi Chen et al. · 2025 · International Conference on Learning Representations · cited 35 times · Not summarized yet

    Amulet cites RAIN and also adapts preferences at test time without training, extending inference-time alignment toward personalized preferences.

    Abstract

    How to align large language models (LLMs) with user preferences from a static general dataset has been frequently studied. However, user preferences are usually personalized, changing, and diverse regarding culture, values, or time. This leads to the problem that the actual user preferences often do not coincide with those trained by the model developers in the practical use of LLMs. Since we cannot collect enough data and retrain for every demand, researching efficient real-time preference adaptation methods based on the backbone LLMs during test time is important. To this end, we introduce Amulet, a novel, training-free framework that formulates the decoding process of every token as a sep…

  2. Close Builds on this paper Uses this paper in depth
    Safety Alignment of Large Language Models via Contrasting Safe and Harmful Distributions
    Xiao-Yun Zhang, Zheng-Yue Zhao, Wen-Xuan Shi et al. · 2024 · AAAI Conference on Artificial Intelligence · cited 8 times · Not summarized yet

    This method cites RAIN and aligns safety at decoding time by contrasting safe and harmful distributions rather than using RAIN's rewind mechanism.

    Abstract

    With the widespread application of Large Language Models (LLMs), it has become a significant concern to ensure their safety and prevent harmful responses. While current safe-alignment methods based on instruction fine-tuning and Reinforcement Learning from Human Feedback (RLHF) can effectively reduce harmful responses from LLMs, they often require high-quality datasets and heavy computational overhead during model training. Another way to align language models is to modify the logit of tokens in model outputs without heavy training. Recent studies have shown that contrastive decoding can enhance the performance of language models by reducing the likelihood of confused tokens. However, these …

  3. Close Broader context
    The Unlocking Spell on Base LLMs: Rethinking Alignment via In-Context Learning
    Bill Yuchen Lin, Abhilasha Ravichander, Ximing Lu et al. · 2023 · arXiv.org · preprint, not peer reviewed · cited 334 times · Not summarized yet

    This paper analyzes how alignment tuning changes base-model token distributions and discusses LIMA, providing context for RAIN's frozen-model alignment.

    Abstract

    The alignment tuning process of large language models (LLMs) typically involves instruction learning through supervised fine-tuning (SFT) and preference tuning via reinforcement learning from human feedback (RLHF). A recent study, LIMA (Zhou et al. 2023), shows that using merely 1K examples for SFT can achieve significant alignment performance as well, suggesting that the effect of alignment tuning might be"superficial."This raises questions about how exactly the alignment tuning transforms a base LLM. We analyze the effect of alignment tuning by examining the token distribution shift between base LLMs and their aligned counterpart. Our findings reveal that base LLMs and their alignment-tune…

  4. Close Builds on this paper
    InferAligner: Inference-Time Alignment for Harmlessness through Cross-Model Guidance
    Pengyu Wang, Dong Zhang, Linyang Li et al. · 2024 · Conference on Empirical Methods in Natural Language Processing · cited 108 times · Not summarized yet

    InferAligner cites RAIN and targets inference-time harmlessness alignment, using guidance from another model rather than RAIN's self-evaluation.

    Abstract

    As large language models (LLMs) rapidly evolve, they are increasingly being customized through fine-tuning to suit the specific needs of various applications. A critical aspect of this advancement is the alignment process, which ensures that these models perform tasks in ways that align with human values and expectations. Current alignment methods, such as direct preference optimization (DPO) and reinforcement learning from human feedback (RLHF), focus primarily on alignment during training phase. However, these methods often involve complex and resource-intensive training processes, posing significant challenge for their implementation. Therefore, we propose InferAligner, a simple yet effec…

  5. Close Broader context Uses this paper in depth
    Robust Prompt Optimization for Defending Language Models Against Jailbreaking Attacks
    Andy Zhou, Bo Li, Hao-Han Wang · 2024 · Neural Information Processing Systems · cited 200 times · Not summarized yet

    Robust Prompt Optimization defends language models against jailbreaking by optimizing system prompts, addressing a safety threat also tested by RAIN.

    Abstract

    Despite advances in AI alignment, large language models (LLMs) remain vulnerable to adversarial attacks or jailbreaking, in which adversaries can modify prompts to induce unwanted behavior. While some defenses have been proposed, they have not been adapted to newly proposed attacks and more challenging threat models. To address this, we propose an optimization-based objective for defending LLMs against jailbreaking attacks and an algorithm, Robust Prompt Optimization (RPO) to create robust system-level defenses. Our approach directly incorporates the adversary into the defensive objective and optimizes a lightweight and transferable suffix, enabling RPO to adapt to worst-case adaptive attack…

How are these papers found?

We compare the title and abstract of this paper with those of every paper summarized on this site, and with the papers Semantic Scholar recommends, those it cites and those citing it (for a much-cited paper, its most recent citations and, from OpenAlex, the most cited ones). Among the prior work and the follow-ups, the papers that use each other in depth, a method it uses and the much-cited follow-ups come a little higher. The levels (very close, close, related) come from the similarity of the texts, not from a judgment of quality; * marks a paper without an abstract, compared by its title. The sentence under a paper is written by an AI from the two abstracts: check it in the papers. A paper marked not relevant by three readers leaves the list.

Updated on 5 November 2026.

The illustrated guide to the papers around a paper