LTZ E1 (mini)

A ModernBERT-based masked language model pretrained on Luxembourgish, following the Ettin recipe (see here: https://huggingface.co/jhu-clsp/ettin-encoder-68m)

Model Details

  • Architecture: ModernBERT (encoder)
  • Size: mini
  • Vocabulary: 50,368 tokens (BPE, GPTNeoXTokenizerFast)
  • Context length: 1,024 tokens
  • Language: Luxembourgish (lb/ltz)
  • License: CC BY-SA 4.0

Usage

Requires transformers>=4.48.0.

from transformers import AutoModelForMaskedLM, AutoTokenizer
import torch

tokenizer = AutoTokenizer.from_pretrained("instilux/ltz-e1-mini")
model = AutoModelForMaskedLM.from_pretrained("instilux/ltz-e1-mini")

inputs = tokenizer("Wéi spéit [MASK] et?", return_tensors="pt")
mask_pos = (inputs["input_ids"] == tokenizer.mask_token_id).nonzero(as_tuple=True)[1]

with torch.no_grad():
    outputs = model(**inputs)

top_tokens = outputs.logits[0, mask_pos].topk(5)
for token_id, score in zip(top_tokens.indices[0], top_tokens.values[0]):
    token = tokenizer.decode(token_id)
    print(f"{token:15s} {score:.3f}")

Tokenization and special tokens

Use the tokenizer as is. It reproduces the input format used in pretraining.

The tokenizer is byte-level BPE (GPTNeoXTokenizerFast) with BERT-style special tokens ([CLS], [SEP], [PAD], [MASK], [UNK]). A [CLS] token is prepended automatically (add_bos_token: true), but no [SEP] is appended: inputs are [CLS] tok_1 … tok_n, exactly as in pretraining. Although config.json lists eos_token_id and sep_token_id as 1 ([SEP]), the model never saw [SEP] during pretraining, so we do not recommend adding it manually.

  • Sentence pairs. For two input texts, the tokenizer produces [CLS] A [CLS] B, with a second [CLS] as separator and no [SEP]. Pretraining used single texts only (no sequence packing), so the model only learns this pair format during fine-tuning.
  • Pooling. The default for sequence classification is classifier_pooling: "mean". All our reported fine-tuning results use this default.
  • [CLS] input embedding. During pretraining, the embedding padding index was set to 0 ([CLS]) instead of 2 ([PAD]). As a result, the input embedding of [CLS] received no gradient from its role as an input token; it was updated only through the tied output layer. The released config uses the correct pad_token_id=2, so the [CLS] embedding is trained normally during fine-tuning. Users who need an untuned sentence representation from [CLS] should keep this in mind. With the default mean pooling it has little effect.

Citation

Please cite this paper (ACL 2026 Findings) if you use this model in your work.

@inproceedings{plum-etal-2026-ltzglue,
    title = "ltz{GLUE}: {L}uxembourgish General Language Understanding Evaluation",
    author = {Plum, Alistair  and
      K{\"o}rner, Felicia  and
      Lutgen, Anne-Marie  and
      Bernardy, Laura  and
      Philippy, Fred  and
      Milano, Emilia  and
      Rehlinger, Nils  and
      Lothritz, Cedric  and
      Ranasinghe, Tharindu  and
      Plank, Barbara  and
      Purschke, Christoph},
    editor = "Liakata, Maria  and
      Moreira, Viviane P.  and
      Zhang, Jiajun  and
      Jurgens, David",
    booktitle = "Findings of the {A}ssociation for {C}omputational {L}inguistics: {ACL} 2026",
    month = jul,
    year = "2026",
    address = "San Diego, California, United States",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2026.findings-acl.476/",
    doi = "10.18653/v1/2026.findings-acl.476",
    pages = "9791--9807",
    ISBN = "979-8-89176-395-1",
    abstract = "This paper presents ltzGLUE, the first Natural Language Understanding (NLU) benchmark for Luxembourgish (LTZ) based on the popular GLUE benchmark for English. Although NLU tasks are available for many european languages nowadays, LTZ is one of the official national languages that is often overlooked. We introduce new tasks and reuse existing ones to introduce the first official NLU benchmark and accompanying evaluation of encoder models for the language. Our tasks include common natural language processing tasks in binary and multi-class classification settings, including named entity recognition, topic classification, and intent classification. We evaluate various pre-trained language models for LTZ to present an overview of the current capabilities of these models on the LTZ language."
}
Downloads last month
446
Safetensors
Model size
68.5M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Collection including instilux/ltz-e1-mini