Skip to content

Instantly share code, notes, and snippets.

@MatthewSteel
MatthewSteel / ttt.c
Created July 22, 2012 05:35
Minimax (full tree search) tic-tac-toe AI in C
//Tic-tac-toe playing AI. Exhaustive tree-search. WTFPL
//Matthew Steel 2009, www.www.repsilat.com
#include <stdio.h>
char gridChar(int i) {
switch(i) {
case -1:
return 'X';
case 0:
@aparrish
aparrish / understanding-word-vectors.ipynb
Last active July 9, 2024 15:59
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@TilakMaddy
TilakMaddy / Main.java
Last active November 19, 2023 12:55
A Java Starter Template for competitive programming in CodeChef, Hackerrank, etc w/ efficient coding rules and pre-designed pattern Ready to Use
/*
* No package must be added here because some Online Judges don't support it
* please remove, if any.
*
*/
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/*
@arghyadeep99
arghyadeep99 / linear-regression.ipynb
Created September 6, 2019 19:36
Linear Regression.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

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