Stage 1 initial: step 1000, loss=0.29, cka=0.60
Browse files- README.md +80 -0
- stage1_checkpoint.pt +3 -0
- stage1_metadata.json +21 -0
- student_config.yaml +31 -0
- training_config.yaml +108 -0
README.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- multilingual
|
| 4 |
+
- en
|
| 5 |
+
- es
|
| 6 |
+
- hi
|
| 7 |
+
- zh
|
| 8 |
+
- ar
|
| 9 |
+
- sw
|
| 10 |
+
- tr
|
| 11 |
+
- ja
|
| 12 |
+
- id
|
| 13 |
+
- te
|
| 14 |
+
license: apache-2.0
|
| 15 |
+
tags:
|
| 16 |
+
- mamba
|
| 17 |
+
- moe
|
| 18 |
+
- ssm
|
| 19 |
+
- multilingual
|
| 20 |
+
- distillation
|
| 21 |
+
- aya
|
| 22 |
+
library_name: aetheris
|
| 23 |
+
pipeline_tag: text-generation
|
| 24 |
+
---
|
| 25 |
+
|
| 26 |
+
# Aetheris — Hybrid Mamba-MoE Multilingual Model
|
| 27 |
+
|
| 28 |
+
**Aetheris** is a ~800M parameter hybrid SSM/MoE language model distilled from
|
| 29 |
+
[CohereLabs/tiny-aya-global](https://huggingface.co/CohereLabs/tiny-aya-global) (3.35B).
|
| 30 |
+
|
| 31 |
+
Built by [Wayy Research](https://github.com/Wayy-Research).
|
| 32 |
+
|
| 33 |
+
## Architecture
|
| 34 |
+
|
| 35 |
+
- **Type**: Hybrid Mamba (SSM) + Mixture of Experts (MoE)
|
| 36 |
+
- **Layers**: 24 (interleaved: even=SSM, odd=MoE)
|
| 37 |
+
- **Hidden dim**: 1024
|
| 38 |
+
- **Experts**: 4 per MoE layer, top-1 routing
|
| 39 |
+
- **SSM state dim**: 16
|
| 40 |
+
- **Vocab size**: 256,000 (shared with tiny-aya-global)
|
| 41 |
+
- **Parameters**: ~800M
|
| 42 |
+
|
| 43 |
+
## Training
|
| 44 |
+
|
| 45 |
+
3-stage MambaInLlama distillation pipeline:
|
| 46 |
+
|
| 47 |
+
| Stage | Method | Data | Steps |
|
| 48 |
+
|-------|--------|------|-------|
|
| 49 |
+
| 1 | CKA-guided Layer Alignment | ClimbMix | 10,000 |
|
| 50 |
+
| 2 | KL Distillation (T=2.0, alpha=0.7) | ClimbMix | 20,000 |
|
| 51 |
+
| 3 | Supervised Fine-Tuning | aya_collection | 5,000 |
|
| 52 |
+
|
| 53 |
+
Key research findings applied:
|
| 54 |
+
- SSM 10x LR boost (compensates 27x gradient imbalance)
|
| 55 |
+
- SVD split for MoE expert initialization (CKA=0.097 diversity)
|
| 56 |
+
- Per-language KL tracking for multilingual equity
|
| 57 |
+
|
| 58 |
+
## Current Checkpoint
|
| 59 |
+
|
| 60 |
+
- **Stage**: 1 (layer-alignment)
|
| 61 |
+
- **Step**: 1000
|
| 62 |
+
- **Loss**: 0.4459
|
| 63 |
+
- **Updated**: 2026-03-12T21:27:28.377034+00:00
|
| 64 |
+
|
| 65 |
+
## Languages
|
| 66 |
+
|
| 67 |
+
Supports 70+ languages inherited from tiny-aya-global. Core evaluation
|
| 68 |
+
languages: English, Spanish, Hindi, Chinese, Arabic, Swahili, Turkish,
|
| 69 |
+
Japanese, Indonesian, Telugu.
|
| 70 |
+
|
| 71 |
+
## Citation
|
| 72 |
+
|
| 73 |
+
```bibtex
|
| 74 |
+
@misc{aetheris2026,
|
| 75 |
+
title={Aetheris: Hybrid Mamba-MoE Multilingual Model via Knowledge Distillation},
|
| 76 |
+
author={Wayy Research},
|
| 77 |
+
year={2026},
|
| 78 |
+
url={https://huggingface.co/wayyresearch/aetheris}
|
| 79 |
+
}
|
| 80 |
+
```
|
stage1_checkpoint.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2f58f5ce1d22f5e3a4144c29157a695ff88e9a1e07767a52b59a20d774560fa0
|
| 3 |
+
size 1644712894
|
stage1_metadata.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"step": 1000,
|
| 3 |
+
"checkpoint_file": "best.pt",
|
| 4 |
+
"timestamp": "2026-03-12T21:27:28.377034+00:00",
|
| 5 |
+
"cka_history_keys": [
|
| 6 |
+
"0_0",
|
| 7 |
+
"1_1",
|
| 8 |
+
"3_2",
|
| 9 |
+
"4_3",
|
| 10 |
+
"6_4"
|
| 11 |
+
],
|
| 12 |
+
"final_loss": 0.4459029510617256,
|
| 13 |
+
"best_loss": 0.4196140021085739,
|
| 14 |
+
"training_config": {
|
| 15 |
+
"loss_type": "mse+cosine",
|
| 16 |
+
"cka_threshold": 0.75,
|
| 17 |
+
"seed": 42
|
| 18 |
+
},
|
| 19 |
+
"stage": 1,
|
| 20 |
+
"stage_name": "layer-alignment"
|
| 21 |
+
}
|
student_config.yaml
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
## Aetheris Student Model Configuration
|
| 2 |
+
## Target: ~500-800M parameters (HybridMambaMoE)
|
| 3 |
+
##
|
| 4 |
+
## Architecture: 24 layers alternating SSM (even) and MoE (odd)
|
| 5 |
+
## Vocab sized to match Aya tokenizer (256k)
|
| 6 |
+
##
|
| 7 |
+
## Wayy Research, 2024-2026
|
| 8 |
+
|
| 9 |
+
vocab_size: 256000
|
| 10 |
+
d_model: 1024
|
| 11 |
+
n_layer: 24
|
| 12 |
+
num_experts: 4
|
| 13 |
+
top_k: 1
|
| 14 |
+
d_ff: 3072 # d_model * 3
|
| 15 |
+
|
| 16 |
+
# SSM parameters
|
| 17 |
+
ssm_d_state: 16
|
| 18 |
+
ssm_expand: 2
|
| 19 |
+
# d_inner: null # defaults to d_model * ssm_expand = 2048
|
| 20 |
+
|
| 21 |
+
# Training parameters
|
| 22 |
+
load_balancing_coef: 0.01
|
| 23 |
+
router_z_loss_coef: 0.001
|
| 24 |
+
max_seq_len: 2048
|
| 25 |
+
dtype: "float16"
|
| 26 |
+
|
| 27 |
+
# Optimization
|
| 28 |
+
use_cpu_offload: false
|
| 29 |
+
gradient_checkpointing: true
|
| 30 |
+
checkpoint_ssm_layers: true
|
| 31 |
+
use_flash_attention: false
|
training_config.yaml
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
## Production Distillation Config for RunPod (RTX A6000 48GB)
|
| 2 |
+
##
|
| 3 |
+
## 3-stage MambaInLlama pipeline with research-validated hyperparameters:
|
| 4 |
+
## - SSM 10x LR boost (NB11)
|
| 5 |
+
## - T=2.0 for KL distillation (NB09)
|
| 6 |
+
## - alpha=0.7 for KL/CE balance (NB09)
|
| 7 |
+
## - SVD split for MoE diversity (NB03)
|
| 8 |
+
##
|
| 9 |
+
## Teacher: CohereLabs/tiny-aya-global (3.35B, validated in NB01-NB11)
|
| 10 |
+
## Student: Aetheris HybridMambaMoE (~800M params)
|
| 11 |
+
## Data: ClimbMix (Stage 1-2), multilingual chat (Stage 3)
|
| 12 |
+
##
|
| 13 |
+
## Wayy Research, 2024-2026
|
| 14 |
+
|
| 15 |
+
# Teacher model (tiny-aya-global: 3.35B, 70+ langs, no gated access required)
|
| 16 |
+
teacher:
|
| 17 |
+
name: "CohereLabs/tiny-aya-global"
|
| 18 |
+
dtype: "bfloat16"
|
| 19 |
+
device_map: "auto"
|
| 20 |
+
|
| 21 |
+
# Student model
|
| 22 |
+
student:
|
| 23 |
+
config_path: "configs/student.yaml"
|
| 24 |
+
dtype: "bfloat16"
|
| 25 |
+
checkpoint: null # Set to Stage 1 checkpoint for Stage 2, etc.
|
| 26 |
+
|
| 27 |
+
# Languages (10 core for multilingual equity tracking)
|
| 28 |
+
languages: [en, es, hi, zh, ar, sw, tr, ja, id, te]
|
| 29 |
+
|
| 30 |
+
# Seed
|
| 31 |
+
seed: 42
|
| 32 |
+
|
| 33 |
+
# --- Stage 0: Block Conversion ---
|
| 34 |
+
conversion:
|
| 35 |
+
strategy: "weight_map"
|
| 36 |
+
a_init: "exponential_decay"
|
| 37 |
+
delta_init: "uniform"
|
| 38 |
+
ffn_to_moe: "svd_split" # Best diversity (CKA=0.097 vs replicate=0.88)
|
| 39 |
+
|
| 40 |
+
# --- Stage 1: Layer Alignment ---
|
| 41 |
+
stage1:
|
| 42 |
+
enabled: true
|
| 43 |
+
total_steps: 10000
|
| 44 |
+
lr: 1.0e-4
|
| 45 |
+
warmup_steps: 500
|
| 46 |
+
batch_size: 4
|
| 47 |
+
gradient_accumulation: 8
|
| 48 |
+
gradient_checkpointing: true
|
| 49 |
+
max_seq_len: 512
|
| 50 |
+
loss_type: "mse+cosine"
|
| 51 |
+
cka_threshold: 0.75
|
| 52 |
+
cka_check_every: 500
|
| 53 |
+
save_every: 1000
|
| 54 |
+
log_every: 50
|
| 55 |
+
output_dir: "checkpoints/stage1_alignment"
|
| 56 |
+
|
| 57 |
+
# --- Stage 2: KL Distillation ---
|
| 58 |
+
stage2:
|
| 59 |
+
enabled: true
|
| 60 |
+
total_steps: 20000
|
| 61 |
+
lr: 5.0e-5 # Base LR
|
| 62 |
+
ssm_lr_multiplier: 10.0 # SSM blocks get 10x (NB11: KL -26%, agreement +12x)
|
| 63 |
+
warmup_steps: 500
|
| 64 |
+
batch_size: 4
|
| 65 |
+
gradient_accumulation: 8
|
| 66 |
+
gradient_checkpointing: true
|
| 67 |
+
max_seq_len: 512
|
| 68 |
+
temperature: 2.0 # NB09: T=2.0 good balance
|
| 69 |
+
alpha: 0.7 # NB09: alpha=0.7
|
| 70 |
+
save_every: 2000
|
| 71 |
+
log_every: 50
|
| 72 |
+
output_dir: "checkpoints/stage2_kl"
|
| 73 |
+
|
| 74 |
+
# --- Stage 3: SFT ---
|
| 75 |
+
stage3:
|
| 76 |
+
enabled: true
|
| 77 |
+
total_steps: 5000
|
| 78 |
+
lr: 2.0e-5
|
| 79 |
+
warmup_steps: 200
|
| 80 |
+
batch_size: 4
|
| 81 |
+
gradient_accumulation: 4
|
| 82 |
+
gradient_checkpointing: true
|
| 83 |
+
max_seq_len: 1024
|
| 84 |
+
save_every: 500
|
| 85 |
+
log_every: 25
|
| 86 |
+
output_dir: "checkpoints/stage3_sft"
|
| 87 |
+
|
| 88 |
+
# --- Data ---
|
| 89 |
+
data:
|
| 90 |
+
# Stage 1 & 2: ClimbMix (retokenized with Aya vocab)
|
| 91 |
+
climbmix:
|
| 92 |
+
dataset: "nvidia/ClimbMix"
|
| 93 |
+
mode: "retokenize"
|
| 94 |
+
streaming: true
|
| 95 |
+
buffer_size: 500
|
| 96 |
+
min_tokens: 32
|
| 97 |
+
|
| 98 |
+
# Stage 3: Multilingual chat data (aya_collection is non-gated)
|
| 99 |
+
sft:
|
| 100 |
+
dataset_name: "CohereForAI/aya_collection"
|
| 101 |
+
streaming: true
|
| 102 |
+
|
| 103 |
+
# --- Evaluation ---
|
| 104 |
+
eval:
|
| 105 |
+
max_new_tokens: 128
|
| 106 |
+
temperature: 0.7
|
| 107 |
+
top_p: 0.9
|
| 108 |
+
output_dir: "results/runpod"
|