Skip to content

Instantly share code, notes, and snippets.

View knok's full-sized avatar

NOKUBI Takatsugu knok

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

@youheiakimoto
youheiakimoto / adversarial_cmaes.py
Last active January 17, 2023 04:28
Adversarial-CMA-ES: derivative-free min-max optimization solver using (1+1)-CMA-ES.
import numpy as np
from scipy import stats
import matplotlib.pyplot as plt
"""Adversarial-CMA-ES: derivative-free min-max optimization solver using (1+1)-CMA-ES [1]
It is an extention of Adversarial Evolution Strategy [2]
(https://gist.github.com/youheiakimoto/15212dbf46dc546af20af38b0b48ff17)
Reference
---------
@wktk
wktk / humanity-solver.user.js
Last active December 21, 2023 08:04
はてラボ人間性センター自動入力
// ==UserScript==
// @name Humanity Solver
// @version 1
// @grant none
// @include http://human.hatelabo.jp/quiz?*
// @include https://human.hatelabo.jp/quiz?*
// ==/UserScript==
// 下記URLを参考に過不足分を補正したもの
// https://web.archive.org/web/20210104141218/https://anond.hatelabo.jp/20210104230501
@shyouhei
shyouhei / gist:63d91a7934f31ef08e08ef4f23d0a30b
Created August 29, 2020 14:26
フルタイムでオープンソース・ソフトウェアを開発すると開発者にはどういう変化が訪れるか(個人の感想レベル)

フルタイムでオープンソース・ソフトウェアを開発すると開発者にはどういう変化が訪れるか(個人の感想レベル)

高給に耐えるという謎の感覚が涵養される

特に何もやってあげてないのに他人(法人だけどさ)から何百万何千万のお金が何年もとめどなく注ぎ込まれてきたら、怖くないですか?

オープンソース・ソフトウェアの開発者だけで給料をもらうというのは、まさにこの現象が発生してくるわけ。それまでもこれからも、ずっとオープンソース・ソフトウェアの開発者はやってきたし、やっていくわけでしょう。そんなの会社があってもなくても、別にやることなんて変わらないじゃない。じゃあなんで、ある時から急にかなりの金額が振り込まれてきてしまうんだ?しかもあからさまに物価上昇を上回る結構なハイペースで昇給していく。やっていることは一切何も変わってないのに!

この状況に適応するまでにはいささかの時間を要しました。根が小心者なので。

@0b5vr
0b5vr / genbun.glsl
Last active August 7, 2021 14:55
prod05 sierpinski chord by 0x4015完全理解した
// https://www.youtube.com/watch?v=H8UqnTE3mUY より引用
#define A for(int i=0;i<9;++i){int y=p>>((p>>19)+i&3),z=p*((878086607>>(i&7)*4)&15)*(510+1%5)>>14;if((p>>15&1<<(i&15))>0)s.y+=float(((y>>7&z*3|y>>11&z*6)&1023)-512)/3e4;}
vec2 mainSound(float t){int p=int(t*144e3);vec2 s;A;s.yx=s;p-=65536;A;return s*mat2(7,1,5,-3);}
@rjhansen
rjhansen / keyservers.md
Last active October 22, 2025 05:42
SKS Keyserver Network Under Attack

SKS Keyserver Network Under Attack

This work is released under a Creative Commons Attribution-NoDerivatives 4.0 International License.

Terminological Note

"OpenPGP" refers to the OpenPGP protocol, in much the same way that HTML refers to the protocol that specifies how to write a web page. "GnuPG", "SequoiaPGP", "OpenPGP.js", and others are implementations of the OpenPGP protocol in the same way that Mozilla Firefox, Google Chromium, and Microsoft Edge refer to software packages that process HTML data.

Who am I?

@sile
sile / README.md
Last active April 1, 2024 07:33
Optunaを使ってFFmpegのエンコードパラメータを最適化してみる

概要

  • Optunaというハイパーパラメータ最適化ツールを使って、FFmpegでの動画エンコードパラメータの最適化を試してみた結果のメモ
  • 具体的には、決められた制約(後述)下で、画質(SSIM)を最大化するようなパラメータ群を自動で見つけ出すのが目的
  • 結果としては、
    • 画質的には、FFmpegが提供しているプリセットの中で二番目に重いもの(slower)より若干良い程度のパラメータ群が見つかった
    • また、Optunaが見つけたパラメータ群の方がslowerに比べて、CPU負荷が小さかった

方針

@DavidBuchanan314
DavidBuchanan314 / cursed_mandelbrot.c
Last active June 28, 2023 15:12
Compile-time mandelbrot in pure C. Outputs a PGM image file to stdout. Output can be seen at https://twitter.com/David3141593/status/1062468528115200001
#include <stdio.h>
#define SQ(x) (x)*(x)
#define M0(x,y) SQ(x)+SQ(y)<4?0:0xe0
#define M1(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M0(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0)):0xc0
#define M2(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M1(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0xa0
#define M3(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M2(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0x80
#define M4(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M3(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0x60
#define M5(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M4(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0x40
@tos-kamiya
tos-kamiya / pypy3とpipのインストール Ubuntu 18.04.md
Last active January 28, 2021 18:33
pypy3とpipのインストール Ubuntu 18.04

(2020.01.11追記)

Pypy 7.3.0からインストール方法が大幅に変更されたので、公式の説明に従って、ディストリビューションに応じた方法に従うのを推奨します。

https://pypy.org/download.html


(2019.03.12更新)

@shyouhei
shyouhei / chart.png
Last active September 29, 2017 05:50
chart.png