Skip to content

Instantly share code, notes, and snippets.

View HakeemDemi's full-sized avatar
💭
In the beginning was the Code…

Hakeem Demi HakeemDemi

💭
In the beginning was the Code…
  • London UK
View GitHub Profile

Reinforcement Learning for Language Models

Yoav Goldberg, April 2023.

Why RL?

With the release of the ChatGPT model and followup large language models (LLMs), there was a lot of discussion of the importance of "RLHF training", that is, "reinforcement learning from human feedback". I was puzzled for a while as to why RL (Reinforcement Learning) is better than learning from demonstrations (a.k.a supervised learning) for training language models. Shouldn't learning from demonstrations (or, in language model terminology "instruction fine tuning", learning to immitate human written answers) be sufficient? I came up with a theoretical argument that was somewhat convincing. But I came to realize there is an additional argumment which not only supports the case of RL training, but also requires it, in particular for models like ChatGPT. This additional argument is spelled out in (the first half of) a talk by John Schulman from OpenAI. This post pretty much

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jph00
jph00 / epi_sir_basic.ipynb
Created September 12, 2021 12:59
Basic SIR epidemic model
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
"""
Dual p-norms illustrated.
For any norm |.|, the dual norm is defined as |y|_* = max{ <x, y> for |x| <= 1 }.
The figure shows the unit balls of the p-norm, for p = 1.5, 2, and 3.
We compute the dual norm at a dual vector y (short black arrow), rotating
uniformly around the origin over time.
@simecek
simecek / styleformer-demo.ipynb
Created August 6, 2021 17:02
Styleformer demo.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.