CoolFace
Modelpublic

Evicka/Hanse2-100M-Base

sourceHugging Faceapache-2.0updated 1mo agoView on Hugging Face
0likes202downloads
Model Card

<h1 align="center">Hanse2-100M Base</h1>

<p align="center"> German–English base language model · 99.1M parameters · 20B pretraining tokens · up to 8K context </p>

[image]

[!IMPORTANT] Hanse2-100M-Base is a base model, not a chat assistant. It has not been instruction-tuned, preference-tuned, or safety-aligned. Use it as a text-completion model or as a starting point for continued pretraining and post-training.

Hanse2-100M-Base is a 99,144,320-parameter decoder-only causal language model trained from scratch on 19,999,752,192 German and English tokens. It uses a compact Llama-style architecture, a custom 32K byte-level BPE tokenizer, grouped-query attention, and a three-stage pretraining curriculum that progressively extends context length from 2K to 8K.

The model was trained on a single AMD Radeon RX 9070 XT 16 GB, and the repository includes the tokenizer-training, pretraining, and inference scripts used for the project.

Highlights

  • —99.1M parameters, trained from scratch
  • —19.999B pretraining tokens (~201.7 tokens per parameter)
  • —German + English, approximately 56% / 44% by planned token share
  • —2K → 4K → 8K progressive context curriculum
  • —32K custom byte-level BPE tokenizer
  • —Single-GPU training on an AMD Radeon RX 9070 XT 16 GB
  • —Reproducible project code for tokenizer training, pretraining, and inference
  • —Apache-2.0 release

Model overview

Model typeDecoder-only causal language model
ArchitectureLlama-style Transformer
Parameters99,144,320
LanguagesGerman, English
Vocabulary32,000
Training tokens19,999,752,192
Tokens / parameter~201.7
Configured context8,192 tokens
Training precisionbfloat16
Position encodingRoPE, θ = 10,000
EmbeddingsTied input/output embeddings
Instruction tunedNo
Safety alignedNo

Architecture

HyperparameterValue
Hidden size640
Layers16
Attention heads10
KV heads2
Head dimension64
Intermediate size2,048
Vocabulary size32,000
RoPE θ10,000
Tied embeddingsYes

Pretraining

Pretraining used three consecutive phases while keeping the effective optimizer batch at approximately 131,072 tokens per optimizer step.

PhasePurposeTokensContextMicro batchGrad. accum.Learning rate
1Broad bilingual pretraining~15B2,0482321% warmup → constant 6e-4
2Quality-focused annealing~4B4,0961321% warmup, 3e-4 → 3e-5, 1-sqrt decay
3Cooldown + context extension~1B8,192116cosine 3e-5 → 1e-5

[image]

Data mixture

Approximate token share over the full curriculum:

SourceShare
German FineWeb43.5%
English FineWeb-Edu39.0%
German FineWiki12.5%
English FineWiki5.0%

This corresponds to approximately 56% German / 44% English.

Optimization

SettingValue
OptimizerAdamW
β1 / β20.9 / 0.95
Weight decay0.1
Gradient clipping1.0
Effective batch~131,072 tokens / optimizer step
Training precisionbfloat16
FrameworkPyTorch + Transformers
AttentionSDPA / AOTriton on ROCm
torch.compileDisabled
Hardware1× AMD Radeon RX 9070 XT 16 GB
PlatformWindows + ROCm

Final held-out evaluation loss after Phase 3 was approximately 2.825 on the fixed bilingual evaluation split.

Tokenizer

Hanse2 uses a custom 32,000-token byte-level BPE tokenizer trained on a German–English mixture.

Several tokens were reserved for later instruction/tool post-training. They were not used as a chat format during base pretraining, and this checkpoint should not be prompted with an assumed chat template.

Evaluation

The following model-comparison results were produced with the EleutherAI LM Evaluation Harness using the same local setup for Hanse2-100M and Supra-50M:

  • —0-shot
  • —no chat template
  • —bfloat16
  • —identical task implementations
  • —identical random seeds
BenchmarkMetricHanse2-100MSupra-50M
ARC Easyacc_norm0.43060.4609
ARC Challengeacc_norm0.24150.2534
HellaSwagacc_norm0.31220.3171
WinoGrandeacc0.49800.5107
PIQAacc_norm0.60830.6219
OpenBookQAacc_norm0.29600.3080
BoolQacc0.59660.5294
SciQacc_norm0.63800.6770
BLiMPacc0.80030.7778
MultiBLiMP Germanacc0.98520.7698
MultiBLiMP Germanacc_norm0.97740.6710

Hanse2 remains close to Supra-50M on several English benchmarks while substantially improving the German linguistic evaluation.

Long-context diagnostic

The model is configured for 8,192 tokens and produces finite forward passes at ~7.7K tokens. This does not imply reliable retrieval across the full context window.

A small base-LM continuation test placed a one-token identifier earlier in a synthetic context and measured its next-token rank against nine decoys.

ContextNeedle positionAccuracyMean rankMean margin
51210%1.001.0010.08
51250%1.001.0010.35
51290%1.001.009.31
1,02410%1.001.009.82
1,02450%1.001.0010.68
1,02490%1.001.008.14
2,04810%1.001.008.11
2,04850%1.001.0010.19
2,04890%1.001.0011.40
4,09610%0.206.70-4.22
4,09650%1.001.0010.34
4,09690%1.001.0011.35
7,68010%0.005.90-2.58
7,68050%0.005.40-3.46
7,68090%1.001.0011.13

The model can process long inputs, but retrieval degrades when relevant information is several thousand tokens away from the prediction point. Treat this as a small synthetic diagnostic, not a standardized long-context benchmark.

Quickstart

Transformers

python
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "Evicka/Hanse2-100M-Base"

tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    torch_dtype=torch.bfloat16,
    device_map="auto",
)
model.eval()

prompt = "Artificial intelligence is"
inputs = tokenizer(
    prompt,
    return_tensors="pt",
    return_token_type_ids=False,
).to(model.device)

with torch.inference_mode():
    output = model.generate(
        **inputs,
        max_new_tokens=150,
        do_sample=True,
        temperature=0.5,
        top_k=25,
        top_p=0.9,
        repetition_penalty=1.2,
        pad_token_id=tokenizer.pad_token_id,
        eos_token_id=tokenizer.eos_token_id,
    )

print(tokenizer.decode(output[0], skip_special_tokens=True))
[!NOTE] This is a completion model. Prompts such as sentence beginnings, paragraphs, or documents to continue are more appropriate than chat-style system/user/assistant messages.

Reproducibility

The repository includes the core scripts needed to reproduce or adapt the project:

FilePurpose
train_tokenizer.pyTrain the custom byte-level BPE tokenizer
train.pyRun the three-phase pretraining pipeline
inference.pyMinimal local text generation

The training pipeline includes exact token-budget accounting, resumable checkpoints, deterministic held-out evaluation, and separate context/batch settings for each phase.

The initial training/tokenizer code was based on the Apache-2.0-licensed Supra-50M training scripts and was substantially rewritten and extended for Hanse2. No Supra model weights were used to initialize Hanse2.

Re-running the scripts does not by itself guarantee bit-identical reproduction across different hardware, driver, PyTorch, ROCm, dataset revisions, or nondeterministic kernels.

Intended use

Hanse2-100M-Base is intended primarily for:

  • —research on small language models
  • —German–English pretraining experiments
  • —bilingual data-mixture studies
  • —tokenizer and architecture experiments
  • —progressive context-extension experiments
  • —benchmarking and ablations
  • —continued pretraining
  • —supervised fine-tuning / post-training research
  • —education and consumer-hardware experimentation

Limitations

At ~99M parameters, Hanse2 is a small research model. Expect:

  • —weak factual recall and hallucinations
  • —weak arithmetic and multi-step reasoning
  • —repetition or topic drift
  • —brittle knowledge of specific entities
  • —limited long-range coherence and retrieval
  • —unstable behavior outside its training distribution

The checkpoint has no instruction tuning, preference tuning, RLHF, refusal training, or production safety guardrails. It may generate inaccurate, biased, offensive, harmful, or otherwise undesirable continuations.

The configured 8K context length should not be interpreted as reliable 8K retrieval capability; see the long-context diagnostic above.

License

Released under the Apache License 2.0. See `LICENSE`.

Acknowledgements

  • —Hugging Face — Transformers, Datasets, Tokenizers, FineWeb, FineWeb-Edu, and FineWiki
  • —EleutherAI — LM Evaluation Harness
  • —SupraLabs — original Apache-2.0 Supra-50M training/tokenizer scripts used as the starting point for the project code

Citation

If you use Hanse2-100M-Base in a project, a link to the model repository is appreciated.

bibtex
@misc{brauer2026hanse2base100m,
  author = {Erik Brauer},
  title  = {Hanse2-100M-Base},
  year   = {2026},
  url    = {https://huggingface.co/Evicka/Hanse2-100M-Base}
}