Couplet-base
Pretrained base model for the Couplet family (~268M)
A larger TinyGDN hybrid language model: recurrent GDN-2 memory plus gated GQA
What this is
Couplet-base is the pretrained (base) checkpoint for Couplet, the ~268M successor to the Monostich-2 family.
- Scales
kerzgrr/Monostich-2-basefrom ~149M to ~268M parameters - Hybrid Gated DeltaNet-2 recurrent layers + gated GQA full-attention layers
- This repo is pretrain-only raw text continuation
- Instruction-tuned / chat (SFT):
kerzgrr/Couplet
If you want chat behaviour, use kerzgrr/Couplet — this base model is for continuation / research and will not follow instructions reliably.
Model Architecture
Pipeline: Text Prompt → BPE-49K Tokenizer → TinyGDN Hybrid Decoder (28L) → Next-token Prediction
Hybrid block schedule (×28)
Every 4th layer is full attention; the rest are Gated DeltaNet-2:
GDN2, GDN2, GDN2, GQA, … (3:1 recurrent-to-attention)
| Component | Details |
|---|---|
| Gated DeltaNet-2 | Linear-time recurrent memory (flash-linear-attention) |
| Gated GQA | QK-normalized, partial RoPE, sigmoid output gate (6 Q / 2 KV, head dim 128) |
| MLP | SwiGLU |
| Norm | Zero-centered RMSNorm |
| Embeddings | Tied input / output |
Technical specifications
| Architecture | TinyGDN hybrid (GDN-2 + GQA) |
| Parameters | 267,857,662 deployable |
| Hidden size | 768 |
| Intermediate (MLP) | 2,048 |
| Layers | 28 |
| Attention | 6 Q heads / 2 KV heads (GQA) |
| Linear (GDN-2) | 6 heads × 128 dim |
| Context (trained) | 2,048 |
| Max position embeddings | 32,768 |
| Vocabulary | 49,152 (BPE) |
| RoPE θ | 1,000,000 (partial factor 0.5) |
| Precision (Hub weights) | bfloat16 EMA |
| Weight file | model.safetensors (~511 MiB) |
Training (pretrain)
| Dataset | FineWeb-Edu |
| Tokens (train, with EOS) | 5,468,769,413 |
| Sequence length | 2,048 |
| Objective | Next-token prediction |
| Optimizer | AdamW — β₁=0.9, β₂=0.95 |
| Peak LR | 3 × 10⁻⁴ |
| Warmup | 1% of steps |
| Grad clip | 1.0 |
| EMA | power EMA (max decay 0.9999) — this Hub file is the EMA weights |
| Checkpoint | optimizer step 10,431 (one full packed-corpus epoch) |
| Wall time | 87.81 hours |
| Val loss (EMA) | 3.1006 (ppl 22.21) |
Install
1) System requirements
- Python 3.10+
- CUDA GPU strongly recommended
- PyTorch with CUDA matching your driver
2) Create an environment
python -m venv .venv
# Windows
.venv\Scripts\activate
# Linux / macOS
source .venv/bin/activate
3) Install PyTorch
Pick the build for your platform from https://pytorch.org. Example:
pip install torch --index-url https://download.pytorch.org/whl/cu124
CPU-only:
pip install torch
4) Install Python deps
pip install safetensors tokenizers huggingface_hub
Flash Linear Attention is installed automatically by inference.py on first run (pinned commit + Windows import patches when needed). Git must be on PATH.
5) Download the inference script
curl -L -o inference.py https://huggingface.co/kerzgrr/Couplet-base/resolve/main/inference.py
# or Hugging Face CLI
hf download kerzgrr/Couplet-base inference.py --local-dir .
The script auto-downloads model.safetensors, config.json, tokenizer.json, and the tiny_gdn/ package from this repo.
Quick start
Single prompt (streams tokens):
python inference.py --prompt "The history of computing begins"
Interactive REPL:
python inference.py
Common options:
| Flag | Default | Description |
|---|---|---|
--prompt |
(none) | One-shot continuation; omit for REPL |
--temperature |
0.8 |
Sampling temperature |
--top-p |
0.95 |
Nucleus sampling |
--top-k |
50 |
Top-k (0 disables) |
--max-new-tokens |
256 |
Generation length |
--repetition-penalty |
1.08 |
Repetition penalty |
--context-length |
2048 |
Tokens kept in the window |
--seed |
42 |
RNG seed |
--device |
cuda if available |
cuda or cpu |
--no-stream |
off | Print the full completion at once |
--no-bos |
off | Do not prepend <|begin_of_text|> |
--local-dir |
(none) | Use a local snapshot directory |
Pretrain vs chat
| Couplet-base (this repo) | Couplet (SFT) | |
|---|---|---|
| Stage | Pretrain | Supervised fine-tune |
| Hub | this repo | kerzgrr/Couplet |
| Prompting | Raw text continuation | Chat / instruction template (ChatML) |
| Stop token | <|end_of_text|> |
Chat end-of-turn tokens |
| Use case | Research, continuation, probing | Assistants, dialogue |
Files
kerzgrr/Couplet-base/
README.md
inference.py
requirements.txt
model.safetensors
config.json
tokenizer.json
tokenizer_config.json
special_tokens_map.json
special_token_ids.json
merges.txt
vocab.json
tiny_gdn/
__init__.py
config.py
model.py
Limitations
- Base model: not instruction-tuned; may ramble or fail at Q&A format
- Scale: ~268M parameters — research / edge prototype, not a frontier model
- Dependency: requires
flash-linear-attention; not GGUF / llama.cpp compatible today - Context: trained at 2,048; longer windows are experimental
Model family
| Model | Parameters | Architecture | Stage | Hub |
|---|---|---|---|---|
| Monostich | ~100M | LLaMA-style | SFT | kerzgrr/Monostich |
| Monostich-2-base | ~150M | TinyGDN hybrid | Pretrain | kerzgrr/Monostich-2-base |
| Monostich-2 | ~150M | TinyGDN hybrid | SFT | kerzgrr/Monostich-2 |
| Couplet-base | ~268M | TinyGDN hybrid | Pretrain | this repo |
| Couplet | ~268M | TinyGDN hybrid | SFT | kerzgrr/Couplet |
Citation
@misc{coupletbase2026,
title={Couplet-base: A 268M Hybrid GDN-2 + GQA Language Model},
author={kerzgrr},
year={2026},
url={https://huggingface.co/kerzgrr/Couplet-base}
}
Acknowledgments
- flash-linear-attention (Gated DeltaNet-2)
- FineWeb-Edu
- Monostich-2 family:
kerzgrr/Monostich-2 - PyTorch SDPA / Hugging Face Hub + tokenizers
A couplet is a pair of lines — compact, connected, and complete.
- Downloads last month
- 227