Fully redesigned successor to Nano-nano v4.5.
~298M Qwen3 parameters trained with sequence packing on a quality-tiered 34-dataset mix.
Features loss-boost system: auto-extends training if loss > 4.95 (up to 3×75 steps).
Goal: loss < 2.5 through compute efficiency, not raw scale.
📋 Summary
Architecture
LLaMA decoder-only
Parameters
~1218.3 M
Context
2 048 tokens
Vocabulary
50,304 tokens
Training loss
2.0444
Eval score
16.7%
Tokens trained
0.01 B (sequence-packed)
Hardware
GTX 1080 8 GB (Pascal)
🏗️ Architecture (v4 → v4.5 → v5.1)
Hyperparameter
v4
v4.5
v5.1
Parameters
~236 M
~256 M
~1218.3 M (~1.218 B)
hidden_size
896
896
1 024
intermediate_size
2 688
2 912
2 730 (8/3×hidden)
num_hidden_layers
14
15
16
num_attention_heads
14
14
16
num_key_value_heads
14
14
16
head_dim
64
64
64
vocab_size
50 264
50 264
50,304
max_position_embeddings
1 024
2 048
2 048
rms_norm_eps
1e-6
1e-6
1e-5
rope_theta
10 000
10 000
10 000
rope_scaling
—
linear 2×
linear 2×
tie_word_embeddings
False
False
False
Sequence packing
❌
❌
✅ 1× packed
Architecture
LLaMA
LLaMA
Qwen3
GQA (KV heads)
14 full
16 full
8 (16Q/8KV)
QK-Norm
❌
❌
✅
rope_theta
10k
10k
1M
📊 Evaluation
Category
Hits
Score
Knowledge
0/5
🔴 0%
Reasoning
0/4
🔴 0%
Hallucination
0/4
🔴 0%
Instruction
2/4
🟡 50%
Coherence
1/3
🔴 33%
Overall
—
🔴 17%
Hallucination resistance tests whether the model correctly declines or hedges
on unanswerable questions (future events, fictional entities, impossible premises).
fromtransformersimportAutoModelForCausalLM,AutoTokenizermodel=AutoModelForCausalLM.from_pretrained("ray0rf1re/Nano-Nano_v5.1",torch_dtype="auto",device_map="auto")tokenizer=AutoTokenizer.from_pretrained("ray0rf1re/Nano-Nano_v5.1")defchat(prompt:str,max_new_tokens:int=256)->str:# <think> opens the reasoning block; model outputs reasoning then </think> then answertext=("<|im_start|>user" + prompt + "<|im_end|>""<|im_start|>assistant<think>")inputs=tokenizer(text,return_tensors="pt").to(model.device)out=model.generate(**inputs,max_new_tokens=max_new_tokens,do_sample=True,temperature=0.7,top_p=0.9,repetition_penalty=1.1,pad_token_id=tokenizer.eos_token_id,)returntokenizer.decode(out[0][inputs["input_ids"].shape[-1]:],skip_special_tokens=True).strip()print(chat("Write a Python function to merge two sorted lists."))print(chat("Solve: if 3x + 7 = 22, what is x?"))print(chat("Explain transformer attention in simple terms."))
⚠️ Limitations
Context limited to 2 048 tokens
Trained on 0.01 B tokens — far below production scale
Pascal GPU (GTX 1080): fp16 AMP only, no bf16
Not RLHF/DPO aligned
📜 Citation
@misc{nano-nano-v5,author={ray0rf1re},title={Nano-Nano v5.1: 300M LLaMA with Sequence Packing},year={2026},publisher={HuggingFace},howpublished={https://huggingface.co/ray0rf1re/Nano-Nano_v5.1},}