wader-100m-base 🐟

A lightweight ~110M parameter Indonesian language model implementing the DeepSeek-V4 architecture (MLA, MoE, Hyper-Connections) trained from scratch on Indonesian corpus. This is the pretrained base model — see neosantara/wader-100m for the SFT/chat version.

Architecture

This model implements key DeepSeek-V4 innovations at a miniature scale:

Component Details
Parameters ~110M total (41M embeddings, 69M non-embedding)
Hidden size 320
Layers 8
Attention heads 8 (1 KV head — MQA-style)
Head dim 96 (32 RoPE + 64 NoPE)
MLA q_lora_rank=160, o_groups=2, o_lora_rank=80
MoE 4 routed experts + 1 shared, top-2 routing
Expert FFN SwiGLU, intermediate_size=640
Routing sqrtsoftplus scoring, noaux_tc method
Hyper-Connections hc_mult=4, Sinkhorn routing (2 iters)
Vocab 129,280 (DeepSeek-V4 tokenizer)
Context 2,048 tokens

DeepSeek-V4 Features Implemented

  • Multi-head Latent Attention (MLA): Compressed KV cache via latent projections.
  • Mixture of Experts (MoE): Sparse activation — only 2 of 4 routed experts active per token.
  • Hyper-Connections: Multi-copy hidden states with learned Sinkhorn routing replacing standard residual connections.
  • SwiGLU FFN: High-capacity feed-forward blocks with non-linear gating.
  • Grouped output projection: Structured parameter-efficient output routing.

Training

  • Datasets:
  • Steps: 5,000 steps (~35M+ tokens)
  • Batch size: 8 × 4 gradient accumulation = 32 effective
  • Sequence length: 2,048 tokens
  • Learning rate: 6e-4 (Cosine decay with warmup)
  • Optimizer: AdamW (β1=0.9, β2=0.95, weight_decay=0.1)
  • Precision: bf16 mixed precision
  • Hardware: NVIDIA H100 80GB HBM3 & RTX 4090 (Daytona Cloud)

Training Metrics

Metric Value
Initial Loss ~10.8
Final Loss ~0.41 - 0.58 (cross-entropy)
Token Accuracy ~88% - 93%

Usage

import torch
from transformers import AutoConfig, AutoModelForCausalLM, AutoTokenizer
from huggingface_hub import hf_hub_download
from safetensors.torch import load_file

# 1. Load config and model
repo_id = "neosantara/wader-100m-base"
config = AutoConfig.from_pretrained(repo_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_config(config, trust_remote_code=True).float()

# 2. Download and load weights
weights_path = hf_hub_download(repo_id, "model.safetensors")
state_dict = load_file(weights_path)
model.load_state_dict(state_dict, strict=True)
model = model.cuda().eval() if torch.cuda.is_available() else model.eval()

# 3. Load tokenizer
tokenizer = AutoTokenizer.from_pretrained(repo_id, trust_remote_code=True)

# 4. Generate Indonesian text completion
prompt = "Indonesia adalah negara kepulauan yang memiliki"
input_ids = tokenizer.encode(prompt, return_tensors="pt")
if torch.cuda.is_available():
    input_ids = input_ids.cuda()

with torch.no_grad():
    output = model.generate(
        input_ids,
        max_new_tokens=100,
        temperature=0.7,
        top_p=0.9,
        repetition_penalty=1.1,
        pad_token_id=tokenizer.eos_token_id,
    )

print(tokenizer.decode(output[0], skip_special_tokens=True))

Limitations

  • Small model size: 110M parameters designed for extreme edge efficiency and fast experimentation.
  • Pretrained only: This is a base model for text completion. For interactive chat, please use neosantara/wader-100m.
  • Custom architecture: Requires trust_remote_code=True.

License

Apache-2.0

Downloads last month
337
Safetensors
Model size
0.1B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for neosantara/wader-100m-base

Finetunes
1 model

Datasets used to train neosantara/wader-100m-base