Multilingual Educational-Quality Classifier (base, 308M)

Scores how educational a web page is, from 0 (none) to 5 (excellent, textbook-like), in English and 65 other languages, on the same scale as FineWeb-Edu. Use it to filter or weight pretraining data, for example FineWeb-2, the way FineWeb-Edu filtered English (int_score >= 3). Built on mmBERT-base, Apache-2.0, with ONNX files included. A smaller, faster version is available as Horizon-Labs/multilingual-edu-classifier-small.

  • Drop-in for code written for HuggingFaceFW/fineweb-edu-classifier: one regression output; int_score = round(clamp(score, 0, 5)).
  • It reads the first 512 tokens of a document. onnx/model_quantized.onnx (int8 embeddings, 641 MB): scores differ from fp32 by 0.003 on average; the educational / not decision (2.5) agrees for 100.0% of 400 test documents.

Usage

import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification

tok = AutoTokenizer.from_pretrained("Horizon-Labs/multilingual-edu-classifier-base")
model = AutoModelForSequenceClassification.from_pretrained("Horizon-Labs/multilingual-edu-classifier-base")
texts = ["La photosynthèse est le processus par lequel les plantes ...", "Buy cheap shoes now! Free shipping ..."]
inputs = tok(texts, return_tensors="pt", padding=True, truncation=True, max_length=512)
with torch.no_grad():
    score = model(**inputs).logits.squeeze(-1).float()
int_score = score.clamp(0, 5).round().int()
print(score.tolist(), int_score.tolist())

Evaluation

  • 65 languages: 9,750 held-out FineWeb-2 documents (150 per language; never used for training) scored with the FineWeb-Edu rubric by an independent judge, google/gemma-4-31b-it (a different model family from our teacher). Metric: Spearman rank correlation with the judge, over all documents and averaged per language.
  • English: 6,000 documents from a held-out shard of HuggingFaceFW/fineweb-edu-llama3-annotations (Llama-3-70B scores); Spearman, and F1 of the educational decision (score >= 3, as FineWeb-Edu uses it).
model licence 65 languages (FineWeb-2): Spearman per-language mean Spearman English (Llama-3 labels): Spearman English: F1, educational (>= 3) note
this model (308M) Apache-2.0 0.845 0.836 0.787 0.729 65+ languages
Horizon-Labs/multilingual-edu-classifier-small (141M) Apache-2.0 0.823 0.809 0.781 0.723
HuggingFaceFW/fineweb-edu-classifier (109M) Apache-2.0 0.313 0.355 0.781 0.717 English; trained on the Llama-3 annotations used for the English test (in-domain)
nvidia/nemocurator-fineweb-mixtral-edu-classifier (109M) NVIDIA open model licence 0.282 0.339 0.718 0.615 English
nvidia/nemocurator-fineweb-nemotron-4-edu-classifier (109M) NVIDIA open model licence 0.290 0.340 0.690 0.559 English
hotchpotch/fineweb-2-edu-japanese-classifier (279M) MIT 0.550 0.575 0.592 0.180 Japanese (XLM-R)
lapa-llm/fineweb-nemotron-edu-score (279M) MIT 0.535 0.547 0.404 0.000 Ukrainian (XLM-R)
Qwen3.8-27B, prompted (our teacher, raw scores before calibration; 27B) Apache-2.0 0.881 0.873 0.702 0.527 for reference
  • The table shows the released checkpoint. Means over 2 training seeds (small: 65 languages .823 / .823, English .781 / .780; base: .847 / .845, .793 / .787).
  • The English classifiers rank multilingual documents poorly (Spearman about 0.3); this model is built for that case. On English, this model is ahead of HuggingFaceFW/fineweb-edu-classifier (Spearman 0.787 vs 0.781). HuggingFaceFW/fineweb-edu-classifier was trained on the same Llama-3 annotations as the English test set (in-domain for it).
  • Caveat: the multilingual reference is itself an LLM. The judge agrees with Llama-3 about as well as our teacher does (English Spearman 0.73 vs 0.70), but the judge and our teacher agree with each other more (0.88), which favours this model somewhat on that test. No human-labelled multilingual educational-quality test set was available.
  • Per language (Spearman with the judge): highest cmn_Hani 0.91, hun_Latn 0.90, pol_Latn 0.89, lit_Latn 0.89, ukr_Cyrl 0.89, cat_Latn 0.89, swe_Latn 0.88, pan_Guru 0.88; lowest azj_Latn 0.71, amh_Ethi 0.72, npi_Deva 0.74, urd_Arab 0.75, sin_Sinh 0.76, mya_Mymr 0.76, hye_Armn 0.76, kan_Knda 0.78.

Training

  • English: 149,997 documents with their Llama-3-70B scores from HuggingFaceFW/fineweb-edu-llama3-annotations (ODC-BY).
  • 65 other languages: 129,965 documents from FineWeb-2 (ODC-BY), about 2,000 per language, scored by Qwen3.8-27B (Apache-2.0) with the same rubric (expected score from its answer probabilities). Those scores were mapped onto the Llama-3 scale by isotonic regression fitted on 10,000 English documents scored by both, so that 3 means the same thing in every language.
  • mmBERT-base with one regression output, mean squared error, max length 512 tokens; checkpoint chosen by Spearman on 13,920 held-out documents. Code: code/ in this repository.

Limitations

  • "Educational" here means the FineWeb-Edu rubric (useful for teaching at primary to grade-school level). It undervalues good content that is not school-like (fiction, news, forums, specialised research), and it can encode the judges' cultural biases. Filtering with it changes what a model trained on the data sees, so check that the result still covers what you need.
  • Labels come from LLMs, not people, and the per-language agreement varies (see above). Lower-resource languages and scripts are weaker.
  • Only the first 512 tokens are read.
Downloads last month
-
Safetensors
Model size
0.3B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Horizon-Labs/multilingual-edu-classifier-base

Quantized
(283)
this model

Datasets used to train Horizon-Labs/multilingual-edu-classifier-base

Collection including Horizon-Labs/multilingual-edu-classifier-base