Skip to content

Instantly share code, notes, and snippets.

A::B is a system with 4 tokens: `A#`, `#A`, `B#` and `#B`.
An A::B program is a sequence of tokens. Example:
B# A# #B #A B#
To *compute* a program, we must rewrite neighbor tokens, using the rules:
A# #A ... becomes ... nothing
A# #B ... becomes ... #B A#
@odellus
odellus / CoT_dspy.py
Created December 10, 2023 19:36
short script for evaluating a 4bit quantized stablelm-zephyr-3b with DSPy's CoT method.
"""
Basically a carbon copy of
https://github.com/stanfordnlp/dspy/blob/main/examples/math/gsm8k/CoT.ipynb
I downloaded their optimized few shot prompt
https://github.com/stanfordnlp/dspy/blob/main/examples/math/gsm8k/turbo_8_8_10_gsm8k_200_300.json
This code also only works with this branch of DSPy
https://github.com/odellus/dspy/tree/quantize-hf-w-bnb
"""

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

@rain-1
rain-1 / LLM.md
Last active June 28, 2025 14:59
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.

@YukiSnowy
YukiSnowy / main.cpp
Last active April 3, 2025 13:45
example SDL2 Vulkan application
// Windows
// g++ *.cpp -o vulkan -lSDL2main -lSDL2 -lvulkan-1
// Linux
// g++ *.cpp -o vulkan -lSDL2main -lSDL2 -lvulkan
// https://vulkan-tutorial.com/
#include <iostream>
using namespace std;
#include <SDL2/SDL.h>
@Nikolaj-K
Nikolaj-K / category_theory_literature.md
Last active September 16, 2024 10:26
Recomended reading for the undergrad category theorist
@seLain
seLain / openproject.conf
Last active April 25, 2025 19:45
nginx config for openproject
# assume :
# - openproject installed in /opt/openproject
# - local port: 6000
# - external port: 6020
server {
listen 6020;
server_name SERVER_DOMAIN_NAME;
root /opt/openproject/public;