World's first bi-drectional brainrot translator.
Youwei Zhen 2024
All slang terms and definitions live in vocabulary.json (originally from List of Generation Z slang - Wikipedia, plus common terms like lowkey, fr and ngl). Each term can list aliases (inflections such as "ghosted" or "no cap") that count as the same term.
Training data is generated by qwen3.8:27b through the CHUNGUS API, in the spirit of self-instruct. There are two kinds:
- Translation pairs. The model writes a natural slang message using 1-3 required terms on a topic from
topics.json, then a plain-English version with the same meaning. Pairs are kept only when a required term actually appears (matched on word boundaries), then deduplicated, including near-duplicates found withbge-m3embeddings. Each pair trains both directions. - Definitions. For every term, varied questions and answers about what it means: "what does X mean", quoted messages, how to use it, reverse lookups ("what's the word for..."), and whether it's rude. This teaches the model the meaning of each word directly instead of only through example sentences.
Ver. 1 fine-tuned gpt2-large with LoRA. Ver. 2 used Llama-2-7B GPTQ.
Ver. 3 (current) fine-tunes gpt2-large again with a fixed setup:
- LoRA (r=32) on all linear layers. Earlier versions only adapted q/k because of a missing comma in
target_modules. - Loss is computed only on the answer, not on the prompt or padding.
- One model handles three tasks: English to slang, slang to English, and explaining terms.
The prompt format lives in common.py. Models with a chat template use it automatically, so switching BASE_MODEL to an instruct model needs no code changes.
- Create a virtual environment and install dependencies:
uv venv .venv && uv pip install --python .venv/bin/python -r requirements.txt- Copy
.env.exampleto.envand fill in your CHUNGUS API key..envis git-ignored.
CHUNGUS_BASE_URL="https://chungus.antodono.com/v1"
CHUNGUS_API_KEY=""
GEN_MODEL="qwen3.8:27b"
BASE_MODEL="gpt2-large"
DEVICE="cuda:0"- Generate data (resumable; rerun the same command to continue):
python data_generation.py define --per-word 16 # Q&A about each term
python data_generation.py pairs --n 6000 # translation pairs
python data_generation.py build # dedupe + split into data/{train,val,test}.jsonl- Fine-tune. The adapter is saved to
./adapters/<model name>(e.g.adapters/gpt2-large):
python finetune.py # BASE_MODEL from .env
python finetune.py --model Qwen/Qwen3-0.6B # -> adapters/qwen3-0.6b- Evaluate on the held-out test set (chrF, slang usage, leftover slang, definition accuracy). Pass the same
--modelyou trained:
python eval.py- Try it:
python translate.py --task en-to-slang
python translate.py --task slang-to-en
python translate.py --task define