Restore full README with training history, swarm table, and specialist status
Browse files
README.md
CHANGED
|
@@ -1,54 +1,174 @@
|
|
| 1 |
---
|
| 2 |
language:
|
| 3 |
- en
|
| 4 |
-
license:
|
| 5 |
tags:
|
| 6 |
-
-
|
|
|
|
|
|
|
| 7 |
- moe
|
|
|
|
|
|
|
| 8 |
- instruction-tuning
|
| 9 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
base_model: anthonym21/Eve-2-MoE-272M
|
| 11 |
datasets:
|
|
|
|
|
|
|
| 12 |
- yahma/alpaca-cleaned
|
|
|
|
| 13 |
---
|
| 14 |
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
-
|
| 18 |
|
| 19 |
-
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
-
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
- **Batch size**: 128
|
| 26 |
-
- **
|
| 27 |
-
- **
|
| 28 |
-
|
| 29 |
-
-
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
## Usage
|
| 33 |
|
| 34 |
```python
|
| 35 |
-
from transformers import AutoModelForCausalLM
|
| 36 |
-
import
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
-
|
| 39 |
-
|
| 40 |
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
print(
|
| 45 |
```
|
| 46 |
|
| 47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
|
| 49 |
-
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
language:
|
| 3 |
- en
|
| 4 |
+
license: mit
|
| 5 |
tags:
|
| 6 |
+
- pytorch
|
| 7 |
+
- safetensors
|
| 8 |
+
- eve-moe
|
| 9 |
- moe
|
| 10 |
+
- deepseek
|
| 11 |
+
- nvidia-h200
|
| 12 |
- instruction-tuning
|
| 13 |
+
- text-generation
|
| 14 |
+
- nano-lm
|
| 15 |
+
- edge-ai
|
| 16 |
+
- rope
|
| 17 |
+
- custom_code
|
| 18 |
base_model: anthonym21/Eve-2-MoE-272M
|
| 19 |
datasets:
|
| 20 |
+
- HuggingFaceFW/fineweb-edu
|
| 21 |
+
- HuggingFaceFW/finepdfs
|
| 22 |
- yahma/alpaca-cleaned
|
| 23 |
+
doi: 10.57967/hf/7731
|
| 24 |
---
|
| 25 |
|
| 26 |
+
<div align="center">
|
| 27 |
+
<img src="eve-2-swarm.jpg" alt="Eve-2 Swarm" width="600">
|
| 28 |
+
<h1>Eve-2-MoE-IT-272M</h1>
|
| 29 |
+
<h3>The Foundation for Nano-Scale Swarm Intelligence</h3>
|
| 30 |
+
</div>
|
| 31 |
|
| 32 |
+
**Eve-2-MoE-IT-272M** is a 272M parameter instruction-tuned model designed as the foundational base for the **Eve Swarm**βa collection of hyper-specialized, CPU-deployable adapters.
|
| 33 |
|
| 34 |
+
Unlike massive generalist LLMs, Eve is built for **deterministic-ish transformations**. She is designed to be "overfitted" into specialists that perform one job perfectly (e.g., SQL generation, Git commits, JSON extraction) with negligible latency and cost.
|
| 35 |
|
| 36 |
+
**Author:** [Anthony Maio](mailto:anthony@making-minds.ai) / [Public Outputs](https://making-minds.ai)
|
| 37 |
+
|
| 38 |
+
---
|
| 39 |
+
|
| 40 |
+
## The Eve Swarm (Specialist Ecosystem)
|
| 41 |
+
|
| 42 |
+
This model serves as the parent for the following **Full Fine-Tuned (FFT)** specialists. All members were trained on an **NVIDIA H200 SXM** to ensure optimal embedding alignment.
|
| 43 |
+
|
| 44 |
+
> **Note (Feb 2026):** The base model was updated with 10B tokens of continued pretraining (see Training History below). All specialists below were trained on the **v1 base weights** and need to be **retrained** on the updated base to benefit from the improved foundation. The GGUF quantizations also need to be regenerated from the new IT weights.
|
| 45 |
+
|
| 46 |
+
| Specialist Model | Task | Dataset Source | Size | Loss | Status |
|
| 47 |
+
| ---------------- | --------------------------------------------------------------------------------- | -------------------------------- | ---- | -------------------- | ------ |
|
| 48 |
+
| Eve-NanoFunction | Strict JSON Function Calling β produces valid JSON outputs from natural language. | glaive-function-calling-v2 | 272M | <0.4 (35k samples) | Needs retrain |
|
| 49 |
+
| Eve-NanoSummary | Conversation Summarization β condenses dialogues into concise summaries. | knkarthick/dialogsum | 272M | <1.0 (12.5k samples) | Needs retrain |
|
| 50 |
+
| Eve-NanoCommit | Git Diff β Commit Message β writes conventional commits from raw code diffs. | bigcode/commitpackft | 272M | <1.0 (20k samples) | Needs retrain |
|
| 51 |
+
| Eve-NanoExtract | Text β Structured Data β extracts parameters/entities into strict JSON schemas. | Salesforce/xlam-function-calling | 272M | <0.4 (20k samples) | Needs retrain |
|
| 52 |
+
| Eve-NanoSQL | Natural Language β SQL β converts questions to SQL using table context. | b-mc2/sql-create-context | 272M | <0.2 (25k samples) | Needs retrain |
|
| 53 |
+
| Eve-NanoPrompt | Prompt Expansion β expands simple ideas into rich image gen prompts. | Stable-Diffusion-Prompts | 272M | <1.0 (15k samples) | Needs retrain |
|
| 54 |
+
| Eve-NanoRouter | Intent Classification β routes user queries to the correct swarm member. | bitext/customer-support | 272M | <0.3 (25k samples) | Needs retrain |
|
| 55 |
+
| Eve-NanoPII | PII Redaction β identifies and masks sensitive entities. | ai4privacy/pii-masking-200k | 272M | <0.1 (35k samples) | Needs retrain |
|
| 56 |
+
|
| 57 |
+
---
|
| 58 |
+
|
| 59 |
+
## Training History
|
| 60 |
+
|
| 61 |
+
### Run 1: Initial Pretraining (v1)
|
| 62 |
+
- **Dataset**: [HuggingFaceFW/fineweb-edu](https://huggingface.co/datasets/HuggingFaceFW/fineweb-edu) β 10B tokens
|
| 63 |
+
- **Hardware**: NVIDIA H200 SXM (141GB VRAM)
|
| 64 |
+
- **Result**: Trained from scratch to a functional base model
|
| 65 |
+
|
| 66 |
+
### Run 2: Continued Pretraining (v2 β current base)
|
| 67 |
+
- **Dataset**: [HuggingFaceFW/finepdfs](https://huggingface.co/datasets/HuggingFaceFW/finepdfs) (eng_Latn subset) β 10B tokens
|
| 68 |
+
- **Hardware**: NVIDIA A100 80GB (Google Colab)
|
| 69 |
+
- **Duration**: 14.7 hours
|
| 70 |
+
- **Throughput**: 189,295 tok/s
|
| 71 |
+
- **Val perplexity**: 36.8 β **32.3** (12.2% improvement)
|
| 72 |
+
- **Result**: Stronger base with improved document understanding from academic/scientific PDFs
|
| 73 |
+
|
| 74 |
+
### Run 3: Instruction Tuning (IT β this model)
|
| 75 |
+
- **Dataset**: [yahma/alpaca-cleaned](https://huggingface.co/datasets/yahma/alpaca-cleaned) β ~52K instruction-response pairs, 3 epochs
|
| 76 |
+
- **Hardware**: NVIDIA H200 SXM (141GB VRAM)
|
| 77 |
+
- **Method**: Full Fine-Tuning with **response-only loss masking** (prompt tokens excluded from loss)
|
| 78 |
+
- **Duration**: ~1 hour
|
| 79 |
- **Batch size**: 128
|
| 80 |
+
- **Peak LR**: 2e-5 (cosine decay)
|
| 81 |
+
- **WikiText-2 val ppl**: 32.6 β 36.2 (slight increase expected β model shifted toward instruction-following distribution)
|
| 82 |
+
|
| 83 |
+
---
|
| 84 |
+
|
| 85 |
+
## Technical Specifications
|
| 86 |
+
|
| 87 |
+
### Architecture: Nano-MoE
|
| 88 |
+
|
| 89 |
+
Eve uses a DeepSeek-style Mixture-of-Experts architecture scaled down to the "Nano" range.
|
| 90 |
+
|
| 91 |
+
* **Total Parameters:** 272M
|
| 92 |
+
* **Active Parameters:** ~80M (per token)
|
| 93 |
+
* **Experts:** 8 routed + 1 shared
|
| 94 |
+
* **Top-K:** 2
|
| 95 |
+
* **Context Window:** 2048 tokens
|
| 96 |
+
* **Vocab:** 50,304 (GPT-2 compatible)
|
| 97 |
+
|
| 98 |
+
### Training Config (H200 SXM)
|
| 99 |
+
|
| 100 |
+
This model was trained using **Full Fine-Tuning (FFT)**. We found that LoRA was insufficient for aligning the embeddings of such a small model; unfreezing all weights yielded significant performance gains. You don't need to use a H200, it's absurdly overkill. I love it.
|
| 101 |
+
|
| 102 |
+
* **Hardware:** NVIDIA H200 SXM (141GB VRAM)
|
| 103 |
+
* **Method:** Full Fine-Tuning (No PEFT/LoRA)
|
| 104 |
+
* **Precision:** `bfloat16`
|
| 105 |
+
* **Batch Size:** 128 (Global)
|
| 106 |
+
* **Learning Rate:** 2e-5 (Cosine Schedule) β IT run; 5e-5 for specialist FFT
|
| 107 |
+
* **Loss Masking:** Response-only (masked user prompts via loss_mask tensor)
|
| 108 |
+
|
| 109 |
+
---
|
| 110 |
+
|
| 111 |
+
## How to Tune Eve 2
|
| 112 |
+
|
| 113 |
+
If you want to train your own Eve specialist, follow these rules derived from our H200 experiments:
|
| 114 |
+
|
| 115 |
+
1. **Abandon LoRA:** For a 272M model, LoRA restricts the embedding space too much. You have the VRAM; use **Full Fine-Tuning**.
|
| 116 |
+
2. **Mask User Prompts:** You *must* use a collator that masks the prompt (loss only on response tokens). If the model calculates loss on the instruction, it wastes capacity learning English grammar instead of the task.
|
| 117 |
+
3. **Batch Size Matters:** We saturated the H200 with `batch_size=128`. High batch sizes stabilize the gradients for these volatile small architectures.
|
| 118 |
+
4. **Dataset Quality > Quantity:**
|
| 119 |
+
* *Bad:* 100k rows of scraped web text.
|
| 120 |
+
* *Good:* 10k rows of "Input β Ideal Output" pairs.
|
| 121 |
+
* *Sweet Spot:* 2 Epochs. Do not over-train; these models memorize quickly.
|
| 122 |
+
|
| 123 |
+
---
|
| 124 |
|
| 125 |
## Usage
|
| 126 |
|
| 127 |
```python
|
| 128 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 129 |
+
import torch
|
| 130 |
+
|
| 131 |
+
model_id = "anthonym21/Eve-2-MoE-IT-272M"
|
| 132 |
+
|
| 133 |
+
# Load with trust_remote_code=True for custom MoE architecture
|
| 134 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
|
| 135 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 136 |
+
model_id,
|
| 137 |
+
trust_remote_code=True,
|
| 138 |
+
torch_dtype=torch.bfloat16,
|
| 139 |
+
device_map="auto"
|
| 140 |
+
)
|
| 141 |
|
| 142 |
+
# Standard formatting
|
| 143 |
+
prompt = "User: Explain the concept of Semantic Quantization.\nAssistant:"
|
| 144 |
|
| 145 |
+
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
| 146 |
+
out = model.generate(**inputs, max_new_tokens=150, do_sample=True, temperature=0.6)
|
| 147 |
+
|
| 148 |
+
print(tokenizer.decode(out[0], skip_special_tokens=True))
|
| 149 |
```
|
| 150 |
|
| 151 |
+
---
|
| 152 |
+
|
| 153 |
+
## GGUF Quantizations
|
| 154 |
+
|
| 155 |
+
Quantized versions are available at [anthonym21/Eve-2-MoE-IT-272M-GGUF](https://huggingface.co/anthonym21/Eve-2-MoE-IT-272M-GGUF):
|
| 156 |
+
|
| 157 |
+
| Quantization | Filename | Size |
|
| 158 |
+
|-------------|----------|------|
|
| 159 |
+
| Q8_0 | Eve-2-MoE-IT-272M-Q8_0.gguf | ~318 MB |
|
| 160 |
+
| Q4_K_M | Eve-2-MoE-IT-272M-Q4_K_M.gguf | ~204 MB |
|
| 161 |
|
| 162 |
+
---
|
| 163 |
+
|
| 164 |
+
## Citation
|
| 165 |
+
|
| 166 |
+
```bibtex
|
| 167 |
+
@misc{maio2026eve2moeit,
|
| 168 |
+
author = {Maio, Anthony D.},
|
| 169 |
+
title = {Eve-2-MoE-IT-272M: A Nano-MoE Foundation for Swarm Intelligence},
|
| 170 |
+
year = {2026},
|
| 171 |
+
publisher = {Maio, Anthony D.},
|
| 172 |
+
url = {https://huggingface.co/anthonym21/Eve-2-MoE-IT-272M}
|
| 173 |
+
}
|
| 174 |
+
```
|