Downloads · 30 days
0
oscar128372/axon-pico-3m
axon-pico-3m is a text generation model from oscar128372. Use it when you need the model to write or continue text. It is set up for pytorch. The card lists the license as mit.
<div align="center" <img src="https://img.shields.io/badge/Parameters-3.0M-blue" alt="Parameters" <img src="https://img.shields.io/badge/Architecture-Axon-green" alt="Architecture" <img src="https://img.shields.io/bad…
Downloads · 30 days
0
Access
Public
Updated Jan 23, 2026
Repo size
24.5 MB
Likes
1
Public
Click a slice to open those files.
.pt24.5 MB · 100%
From the Hugging Face model README
[!NOTE] Visit this space to test out Axon! View how it chooses tokens and how sampling parameters change the behavior.
Axon-Pico-3M is an ultra-compact language model built on the novel Axon architecture, a recurrent neural network with multi-timescale diagonal memory and local convolution mixing. Unlike Transformers, Axon models have O(1) memory per token during inference, making them efficient for long-context generation.
Pico serves as a testbed for advanced training techniques at minimal compute cost. Despite having only half the parameters of Axon-Nano-6M, it incorporates several enhancements that improve training efficiency and final performance.
| Metric | Axon-Pico-3M | Axon-Nano-6M |
|---|---|---|
| Parameters | 3.0M | 6.2M |
| Vocab Size | 3,072 (BPE) | 2,048 (BPE) |
| Max Sequence | 384 | 256 |
| Training Steps | 10,500 | 5,000 |
| Val Loss | 1.812 | 1.727 |
| Val Perplexity | 6.12 | 5.62 |
| Training Time | ~2 hours | ~1 hour |
| Multi-Horizon | ✓ | ✗ |
| Self-Distillation | ✓ | ✗ |
| Curriculum Learning | ✓ | ✗ |
| HiPPO Init | ✓ | ✗ |
Despite having half the parameters, Pico achieves competitive perplexity thanks to the advanced training techniques. The gap in raw performance is smaller than the 2x parameter difference would suggest.
Instead of only predicting the next token, the model also learns to predict tokens 2, 4, and 8 steps ahead. This provides additional gradient signal and helps the model learn to plan ahead. The auxiliary losses are weighted by 1/k where k is the horizon distance.
An exponentially moving average of the model weights serves as a "teacher" model. The student (current model) learns from both hard labels (ground truth) and soft labels (teacher predictions). This provides richer gradient signal since soft labels contain information about relative token probabilities.
Training starts with short sequences (64 tokens) and gradually increases to the full length (384 tokens) over 3,000 steps using a square-root schedule. This allows the model to first master short-range patterns before tackling long-range dependencies.
The forget gate biases are initialized so that initial forget rates match the geometric mean of each timescale group's operating range. This follows principles from HiPPO (Gu et al., 2020), which showed that principled initialization of recurrent dynamics dramatically improves long-range learning.
| Enhancement | Configuration |
|---|---|
| Multi-Horizon | Steps: (1, 2, 4, 8), Weight: 0.15 |
| Self-Distillation | α=0.5, T=2.0, starts @ step 1000 |
| Curriculum | 64→384 tokens over 3000 steps (√ schedule) |
| EMA | Decay: 0.999, update every 10 steps |
| Step | Main Loss | Val Loss | Val PPL | Seq Length |
|---|---|---|---|---|
| 500 | 3.05 | 3.13 | 22.81 | 192 |
| 1000 | 2.52 | 2.59 | 13.28 | 248 |
| 2000 | 2.27 | 2.23 | 9.35 | 320 |
| 3000 | 2.12 | 2.07 | 7.92 | 384 |
| 5000 | 1.97 | 1.93 | 6.91 | 384 |
| 7500 | 1.84 | 1.85 | 6.36 | 384 |
| 10000 | 1.86 | 1.81 | 6.10 | 384 |
| 10500 | 1.80 | 1.81 | 6.12 | 384 |
The training logs reveal interesting dynamics from the advanced techniques:
=== Sample 1 ===
[INST] Visiting a movie with a good book could help us feel better today [/INST] That sounds like a nice idea, but I feel a bit sad today. [INST] I understand, sometimes sadness can come from unexpected places that we cannot see [/INST] Yes, it is hard to shake off the sadness and find some joy. [INST] Do you think talking about our feelings can help us feel less alone? [/INST] Talking can often bring comfort and remind us we are not alone in this. [INST] I hope tomorrow will be brighter and bring some happiness back into my day [/INST] Yes, each new day brings fresh chances for happiness and peace.
=== Sample 2 ===
[INST] Hello, I feel a bit scared about the dark clouds in the sky today. [/INST] It is understandable to feel fear when the sky looks so grey and dark. [INST] Yes, I keep thinking about how the weather can change our feelings so quickly. [/INST] The weather can really affect our mood and make us feel more down. [INST] I wish the sun would shine again and brighten everything up up. [/INST] Sunshine does bring warmth and comfort, making everything seem less heavy and more hopeful. [INST] Do you think it will get better soon, or will it stay this way? [/INST] It is hard to say, but sometimes hope can still come back in unexpected ways.
=== Sample 3 ===
[INST] Do you think it is strange how some people leave their trash in the park? [/INST] It is quite disgusting to see litter everywhere, isn't it? [INST] Yes, I feel disgusted when I see litter everywhere in our beautiful parks. [/INST] Many people do not understand how important it is to keep our environment clean. [INST] I wish more people would understand the importance of keeping our environment clean. [/INST] That would make a big difference and help everyone feel better about their surroundings. [INST] It is frustrating to see so much waste around us every day, isn't it? [/INST] Yes, it makes me wonder if we can change habits for the better.
import torch
from model import AxonModel, AxonConfig
from tokenizer import BPETokenizer
# Load checkpoint
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
ckpt = torch.load("axon-pico-3M-10Ksteps-BPE3072.pt", map_location=device)
# Extract components
config = ckpt["config"]
model = AxonModel(config).to(device)
# Handle torch.compile prefix in state dict
state_dict = {}
for k, v in ckpt["model_state_dict"].items():
if k.startswith("_orig_mod."):
k = k[10:]
state_dict[k] = v
model.load_state_dict(state_dict)
model.eval()
# Load tokenizer
tokenizer = BPETokenizer.from_dict(ckpt["tokenizer"])
# Generate
prompt = "[INST] Hello! [/INST]"
tokens = tokenizer.encode(prompt)
input_ids = torch.tensor([tokens], device=device)
with torch.no_grad():
for _ in range(100):
logits = model(input_ids)["logits"][:, -1, :]
next_token = torch.argmax(logits, dim=-1, keepdim=True)
input_ids = torch.cat([input_ids, next_token], dim=1)
output = tokenizer.decode(input_ids[0].tolist())
print(output)
[INST] ... [/INST])This model is intended for:
Not intended for:
@misc{axon2025,
title={Axon: Multi-Timescale Diagonal Memory for Efficient Sequence Modeling},
author={Oscar Lo},
year={2025},
url={https://huggingface.co/oscar128372/axon-pico-3M}
}
MIT