LLMs can learn self-restraint through iterative self-reflection

Alexandre Piché, Aristides Milios, Dzmitry Bahdanau, Chris Pal
5/15/2024
cs.CLcs.LG

No confident code implementation found for this paper. 2 possible matches can be shown below.

Abstract

In order to be deployed safely, Large Language Models (LLMs) must be capable of dynamically adapting their behavior based on their level of knowledge and uncertainty associated with specific topics. This adaptive behavior, which we refer to as self-restraint, is non-trivial to teach since it depends on the internal knowledge of an LLM. By default, LLMs are trained to maximize the next token likelihood, which does not teach the model to modulate its answer based on its level of uncertainty. In order to learn self-restraint, we devise a utility function that can encourage the model to produce responses only when it is confident in them. This utility function can be used to score generation of different length and abstention. To optimize this function, we introduce ReSearch, a process of "self-reflection" consisting of iterative self-prompting and self-evaluation. We use the ReSearch algorithm to generate synthetic data on which we finetune our models. Compared to their original versions, our resulting models generate fewer \emph{hallucinations} overall at no additional inference cost, for both known and unknown topics, as the model learns to selectively restrain itself. In addition, our method elegantly incorporates the ability to abstain by augmenting the samples generated by the model during the search procedure with an answer expressing abstention.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 2 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{pich2024llms,
  title  = {LLMs can learn self-restraint through iterative self-reflection},
  author = {Alexandre Piché and Aristides Milios and Dzmitry Bahdanau and Chris Pal},
  year   = {2024},
  eprint = {2405.13022},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2405.13022v2}
}

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/2405.13022.svg)](https://codeofpaper.com/paper/2405.13022)

Discussion