Skip to content

Instantly share code, notes, and snippets.

View jrnold's full-sized avatar

Jeffrey Arnold jrnold

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

@laggardkernel
laggardkernel / startup-time-of-zsh.md
Last active October 27, 2024 08:23
Comparison of ZSH frameworks and plugin managers

Comparison of ZSH frameworks and plugin managers

Changelog

  • update 1: add a FAQ section
  • update 2: benchmark chart and feature comparison table
  • update 3:
    • improve the table with missing features for antigen
    • new zplg times result

TLDR

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@carlislerainey
carlislerainey / probit-product-term.R
Created December 1, 2017 23:05
code to understand product terms and probit models
# code to understand product terms and probit models
# clear workspace
rm(list = ls())
# load packages
library(tidyverse)
library(plotly)
# parameters
# metadata
data_source <- "https://docs.google.com/spreadsheets/d/1xa0iLqYKz8x9Yc_rfhtmSOJQ2EGgeUVjvV4A8LsIaxY/htmlview?sle=true#gid=0"
data_collectors <- "Jeremy Pressman (@djpressman, U of Connecticut) and\nErica Chenoweth (@EricaChenoweth, U of Denver)"
code_gist <- "https://gist.github.com/benmarwick/a1ac9c7235ebef542824512162ff2f44"
# ------------------------------------------------------------------------
# read in data from google sheets to get a data frame
@mattblackwell
mattblackwell / clinton-rust-belt.R
Last active January 1, 2017 09:39
Analysis of the shift from 2012 to 2016
group.mean <- function(x, group) {
out <- tapply(x, group, mean, na.rm = TRUE)
out[group]
}
data(state.fips, package = "maps")
state.fips <- unique(state.fips[,c("fips","abb")])
state.fips$abb <- as.character(state.fips$abb)
state.fips <- rbind(state.fips, c(2, "AK"))
state.fips <- rbind(state.fips, c(15, "HI"))
@mbjoseph
mbjoseph / leung_drton_factor_analysis.R
Last active January 16, 2020 08:56
Factor analysis sandbox
# Simulation script for factor analysis ala Leung & Drton (2016) ----------
library(rstan)
library(bayesplot)
m <- 5 # dimension of observed data (e.g., # traits)
k <- 2 # number of latent factors
n <- 100 # number of sample units (e.g., # species)
# residual variance matrix (is diagonal)
Omega <- diag(.3 + abs(rnorm(m, sd = .3)))
@leeper
leeper / checkurls.R
Last active April 30, 2016 06:36
Check URLs in a document
# Check URLs in a document
## This code will extract URLs from a text document using regex,
## then execute an HTTP HEAD request on each and report whether
## the request failed, whether a redirect occurred, etc. It might
## be useful for cleaning up linkrot.
if (!require("httr")) {
install.packages("httr", repos = "http://cran.rstudio.com/")
}
@hrbrmstr
hrbrmstr / orig.png
Last active July 16, 2023 06:43
Supreme Annotations - moar splainin here: http://rud.is/b/2016/03/16/supreme-annotations/ - NOTE: this requires the github version of ggplot2
orig.png
@bishboria
bishboria / springer-free-maths-books.md
Last active October 3, 2024 09:17
Springer made a bunch of books available for free, these were the direct links