Boris-Peacebell: A 141M-parameter compact LLM on World War II
2 min readupdated
A specialized chat model from OpenCerebral trained from scratch to answer questions about the events, figures, and chronology of World War II. This project is a cross-experiment featuring the Boris-2 architecture (31 layers, 512 hidden size, 32,768-token context) trained on synthetic datasets using the Peacebell tokenizer. It differs from standard transformers by including Canon layers (causal 1D convolution on attention projections) and a built-in 15M-parameter n-gram table for frequent bigrams and trigrams. It is suited for researchers of compact models and developers building local thematic bots in English.
Key features
- Hybrid architecture with 141.3M parameters: 126.3M for the transformer and embeddings, plus 15M for the frequent phrase table.
- Long 32,768-token context window with document isolation during sequence packing.
- ChatML dialogue format support and an open Apache 2.0 license for free use.
- Trained on 34 billion tokens (5 epochs) using Muon and AdamW optimizers.
What you can do
- Compare the efficiency of the Boris-2 architecture with the original Peacebell on identical historical datasets in experiments.
- Integrate it into local offline applications or educational history quiz bots in English.
- Use it as a lightweight base for further fine-tuning on narrow domain text corpora.
Example
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "KlondikeDev/Boris-Peacebell"
tok = AutoTokenizer.from_pretrained(repo, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(repo, trust_remote_code=True)
ids = torch.tensor([tok.build_chatml_ids([{"role": "user", "content": "Why did the Battle of Midway matter?"}])])
out = model.generate(ids, max_new_tokens=200, do_sample=True, temperature=0.7, top_p=0.9)Read more
DetailsBenchmarks: scores are not yet published (comparison with Peacebell is planned), final training loss reached 0.331.
Hardware and limitations: the model code lacks KV-caching, so long generation runs slowly; running in float32 or bfloat16 is supported (the sentencepiece package is required).
Accuracy: due to its small size (141M), the model may occasionally confuse dates and numbers, knows little outside the World War II topic, and has not undergone additional safety fine-tuning.










Comments