Skip to content

Instantly share code, notes, and snippets.

View alreadydone's full-sized avatar

Junyan Xu alreadydone

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

@alreadydone
alreadydone / Riemann hypothesis with aomni.md
Last active April 18, 2023 05:42
apparently entered a loop ...

Make as much progress towards solving the Riemann hypothesis as you can.

Share

April 18th, 2023

💀 Error

Progress

@alreadydone
alreadydone / SiegelGPT.md
Last active April 11, 2023 00:18
Warning: lots of hallucination due to lack of web browsing.

Name: SiegelGPT

Goal: Find out the status of Yitang Zhang's paper "Discrete mean estimates and the Landau-Siegel zero".

Embarking on a new goal:Find out the status of Yitang Zhang's paper "Discrete mean estimates and the Landau-Siegel zero".
Thinking...
Added task:Search for Yitang Zhang's paper "Discrete mean estimates and the Landau-Siegel zero"
Added task:Find out if the paper has been published in a journal or conference proceedings
Added task:Check for any news or updates on the status of the paper
Thinking...

Go: A Human Counterattack?

Lu Changhai

Last month, a news article titled "Man beats machine at Go in human victory over AI" caught my interest. The article was first published on February 17th by Financial Times. However, I was traveling in London at the time and missed the news by a few days. So, I decided to wait for follow-up news before discussing it. But as I waited, there were no further updates, so I decided to revisit the topic and discuss it again.

The news was about an American amateur 6-dan Go player, Kellin Pelrine, who used the vulnerabilities of the open-source Go programs KataGo and Leela Zero to defeat them with overwhelming superiority.

Before 2015, this type of news would not have made headlines because Go programs were far inferior to human players. However, since DeepMind's Go system, AlphaGo, defeated the French Chinese professional 2-dan player Fan Hui with a score of 5-0 in October 2015, and then defeated the 14-time world champion South Korean professional 9-dan player Lee

@alreadydone
alreadydone / LLMs.md
Created February 14, 2023 04:57 — forked from cedrickchee/LLMs.md
Fix typos and grammar of the original writing.

Some remarks on Large Language Models

Yoav Goldberg, January 2023

Audience: I assume you heard of ChatGPT, maybe played with it a little, and was impressed by it (or tried very hard not to be). And that you also heard that it is "a large language model". And maybe that it "solved natural language understanding". Here is a short personal perspective of my thoughts of this (and similar) models, and where we stand with respect to language understanding.

Intro

Around 2014-2017, right within the rise of neural-network based methods for NLP, I was giving a semi-academic-semi-popsci lecture, revolving around the story that achieving perfect language modeling is equivalent to being as intelligent as a human. Somewhere around the same time I was also asked in an academic panel "what would you do if you were given infinite compute and no need to worry about labor costs" to which I cockily responded "I would train a really huge language model, just to show that it doesn't solve everything!". We

@alreadydone
alreadydone / quotient_fin_choice.lean
Last active January 31, 2023 18:04
quotient.fin_choice without choice.
import data.fintype.basic
variables {ι : Type*} {α : ι → Type*} [S : Π i, setoid (α i)] {β : Sort*}
include S
def quotient.map_pi_pred (p : ι → Prop) (h : ∀ i, p i) :
@quotient (Π i, p i → α i) pi_setoid → @quotient (Π i, α i) pi_setoid :=
quotient.map (λ f i, f i $ h i) (λ f g he i, he i $ h i)
def quotient.map_pi_pred₂ (p₁ p₂ : ι → Prop) (h : p₂ ≤ p₁) :
@alreadydone
alreadydone / principal_invertible.lean
Created January 30, 2023 05:39
Invertible ideals in commutative semi-local rings are principal.
import ring_theory.dedekind_domain.ideal
/- https://math.stackexchange.com/a/95857/12932 -/
open_locale non_zero_divisors big_operators
namespace submodule
variables {R M N P : Type*}
variables [comm_semiring R] [add_comm_monoid M] [add_comm_monoid N] [add_comm_monoid P]
variables [module R M] [module R N] [module R P]
@alreadydone
alreadydone / nhds_set_semicontinuity.lean
Last active January 6, 2023 04:27
Characterizations of semi-continuity.
import topology.semicontinuous
open_locale topological_space filter
open topological_space set filter
variables {α β : Type*} [topological_space α] (f : α → β) (x : α)
section
variables [linear_order α] [t : order_topology α]
@alreadydone
alreadydone / length_space_path_emetric.lean
Last active January 24, 2023 16:50
Continuity of arclength and idempotency of path metric.
import analysis.bounded_variation
import topology.path_connected
/- Authors: Rémi Bottinelli, Junyan Xu -/
open_locale ennreal big_operators
noncomputable theory
section arclength
variables {α E : Type*} [linear_order α] [pseudo_emetric_space E] (f : α → E) {a b c : α}
@alreadydone
alreadydone / uniform_continuous_zero_at_infty_filter.lean
Last active December 12, 2022 08:35
Prove that functions that are zero at infinity are uniformly continuous, using filters.
import topology.uniform_space.basic
import topology.homeomorph
open_locale topological_space uniformity filter
open filter uniform_space set
variables {α β : Type*} [uniform_space α] [uniform_space β]
lemma is_compact.nhds_set_diagonal₁ {α} [uniform_space α] {s : set α} (hs : is_compact s) :
𝓝ˢ ((λ x, (x, x)) '' s) = 𝓤 α ⊓ 𝓝ˢ (prod.fst ⁻¹' s) :=