CWEM-KAN-LM-9.98k
a byte-level model for Korean
2 min readupdated
A miniature language model with 9,984 parameters trained from scratch directly on UTF-8 bytes without tokenizers or pre-training. The model uses a KAN (Kolmogorov-Arnold Network) V7 architecture based on wavelets and was trained exclusively on a Korean dialogue dataset with a User: / Assistant: template. Despite its tiny size, the network captures dialogue structure and polite endings, although it outputs nonsense instead of factual answers. The project is of interest to researchers exploring novel neural network architectures.
Key features
- Byte level: 256 possible byte values without vocabularies and BPE.
- V7 CWEM-KAN backbone: replacing standard layers with Chebyshev wavelet networks using a trainable grid.
- Tiny size: exactly 9,984 parameters with a context length of 128 bytes.
- Low perplexity: best validation score of 5.49 among the series counterparts.
What you can do
- Run generation: test text generation on raw bytes without tokenization.
- Explore KAN: test alternative layers instead of standard transformers.
- Study byte-level Korean: see how the model extracts the structure of the Korean language from UTF-8.
Example
import torch
from importlib import import_module
CKPT = import_module("cwom_kan.applications.byte_lm.V7-CWEM-KAN-ByteLM-checkpoint")
DATA = import_module("cwom_kan.applications.byte_lm.V7-CWEM-KAN-ByteLM-data")
model, meta = CKPT.load_checkpoint("CWEM-KAN-LM-9.98k-ko-from-scratch-chat-training.safetensors")
prompt = "User: 중력이 어떻게 작용하는지 설명해 주세요.\n\nAssistant:"
ids = torch.tensor([list(prompt.encode("utf-8"))], dtype=torch.int64)
out = model.generate(ids, 120, temperature=0.8, top_k=20)
print(DATA.decode_bytes(out[0])[len(prompt):])Read more
DetailsParameters: 9,984
Training steps: 5,200
Validation perplexity: 5.489
Limitations: empty responses without real facts, sometimes regenerates role tags repeatedly.










Comments