/ Модель

Характеристики

Контекст
256 токенов
Лицензия
Apache 2.0
Опубликована
12 ноя 2026

leanvocab-factorized-bert-orig

Заполнение пропусковТекст → текст3 профессии
0скачиваний за 30 дней0лайковвеса обновлены12 ноя 2026

Описание модели

Составлено на русском по карточке модели и метаданным Hugging Face

Экспериментальный англоязычный BERT-подобный энкодер для заполнения пропусков и исследований предобучения с факторизованными эмбеддингами.

Это экспериментальный исследовательский чекпойнт DhruvParmar051: BERT-подобный энкодер, обученный с нуля предсказывать замаскированные токены. В модели 6 слоёв, скрытая размерность 384, 12 голов внимания, контекст до 256 токенов и словарь WordPiece на 30 522 токена; эмбеддинги факторизованы через таблицу размерности 128 с проекцией до 384. Веса сохранены в формате safetensors, лицензия — Apache 2.0.

Модель предназначена для воспроизведения и развития исследования leanvocab, сравнения токенизаторов при фиксированном вычислительном бюджете и экспериментов по дальнейшему дообучению, в том числе на Apple silicon через MLX. Это англоязычная модель, предварительно обученная на 2 ГБ образовательных веб-текстов FineWeb-Edu с задачей masked language modelling; основной сценарий применения — заполнение пропусков в тексте.

Это не готовая модель эмбеддингов: контрастивное дообучение для получения качественных векторных представлений не проводилось, а sentence-level objective и pooler отсутствуют. Авторы указывают на однократный запуск с одним seed и небольшой объём предобучения; качество за пределами английского и образовательных веб-текстов может быть низким. Обычная загрузка через стандартный BertForMaskedLM не поддерживается из-за факторизованной структуры эмбеддингов; для запуска нужен собственный MLX-энкодер из проекта leanvocab.

Сценарии применения

  • заполнение пропущенных слов в английском тексте
  • воспроизведение экспериментов по сравнению токенизаторов
  • изучение влияния факторизации эмбеддингов на размер энкодера
  • дообучение компактного BERT-подобного энкодера на образовательных веб-текстах

Ограничения

Модель не обучалась для качественных sentence embeddings и не предназначена для продакшена; обучение выполнено за один проход по небольшому англоязычному корпусу с одним seed. Для загрузки нужен собственный MLX-энкодер проекта leanvocab, поскольку стандартный BertForMaskedLM не поддерживает её факторизованные эмбеддинги.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

leanvocab-factorized-bert-orig

A 6-layer, 384-wide BERT-shaped encoder pretrained from scratch with masked language modelling on 2.00 GB of FineWeb-Edu text, using a 30,522-token vocabulary (WordPiece (original bert-base-uncased vocabulary)).

This is the factorized-embedding baseline arm of leanvocab, a controlled study asking whether a tokenizer with an 8k-16k vocabulary can reach sentence-embedding quality within 0.5 MTEB-avg points of a same-recipe MiniLM-shaped encoder using BERT's 30,522-token vocabulary, while freeing 25-38% of the parameters and without slower end-to-end inference.

This is a research checkpoint, not a finished embedding model. It has only been pretrained with MLM on a small budget; the contrastive fine-tuning that would make it produce useful sentence embeddings has not run yet. See Intended use.

Summary

Vocabulary30,522 tokens, WordPiece (original bert-base-uncased vocabulary)
Encoder parameters14.64M (35% fewer than the control)
Parameters in model.safetensors (encoder + MLM head)14.72M
Held-out bits per byte1.8467 (+0.6536 vs the control)
Held-out MLM accuracy14.7%
Training text2.00 GB, one pass, 6,505 steps
Wall clock1.67 h on one M5 Pro
Compression on held-out text4.726 bytes/token, fertility 1.309 tokens/word

Bits per byte is the held-out MLM loss per byte of raw text rather than per token. That is the point: two tokenizers cut the same sentence into different numbers of tokens, so per-token loss is not comparable across them, while per-byte loss is. Lower is better.

Why this exists

An encoder of this shape spends a large share of its parameters on the token embedding matrix - 22.47M total for the 30,522-token control. If a much smaller vocabulary costs little quality, that block shrinks and the savings are free. To make the tokenizer the only moving part, every arm shares the corpus, the bytes of text per optimizer step, the model shape, the optimizer, the schedule, the masking and the seed.

All finished arms (identical recipe, seed 0)

ArmVocabEncoder paramsHeld-out bits/bytevs controlMLM accWall clock
bpe-16k16,00016.89M (0.75x)1.1613-0.031837.6%1.79 h
bert-orig (control)30,52222.47M (1.00x)1.1931-35.5%2.51 h
bpe-8k8,00013.82M (0.62x)1.1992+0.006038.1%1.70 h
factorized-bert-orig30,52214.64M (0.65x)1.8467+0.653614.7%1.67 h

Reading of these numbers, as of the runs above:

  • bpe-16k (16,000-token small-vocab candidate) beat the control by 0.032 bits/byte while using 25% fewer encoder parameters and 29% less wall clock.
  • bpe-8k (8,000-token small-vocab candidate) landed within 0.006 bits/byte of the control for 38% fewer encoder parameters - close enough that a single seed cannot separate them.
  • factorized-bert-orig (30,522-token factorized-embedding baseline) came out 0.654 bits/byte worse than the control despite 35% fewer encoder parameters, so its parameter saving did not come for free under this recipe.
  • Parameter savings are not interchangeable: an equally sized saving from embedding factorization behaves very differently from one from a smaller vocabulary, as the table shows.

Intended use and limitations

Use it for: reproducing or extending the study, comparing tokenizers under a fixed compute budget, or as a starting point for your own fine-tuning experiments on Apple silicon.

Do not use it for: anything in production, and do not read these numbers as a verdict on the study's claim. Specifically:

  • Single seed. Every arm ran once, at seed 0. Differences smaller than a few hundredths of a bit per byte are not yet distinguishable from noise.
  • Small budget. 2 GB of text and one pass is far short of a production pretraining run; MLM accuracy near 15% reflects that, and arm ordering can change with scale.
  • Bits per byte is not MTEB. The study's claim is about sentence-embedding quality. That requires the contrastive fine-tuning and MTEB phases, which have not run. MTEB is deliberately untouched so far - all decisions were made on a held-out dev split.
  • No pooler and no sentence-level objective. Mean-pooling these hidden states will give you something, but nothing here was trained to make it good.
  • English, educational web text. FineWeb-Edu only, uncased. Expect poor behaviour on other languages, on cased distinctions, and on domains unlike educational web pages. The corpus is filtered web text and carries its biases into this checkpoint.

Training recipe

  • Corpus: FineWeb-Edu sample-10BT at a pinned revision, NFC-normalized, exactly deduplicated (BLAKE2b-128), with a frozen held-out split removed before training.
  • Budget: 2 GB of text per arm, a single pass, sequence length 256 with RoBERTa-style full-sentence packing.
  • Equal-bytes batching: every step consumes about 307.3 kB of raw text rather than a fixed number of tokens, so arms are not accidentally given different amounts of text. For this arm that is 256 sequences in 2 micro-batches.
  • Objective: MLM at 15% masking, 80/10/10 mask/random/keep, with a fixed 38 predictions per sequence so the compiled graph has a static shape.
  • Shape: 6 layers, hidden 384, 12 heads, FFN 1536, 256 positions, embeddings tied to the MLM output layer.
  • Optimizer: AdamW, lr 0.0005, betas (0.9, 0.98), weight decay 0.01 (not on biases or LayerNorm), gradient clipping 1.0, linear warmup over 6% of steps then linear decay.
  • Evaluation: held-out bits per byte on 10 MB with masks fixed by seed 1234, every 500 steps.
  • Hardware: one Apple M5 Pro (48 GB) via MLX; no CUDA anywhere in the study. Peak GPU memory 24.2 GB.

Files

FileWhat it is
model.safetensorsFinal weights, float32
leanvocab_config.jsonThe study's own EncoderConfig for this arm
metrics.jsonThe full recorded run: curve, plan, final evaluation, provenance
tokenizer.jsonThe tokenizer this arm was trained with

Optimizer state is not published (it is twice the size of the weights); resuming training needs the local checkpoint directory from the study.

Usage

This arm factorizes the token embeddings (a 30,522 x 128 table, then a projection up to the hidden size 384), which is not a parameter layout stock BertForMaskedLM understands. Load it with the study's own MLX encoder from a leanvocab checkout:

import json

from huggingface_hub import snapshot_download

from leanvocab.model.config import EncoderConfig
from leanvocab.model.encoder import BertForMaskedLM

path = snapshot_download("DhruvParmar051/leanvocab-factorized-bert-orig")
cfg = EncoderConfig(**json.load(open(f"{path}/leanvocab_config.json")))
model = BertForMaskedLM(cfg)
model.load_weights(f"{path}/model.safetensors")

The weights are published mainly so the negative result is inspectable - see Intended use.

Related repositories

Provenance

  • Run 20260918T081321Z-1e4505cf-factorized-bert-orig, seed 0, config SHA-256 1e4505cf5866, commit e46a9184ca06 (working tree dirty).
  • macOS-26.6.2-arm64-arm-64bit, Python 3.11.15, MLX 0.32.2, tokenizers 0.23.2.
  • MLX_ENABLE_TF32=1: MLX uses TF32 matmuls on Apple GPUs by default (about 1e-3 relative error, about 1.9x faster). The study records this rather than silently depending on it.
  • Tokenizer tokenizer.json SHA-256 d241a60d5e8f; round-trip check on 2,000 held-out documents: ignore_whitespace, passed.
  • Code, configs and the recorded metrics: https://github.com/DhruvParmar051/leanvocab.

Citation

@misc{leanvocab,
  title  = {leanvocab: a controlled study of small-vocabulary English tokenizers
            for sentence-embedding encoders},
  author = {Parmar, Dhruv},
  year   = {2026},
  url    = {https://github.com/DhruvParmar051/leanvocab}
}

Card generated 2026-11-12 from the recorded run metrics.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм

Нельзя запустить

MLX-модели работают только на Apple Silicon, на GPU NVIDIA они не запускаются.

Ревизия весов
f9d0d75

0 моделей