Chain of Hindsight Aligns Language Models with Feedback

Hao Liu, Carmelo Sferrazza, P. Abbeel
2/12/2026

No official code found. Best implementation: haoliuhl/chain-of-hindsight (228 stars, Apache-2.0, last commit 2023-09-30). 2 more below.

Abstract

Learning from human preferences is important for language models to match human needs and to align with human and social values. Prior works have achieved remarkable successes by learning from human feedback to understand and follow instructions. Nonetheless, these methods are either founded on hand-picked model generations that are favored by human annotators, rendering them inefficient in terms of data utilization and challenging to apply in general, or they depend on reinforcement learning, which often suffers from imperfect reward functions and relies on extremely challenging optimizations. In this work, we propose a novel technique, Chain of Hindsight, that is easy to optimize and can learn from any form of feedback, regardless of its polarity. Our idea is inspired by how humans learn from extensive feedback presented in the form of languages. We convert all types of feedback into sequences of sentences, which are then used to fine-tune the model, allowing us to take advantage of the language comprehension capabilities of language models. We condition the model on a sequence of model generations paired with feedback. By doing so, the model is trained to generate outputs based on feedback, while learning to identify and correct negative attributes or errors. Applying our method to large language models, we observed that Chain of Hindsight significantly surpasses previous methods in aligning language models with human preferences. We report significant improvements on summarization and dialogue benchmarks, with our approach markedly preferred in human evaluations.

View on arXivView PDF

Code Implementations(3)

Apache-2.0

Simple next-token-prediction for RLHF

22816Shell, PythonFeb 20, 20233 years agoApache-2.0
large-language-modelslearning-from-human-feedbackrlhf
mukhal/CoH-pytorchCommunity63%
MIT

pytorch implementation of the paper "Chain of Hindsight Aligns Language Models with Feedback"

40Mar 2, 20233 years agoMIT

Unofficial implementation of Chain of Hindsight (https://arxiv.org/abs/2302.02676) using pytorch and huggingface Trainers.

112Shell, PythonMar 20, 20233 years ago

Similar Papers

Cite this paper

@article{liu2026chain,
  title  = {Chain of Hindsight Aligns Language Models with Feedback},
  author = {Hao Liu and Carmelo Sferrazza and P. Abbeel},
  year   = {2026},
  eprint = {2302.02676},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/pdf/2302.02676},
  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/2302.02676.svg)](https://codeofpaper.com/paper/2302.02676)

Discussion