The dataset viewer is not available for this dataset.
Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
- How it was built
- Configs / files
routing_traces—routing_traces/routing_v1.parquet(~2.14M rows)slot_analysis—routing_traces/slot_analysis_v1.parquet(1,024 rows)ablation—routing_traces/ablation_v1.parquet(25 rows)pruning—routing_traces/pruning_v1.parquet(6 rows)coactivation—routing_traces/coactivation_v1.parquet(~28k rows)corpus_finance—corpus/finance_matched_v1.parquet(652 rows)corpus_contrast—corpus/contrast_matched_v1.parquet(652 rows)
- Limitations
- Licensing
- Citation
OLMoE Finance vs. General — Expert Routing & Specialization
Every routing decision made by OLMoE-1B-7B (AI2's open-weights mixture-of-experts model) across ~2.1 million token×layer events of contrasting text — public-domain SEC filings (finance) vs. Wikipedia (general) — plus the per-slot specialization analysis, ablation results, and pruning sweep derived from it.
This dataset accompanies a write-up on identifying and pruning domain-specialized experts in MoE models. Headline finding: ~16% of OLMoE's expert slots show strong, statistically robust finance-vs-general specialization, and masking the experts the model doesn't use for finance preserves finance-domain quality while degrading general-text quality — a clean, monotonic separation.
- 📝 Write-up: see the project repo (
BLOG.md) - 💻 Code: https://github.com/miguelbetances/Mixture-of-Experts-Profiling
How it was built
Two corpora were length-matched (50-token buckets) so they differ only in domain, not length or register-of-origin: 652 finance paragraphs (PleIAs/SEC, public-domain SEC filings) and 652 general paragraphs (Wikipedia 20231101.en). Each paragraph (~100 tokens) was run through OLMoE-1B-7B in inference mode with forward hooks on each of the 16 layers' routers. At every token the hook recorded the top-8 selected experts and their gate weights, yielding one record per (token, layer). Routing was not captured on prompts/questions, LLM-generated text, or copyrighted material — only declarative, openly-licensed human-written text, to isolate domain routing rather than instruction routing.
Configs / files
Load any config by name:
from datasets import load_dataset
ds = load_dataset("miguelbetances/moe-finance-specialization", "routing_traces")
routing_traces — routing_traces/routing_v1.parquet (~2.14M rows)
The raw routing records — one per (token, layer).
| column | type | description |
|---|---|---|
token_position |
int | position of the token within its paragraph |
token_id |
int | OLMoE tokenizer id |
token_str |
str | decoded token string |
layer |
int | layer index, 0–15 |
expert_indices |
list[int] | the top-8 expert ids selected at this (token, layer) |
expert_weights |
list[float] | gate weights for the selected experts (same order) |
corpus |
str | finance or contrast (= Wikipedia/general) |
paragraph_idx |
int | index of the source paragraph within its corpus |
slot_analysis — routing_traces/slot_analysis_v1.parquet (1,024 rows)
Per expert-slot (16 layers × 64 experts) specialization statistics.
| column | type | description |
|---|---|---|
layer, expert |
int | slot identity |
contrast, finance |
float | firing counts in each corpus |
contrast_rate, finance_rate |
float | firing rate per token |
log_odds |
float | smoothed log-odds (finance / contrast); + = finance-leaning |
total |
float | total firings |
z, p_raw, p_adj |
float | z-test statistic, raw and Benjamini-Hochberg-adjusted p |
significant |
bool | passes FDR correction |
ablation — routing_traces/ablation_v1.parquet (25 rows)
Single-expert ablation sweep: zero out one expert's gate weight and measure the change in finance log-likelihood on a held-out probe set.
| column | type | description |
|---|---|---|
layer, expert |
int | ablated slot |
group |
str | finance_specialist / contrast_specialist / mid_finance |
log_odds |
float | the slot's specialization score |
baseline_ll, ablated_ll |
float | mean per-token LL before/after ablation |
delta_ll |
float | ablated_ll − baseline_ll (positive = removal helped) |
pruning — routing_traces/pruning_v1.parquet (6 rows)
Multi-expert pruning sweep: mask the top-N most contrast-leaning slots and evaluate both domains.
| column | type | description |
|---|---|---|
n_pruned |
int | number of expert slots masked (0, 25, 50, 100, 150, 200) |
finance_ll, general_ll |
float | mean per-token LL on each held-out probe set |
delta_finance, delta_general |
float | change from baseline |
gap |
float | general_ll − finance_ll margin |
coactivation — routing_traces/coactivation_v1.parquet (~28k rows)
Expert co-activation (PMI) per layer: how often expert pairs fire together within a token.
| column | type | description |
|---|---|---|
layer |
int | layer index |
e1, e2 |
int | the expert pair |
fin_count, con_count |
int | co-firing counts per corpus |
pmi_fin, pmi_con |
float | pointwise mutual information per corpus |
pmi_diff |
float | pmi_fin − pmi_con |
corpus_finance — corpus/finance_matched_v1.parquet (652 rows)
Length-matched finance paragraphs.
| column | type | description |
|---|---|---|
text |
str | the paragraph |
source |
str | sec |
filing_id |
str | SEC filing identifier |
company_cik |
str | SEC company CIK |
year |
int | filing year (skews toward 2012 — see limitations) |
corpus_contrast — corpus/contrast_matched_v1.parquet (652 rows)
Length-matched general (Wikipedia) paragraphs.
| column | type | description |
|---|---|---|
text |
str | the paragraph |
source |
str | wikipedia |
article_title |
str | source article title |
article_id |
str | Wikipedia article id |
Limitations
- One model, one domain pair. OLMoE-1B-7B on SEC vs. Wikipedia. The methodology generalizes; whether the quantitative results do is an open question.
- Corpus skew. The finance corpus skews toward 2012 SEC filings (a sampling artifact); the contrast corpus draws from newer, lower-traffic Wikipedia articles. Each reflects one register within its domain.
- Probes held out from analysis, not pretraining. OLMoE saw similar text during pretraining, so the probe evaluation is a routing-stability test, not a generalization test.
- "Pruning" = masking. Ablation/pruning zero out gate weights; weights still reside in memory. This demonstrates the principle, not real compression.
Licensing
This dataset bundles material under different terms; the repo is released under CC BY-SA 4.0 to satisfy the most restrictive component (Wikipedia).
- Finance corpus — derived from public-domain U.S. SEC filings (via PleIAs/SEC). Public domain.
- Contrast corpus — derived from Wikipedia (20231101.en). CC BY-SA 4.0; attribution to Wikipedia contributors.
- Routing traces & analysis — produced by running OLMoE-1B-7B (Apache-2.0) over the above corpora.
Citation
@misc{betances2026moefinance,
author = {Miguel Betances},
title = {OLMoE Finance vs. General: Expert Routing \& Specialization},
year = {2026},
publisher = {HuggingFace},
howpublished = {\url{https://huggingface.co/datasets/miguelbetances/moe-finance-specialization}}
}
- Downloads last month
- 20