RAIN: Your Language Models Can Align Themselves without Finetuning

Yuhui Li, Fangyun Wei, Jinjing Zhao, Chao Zhang, Hongyang Zhang
2/12/2026

No official code found. Best implementation: SafeAILab/RAIN (99 stars, BSD-2-Clause, last commit 2024-05-23).

Abstract

Large language models (LLMs) often demonstrate inconsistencies with human preferences. Previous research typically gathered human preference data and then aligned the pre-trained models using reinforcement learning or instruction tuning, a.k.a. the finetuning step. In contrast, aligning frozen LLMs without requiring alignment 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 rewind and 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. 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 from 82% of vanilla inference to 97%, while maintaining the helpfulness rate. On the TruthfulQA dataset, RAIN improves the truthfulness of the already-well-aligned LLaMA-2-chat 13B model by 5%.

View on arXivView PDF

Code Implementations(1)

SafeAILab/RAINCommunity100%
BSD-2-Clause

[ICLR'24] RAIN: Your Language Models Can Align Themselves without Finetuning

994PythonOct 8, 20232 years agoBSD-2-Clause
ai-safetyalignmentlarge-language-models

Similar Papers

Cite this paper

@article{li2026rain,
  title  = {RAIN: Your Language Models Can Align Themselves without Finetuning},
  author = {Yuhui Li and Fangyun Wei and Jinjing Zhao and Chao Zhang and Hongyang Zhang},
  year   = {2026},
  eprint = {2309.07124},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/pdf/2309.07124},
  journal = {ICLR 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2309.07124.svg)](https://codeofpaper.com/paper/2309.07124)

Discussion