Skip to content

Instantly share code, notes, and snippets.

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

@Malarkey73
Malarkey73 / R and Julia Vectorisation
Last active January 1, 2016 05:09
A slightly different comparison of R and Julia vectorisation closer to what most R people mean when they say "vectorised". The code example is plucked from the Julia blog discussion on code optimisation. Surprisingly for this use case Julia devectorised (~=0.18 secs) is just a little better than Julia vectorised (~= 0.25 secs), which is a little…
This is sort of a reply to this post:
http://www.johnmyleswhite.com/notebook/2013/12/22/the-relationship-between-vectorized-and-devectorized-code/
which arises from a a discussion of this
http://julialang.org/blog/2013/09/fast-numeric/
So....
@netj
netj / memusg
Last active January 29, 2024 15:04
memusg -- Measure memory usage of processes
#!/usr/bin/env bash
# memusg -- Measure memory usage of processes
# Usage: memusg COMMAND [ARGS]...
#
# Author: Jaeho Shin <netj@sparcs.org>
# Created: 2010-08-16
############################################################################
# Copyright 2010 Jaeho Shin. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #