Text Generation
GGUF
English
olmoe
Mixture of Experts
expert-pruning
model-compression
research
conversational
Instructions to use Local-Axiom-AI/llama-1B-5B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Local-Axiom-AI/llama-1B-5B with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Local-Axiom-AI/llama-1B-5B:Q4_K_M # Run inference directly in the terminal: llama cli -hf Local-Axiom-AI/llama-1B-5B:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Local-Axiom-AI/llama-1B-5B:Q4_K_M # Run inference directly in the terminal: llama cli -hf Local-Axiom-AI/llama-1B-5B:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf Local-Axiom-AI/llama-1B-5B:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf Local-Axiom-AI/llama-1B-5B:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf Local-Axiom-AI/llama-1B-5B:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Local-Axiom-AI/llama-1B-5B:Q4_K_M
Use Docker
docker model run hf.co/Local-Axiom-AI/llama-1B-5B:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use Local-Axiom-AI/llama-1B-5B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Local-Axiom-AI/llama-1B-5B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Local-Axiom-AI/llama-1B-5B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Local-Axiom-AI/llama-1B-5B:Q4_K_M
- Ollama
How to use Local-Axiom-AI/llama-1B-5B with Ollama:
ollama run hf.co/Local-Axiom-AI/llama-1B-5B:Q4_K_M
- Unsloth Studio
How to use Local-Axiom-AI/llama-1B-5B with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Local-Axiom-AI/llama-1B-5B to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Local-Axiom-AI/llama-1B-5B to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Local-Axiom-AI/llama-1B-5B to start chatting
- Docker Model Runner
How to use Local-Axiom-AI/llama-1B-5B with Docker Model Runner:
docker model run hf.co/Local-Axiom-AI/llama-1B-5B:Q4_K_M
- Lemonade
How to use Local-Axiom-AI/llama-1B-5B with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Local-Axiom-AI/llama-1B-5B:Q4_K_M
Run and chat with the model
lemonade run user.llama-1B-5B-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,241 @@
|
|
| 1 |
---
|
| 2 |
-
license:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
pipeline_tag: text-generation
|
| 6 |
+
base_model: allenai/OLMoE-1B-7B-0125-Instruct
|
| 7 |
+
tags:
|
| 8 |
+
- gguf
|
| 9 |
+
- olmoe
|
| 10 |
+
- moe
|
| 11 |
+
- expert-pruning
|
| 12 |
+
- model-compression
|
| 13 |
+
- research
|
| 14 |
---
|
| 15 |
+
|
| 16 |
+
# OLMoE-1B-7B-0125-Instruct — 30% Expert Pruned
|
| 17 |
+
|
| 18 |
+
This is an experimental version of
|
| 19 |
+
[`allenai/OLMoE-1B-7B-0125-Instruct`](https://huggingface.co/allenai/OLMoE-1B-7B-0125-Instruct)
|
| 20 |
+
with approximately **30% of its routed experts physically removed**.
|
| 21 |
+
|
| 22 |
+
The original model has 64 experts in each of its 16 mixture-of-experts layers.
|
| 23 |
+
This version removes 19 experts independently from every layer, leaving 45
|
| 24 |
+
experts per layer. The original top-8 routing is preserved.
|
| 25 |
+
|
| 26 |
+
The purpose of this release is to explore a simple question:
|
| 27 |
+
|
| 28 |
+
> How much of a mixture-of-experts model can be removed when experts are ranked
|
| 29 |
+
> by usage, contribution, and functional redundancy rather than parameter
|
| 30 |
+
> magnitude alone?
|
| 31 |
+
|
| 32 |
+
This is a research artifact. Removing nearly one-third of the expert pool is
|
| 33 |
+
an aggressive intervention and may remove capabilities that appear only in
|
| 34 |
+
particular domains or prompt distributions.
|
| 35 |
+
|
| 36 |
+
In testing against the unpruned base model, this 30%-cut version showed an
|
| 37 |
+
approximately **6% average performance decrease** across the same MMLU,
|
| 38 |
+
ARC-Challenge, HellaSwag, and GSM8K benchmark screen used during the pruning
|
| 39 |
+
experiments. This provides an initial measure of the quality tradeoff: about
|
| 40 |
+
30% of the expert pool was removed for an observed average benchmark loss of
|
| 41 |
+
about 6%.
|
| 42 |
+
|
| 43 |
+
## What was removed
|
| 44 |
+
|
| 45 |
+
| Property | Original OLMoE | 30% expert-pruned model |
|
| 46 |
+
|---|---:|---:|
|
| 47 |
+
| MoE layers | 16 | 16 |
|
| 48 |
+
| Experts per layer | 64 | 45 |
|
| 49 |
+
| Total expert modules | 1,024 | 720 |
|
| 50 |
+
| Expert modules removed | — | 304 |
|
| 51 |
+
| Expert pool removed | — | 29.69% |
|
| 52 |
+
| Experts active per token | 8 | 8 |
|
| 53 |
+
| Context length | 4,096 | 4,096 |
|
| 54 |
+
|
| 55 |
+
Nineteen experts were removed from each layer. Expert roles are layer-specific,
|
| 56 |
+
so candidates were selected independently in every layer rather than removing
|
| 57 |
+
the same expert indices throughout the network.
|
| 58 |
+
|
| 59 |
+
For each removed expert, both the expert MLP and its corresponding router row
|
| 60 |
+
were deleted. The router therefore produces 45 logits instead of 64, and its
|
| 61 |
+
softmax renormalizes probability over the experts that remain.
|
| 62 |
+
|
| 63 |
+
Attention layers, embeddings, normalization layers, and retained expert
|
| 64 |
+
tensors are not reduced by the 30% expert cut. This is why the final file is
|
| 65 |
+
smaller by slightly less than 30%.
|
| 66 |
+
|
| 67 |
+
## The pruning idea
|
| 68 |
+
|
| 69 |
+
Mixture-of-experts models contain a large pool of expert MLPs, but only a small
|
| 70 |
+
subset is selected for each token. Some experts are used frequently across
|
| 71 |
+
many prompts, while others are activated rarely or behave similarly to other
|
| 72 |
+
experts in the same layer.
|
| 73 |
+
|
| 74 |
+
The pruning hypothesis is that part of this expert pool is redundant. If the
|
| 75 |
+
least important experts can be identified, their parameters and router entries
|
| 76 |
+
can be removed without changing the rest of the network.
|
| 77 |
+
|
| 78 |
+
The difficult part is deciding what "least important" means. Routing frequency
|
| 79 |
+
alone is not sufficient: an expert may be rarely used globally while remaining
|
| 80 |
+
important for code, mathematics, multilingual text, or structured output.
|
| 81 |
+
|
| 82 |
+
## How experts were ranked
|
| 83 |
+
|
| 84 |
+
The pruning process used multiple signals for every expert in every layer:
|
| 85 |
+
|
| 86 |
+
| Signal | Purpose |
|
| 87 |
+
|---|---|
|
| 88 |
+
| Routed-token frequency | Measures how often an expert is selected |
|
| 89 |
+
| Selected router probability | Measures how strongly the router prefers it |
|
| 90 |
+
| Gate-weighted output magnitude | Estimates the expert's contribution after routing |
|
| 91 |
+
| Raw output magnitude | Measures the scale of the expert's response |
|
| 92 |
+
| Functional similarity | Identifies experts with behavior already represented by others |
|
| 93 |
+
|
| 94 |
+
The signals were combined into a layer-local importance score. Low usage was
|
| 95 |
+
therefore not enough by itself to make an expert a removal candidate. An expert
|
| 96 |
+
also needed to have low measured contribution or substantial functional
|
| 97 |
+
overlap with experts that would remain.
|
| 98 |
+
|
| 99 |
+
Calibration examples covered general knowledge, science, commonsense,
|
| 100 |
+
mathematics, code, multilingual text, and structured formats. Including
|
| 101 |
+
several domains reduces the risk of classifying a narrow specialist as unused
|
| 102 |
+
only because it is quiet on ordinary English prompts.
|
| 103 |
+
|
| 104 |
+
The process for each MoE layer was:
|
| 105 |
+
|
| 106 |
+
1. Collect routing and expert-output statistics on the calibration mix.
|
| 107 |
+
2. Compare expert behavior on shared hidden states.
|
| 108 |
+
3. Protect strong contributors observed in each calibration domain.
|
| 109 |
+
4. Rank the remaining candidates by multi-signal importance.
|
| 110 |
+
5. Remove the lowest-ranked 19 experts and their router rows.
|
| 111 |
+
6. Preserve the original top-8 routing over the 45 retained experts.
|
| 112 |
+
|
| 113 |
+
## Deletion rather than weight averaging
|
| 114 |
+
|
| 115 |
+
This model uses structural expert deletion. Removed experts are not replaced
|
| 116 |
+
with averaged MLP weights.
|
| 117 |
+
|
| 118 |
+
Two expert MLPs may produce similar outputs while using different internal
|
| 119 |
+
hidden-unit permutations. Directly averaging their parameters can therefore
|
| 120 |
+
damage both functions. Functional similarity is used as evidence of
|
| 121 |
+
redundancy, not as justification for naive parameter averaging.
|
| 122 |
+
|
| 123 |
+
Because the model is physically compacted, the removed expert tensors no
|
| 124 |
+
longer occupy storage or resident memory. This differs from router masking,
|
| 125 |
+
where all expert parameters remain in the checkpoint even if some experts can
|
| 126 |
+
never be selected.
|
| 127 |
+
|
| 128 |
+
## What the 30% cut changes
|
| 129 |
+
|
| 130 |
+
The expert pool is reduced from 64 to 45 choices in every layer. Each token is
|
| 131 |
+
still routed to 8 experts, so a larger fraction of the remaining pool is active
|
| 132 |
+
for each token:
|
| 133 |
+
|
| 134 |
+
- Original: 8 of 64 experts, or 12.5% of the layer's expert pool.
|
| 135 |
+
- Pruned: 8 of 45 experts, or 17.8% of the layer's expert pool.
|
| 136 |
+
|
| 137 |
+
This release primarily targets model size and resident memory. It does not
|
| 138 |
+
promise a proportional reduction in inference FLOPs because the number of
|
| 139 |
+
active experts per token remains unchanged.
|
| 140 |
+
|
| 141 |
+
Pruning can also change routing decisions even when every retained tensor is
|
| 142 |
+
copied exactly. Removing router outputs changes the softmax distribution and
|
| 143 |
+
may change which experts enter the top-8 selection, particularly when router
|
| 144 |
+
scores are close.
|
| 145 |
+
|
| 146 |
+
## Released artifact
|
| 147 |
+
|
| 148 |
+
| File | Experts/layer | Quantization | Size |
|
| 149 |
+
|---|---:|---:|---:|
|
| 150 |
+
| `OLMoE-1B-7B-0125-Instruct-30pct-Q4_K_M.gguf` | 45 | Q4_K_M | 2.84 GiB |
|
| 151 |
+
|
| 152 |
+
The local upstream Q4_K_M conversion is 3.92 GiB. The 30%-pruned Q4_K_M file is
|
| 153 |
+
approximately **27.54% smaller**. The remaining difference from 30% comes from
|
| 154 |
+
the model parameters that are not part of the expert MLP pool.
|
| 155 |
+
|
| 156 |
+
The GGUF metadata reports 16 OLMoE blocks, 45 experts per block, 8 active
|
| 157 |
+
experts per token, and a 4,096-token context length.
|
| 158 |
+
|
| 159 |
+
## Running with llama.cpp
|
| 160 |
+
|
| 161 |
+
```bash
|
| 162 |
+
llama-cli \
|
| 163 |
+
-m OLMoE-1B-7B-0125-Instruct-30pct-Q4_K_M.gguf \
|
| 164 |
+
-cnv -ngl 99 -c 4096
|
| 165 |
+
```
|
| 166 |
+
|
| 167 |
+
To run an OpenAI-compatible local server:
|
| 168 |
+
|
| 169 |
+
```bash
|
| 170 |
+
llama-server \
|
| 171 |
+
-m OLMoE-1B-7B-0125-Instruct-30pct-Q4_K_M.gguf \
|
| 172 |
+
-ngl 99 -c 4096 --port 8080
|
| 173 |
+
```
|
| 174 |
+
|
| 175 |
+
Reduce `-ngl` if the model does not fit in available GPU memory. The artifact
|
| 176 |
+
contains the upstream chat template in its GGUF tokenizer metadata.
|
| 177 |
+
|
| 178 |
+
## Testing status
|
| 179 |
+
|
| 180 |
+
This exact 30%-pruned Q4_K_M artifact was successfully loaded and used for
|
| 181 |
+
generation with `llama.cpp` on an NVIDIA RTX 3090.
|
| 182 |
+
|
| 183 |
+
The pruned model was also compared with the unpruned base model using the same
|
| 184 |
+
task benchmark suite used elsewhere in the pruning experiment:
|
| 185 |
+
|
| 186 |
+
- MMLU;
|
| 187 |
+
- ARC-Challenge;
|
| 188 |
+
- HellaSwag; and
|
| 189 |
+
- GSM8K.
|
| 190 |
+
|
| 191 |
+
Across that suite, the 30%-cut model had an approximately **6% average drop**
|
| 192 |
+
relative to the base model. This is an aggregate summary, not a claim that
|
| 193 |
+
every individual task decreased by exactly 6%.
|
| 194 |
+
|
| 195 |
+
The detailed result file is no longer available, so per-task scores, sample
|
| 196 |
+
counts, and statistical uncertainty cannot be reproduced from this release.
|
| 197 |
+
The aggregate result is included for transparency but should be treated as a
|
| 198 |
+
small benchmark screen rather than a publication-grade evaluation.
|
| 199 |
+
|
| 200 |
+
## Limitations
|
| 201 |
+
|
| 202 |
+
- Removing 19 of 64 experts per layer is aggressive and may reduce quality.
|
| 203 |
+
- Calibration can miss specialists outside its sampled domains.
|
| 204 |
+
- Rare-language, code, structured-output, or other narrow capabilities may be
|
| 205 |
+
affected even when general chat behavior appears reasonable.
|
| 206 |
+
- Top-8 routing remains unchanged, so active-compute savings are modest.
|
| 207 |
+
- Q4_K_M quantization introduces an additional source of quality loss beyond
|
| 208 |
+
expert pruning.
|
| 209 |
+
- The retained aggregate benchmark result shows an approximately 6% average
|
| 210 |
+
decrease, but the deleted detailed results prevent per-task analysis or
|
| 211 |
+
independent reproduction of that figure from this repository.
|
| 212 |
+
- The model inherits the upstream model's biases and safety limitations.
|
| 213 |
+
|
| 214 |
+
This model should be evaluated on representative data before practical use. It
|
| 215 |
+
is best treated as an experiment in structural MoE compression rather than a
|
| 216 |
+
drop-in replacement for the upstream checkpoint.
|
| 217 |
+
|
| 218 |
+
## Upstream model and license
|
| 219 |
+
|
| 220 |
+
This work is derived from
|
| 221 |
+
[`allenai/OLMoE-1B-7B-0125-Instruct`](https://huggingface.co/allenai/OLMoE-1B-7B-0125-Instruct)
|
| 222 |
+
and retains its Apache 2.0 license. See the upstream model card for training
|
| 223 |
+
data, post-training, safety information, and citations. Architecture details
|
| 224 |
+
are available in the [OLMoE paper](https://arxiv.org/abs/2409.02060).
|
| 225 |
+
|
| 226 |
+
## Conclusion
|
| 227 |
+
|
| 228 |
+
Removing approximately 30% of the model's expert pool while observing only an
|
| 229 |
+
approximately 6% average drop across the tested benchmarks suggests that a
|
| 230 |
+
meaningful amount of expert capacity may be redundant for the evaluated task
|
| 231 |
+
distribution. Although the benchmark screen is too limited to establish broad
|
| 232 |
+
quality parity, the difference between the scale of the structural reduction
|
| 233 |
+
and the measured performance loss warrants further research into MoE pruning.
|
| 234 |
+
|
| 235 |
+
More broadly, these results support research into less wasteful MoE designs:
|
| 236 |
+
models that preserve useful specialization while requiring fewer stored
|
| 237 |
+
parameters, less resident memory, and less underused expert capacity. Larger
|
| 238 |
+
and more diverse evaluations, improved specialist detection, iterative
|
| 239 |
+
pruning, and post-pruning recovery or distillation could help determine how
|
| 240 |
+
much redundancy can be removed without disproportionately harming rare-domain
|
| 241 |
+
capabilities.
|