CoolFace
Modelpublic

mlnomad/goat-vvv-d12-fineweb-5x-pytorch

sourceHugging Faceapache-2.0updated 5mo agoView on Hugging Face
0likes22downloads
Model Card

GOAT_VVV d=12 · FineWeb-Edu 5× Chinchilla (PyTorch)

GOATVVV attention: **no Q/K projections and no V projection**. Queries, keys, AND values are all the same RoPE'd `xheads (hence "VVV"). Only attention params per layer: c_proj` + per-head bias / ε scalars.

x_heads = RoPE(x.reshape(B, T, H, D))
dots    = x_heads @ x_heads^T
dist²   = ||x_i||² + ||x_j||² − 2·dots
scores  = (dots + softplus(b))² / (dist² + softplus(ε))
scores  = L1_normalize(scores)    # strict causal j<i
y       = scores @ x_heads         # ← no V projection
y       = c_proj(y)

Architecture

Params88,867,190 (~88.9M)
Depth / n_embd / headsd=12 / 768 / 12
MLPYatNMN-Softplus (scalar bias + learnable α)
DataFineWeb-Edu sample-100BT
Tokens23.99B (5× Chinchilla)
Final smooth loss2.7709
Wiki-2 PPL (5K tokens)46.26
HardwareTPU v6e-8 (europe-west4-a), fp32, ~10.6h

Complexity vs GPT-2

Per-layer: GPT-2 = 12 n², GOAT_VVV = 9 n² (25% fewer params — dropped all of Q/K/V projections). Activation memory during forward is ~⅓ of GPT-2's for the attention block (no separate Q/K/V tensors). No KV cache needed — values are derived from the residual.

Usage

python
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained(
    "mlnomad/goat-vvv-d12-fineweb-5x-pytorch",
    trust_remote_code=True,
)
tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-v0.1")

ids = tokenizer("The capital of France is", return_tensors="pt").input_ids
out = model.generate(ids, max_new_tokens=30, do_sample=True, temperature=0.8, top_p=0.9)
print(tokenizer.decode(out[0], skip_special_tokens=True))

License

Apache 2.0.