Changelog
0.3.0 (2026-12-04)
The first stable release since 0.2.1. MAMMOTH now runs on a native PyTorch transformer, exports models to Hugging Face, and ships a local translation server. Models and configs from 0.2.x need changes (see Breaking changes). If you tried 0.3.0rc1, see Changes since 0.3.0rc1 at the end.
Highlights
Native PyTorch backend. The transformer is built from plain
torch.nnmodules inmammoth/modules/transformer/(RoPE, attention with KV cache and grouped-query attention, SwiGLU / GeGLU / GELU feed-forward, RMSNorm). The x-transformers dependency is gone.Hugging Face export.
mammoth_export_hfwrites three formats: modular (the default; every component is stored once and a model is assembled per direction at load time, including untrained zero-shot directions), standalone (one model per task) and single artifact (all tasks in one directory). Exported models run with onlytransformersandtorchinstalled.mammoth_uploadandmammoth_downloadmove them to and from the Hub.Translation server.
mammoth_servestarts a local server with an OPUS-MT compatible HTTP API and a web page. All directions share one pool of components, directions (zero-shot included) can be loaded at runtime, and--src/--outputtranslate a file and exit. Install withpip install 'mammoth-nlp[server]'.Extending a trained model. Train a new language without touching the rest of the model:
freeze_components/train_componentsfreeze whole components by name (@pretrainedselects everything in thetrain_fromcheckpoint), each language has its own post-embedding norm, and every checkpoint of atrain_fromrun is a complete model.Tools.
python -m mammoth.scripts.count_paramsreports parameters per component, per task and in total. New docs pages explain estimating GPU memory and choosing sequence lengths.
Breaking changes
Requirements: Python ≥ 3.11, torch ≥ 2.8, transformers ≥ 5.24 (< 6). Dependencies are declared in the package, so
pip install mammoth-nlpinstalls torch, transformers and the rest.Configs: the x-transformers options (
x_transformers_opts) are removed; the model is set with top-level keys (model_dim,heads,ff_mult,enc_layers,dec_layers, …). The FFN default is SwiGLU, andmodel_dtypenow defaults tobf16(wasfp32; setmodel_dtype: fp32on GPUs without bf16, e.g. V100).Checkpoints from 0.2.x (x-transformers backend) do not load.
Best checkpoint and early stopping:
--metric_for_best_modeltakesmean_ppl(default),mean_bleuormean_chrf, averaged over every validated task.--greater_is_betterand--early_stopping_criteriaare removed.Tokenizers: Hugging Face tokenizers are the supported path. SentencePiece is deprecated and only available as the
sentencepieceextra.Commands:
mammoth_config_config,mammoth_generate_synth_dataandmammoth_iterate_tasksare no longer installed.config_configandgenerate_synth_datastill run withpython -m mammoth.bin.<name>;config_configis planned for deprecation.mammoth_iterate_tasksis replaced by several--task_idvalues in onemammoth_translaterun.The OpenNMT translation server (
server.py, the/translatorAPI) and the Streamlit demo are removed; usemammoth_serve.
--yes_i_messed_with_the_checkpointis renamed--allow_partial_checkpoint(the old name still works but is deprecated).
Added
mammoth_serve(see Highlights).mammoth_export_hf,mammoth_upload,mammoth_downloadandmammoth_build_vocabcommands.mammoth_translatetranslates several tasks in one run: give several--task_idvalues, with per-tasksrc/tgt/outputundertasks.<id>.freeze_components/train_components(see the Freezing components page).rope_thetasets the RoPE base (default 10000); it is saved in the checkpoint and in exported models.Gemma3-270M can be converted into MAMMOTH, with logits matching Hugging Face exactly in fp32.
Training logs the MAMMOTH version, the git commit and the effective
ff_multat startup.Docs: install, quickstart, LUMI & Roihu quickstart (pip-installed venv, CPU job templates), Hugging Face export, serving, extending a model with a new language, freezing components, counting parameters, estimating memory, choosing sequence lengths, option pages for every
mammoth_*command, and an API reference for the native modules, serving and HF export.
Changed
New models get one post-embedding norm per language, saved with the language’s embedding. Older checkpoints keep one norm per encoder/decoder path and load unchanged for translation.
Training: fewer GPU-to-CPU syncs, overlapped gradient all-reduce, fused AdamW by default.
Freezing options apply on every rank (before, only rank 0 froze).
Fixed
RoPE base of rotary decoders: since 2026-09-17 (including 0.3.0rc1) every rotary decoder used base 160000 in training but 10000 in exported models. Checkpoints trained with this bug are not supported; retrain them.
Hugging Face export of GELU / GeGLU models: they were exported as SwiGLU with a randomly initialised weight. Weight loading is now strict. Re-export such models.
Causal self-attention with a KV cache and several new tokens could attend to later tokens (generation, one token per step, was not affected).
The exported model on transformers 5:
use_cachewas lost andgenerate()recomputed the whole prefix at every step.Resuming a run with frozen components, and checkpoints of
train_fromruns that missed the components the run did not use.NCCL deadlocks on the final save and on early stopping.
Changes since 0.3.0rc1
For users of the release candidate; everything here is also covered above.
Python ≥ 3.11 and transformers ≥ 5.24 (rc1: Python ≥ 3.10, transformers ≥ 4.57).
Hugging Face commands renamed:
mammoth_convert2hf→mammoth_export_hf,mammoth_push2hf→mammoth_upload,mammoth_download_hf→mammoth_download.mammoth_export_hfwrites the modular format by default. The former default (one model per task) is--standalone;--modular,--standaloneand--single-artifactare mutually exclusive, and--taskrequires--standalone.model_dtypedefaults tobf16.--metric_for_best_modelvalues aremean_ppl/mean_bleu/mean_chrf;--greater_is_betterand--early_stopping_criteriaare removed.Rotary-decoder checkpoints trained with rc1 are affected by the RoPE base bug (see Fixed).
GELU / GeGLU models exported with rc1 must be re-exported.
New:
mammoth_serve, component freezing, per-language post-embedding norms, multi-taskmammoth_translate,count_params,rope_theta.
0.3.0rc1 (2026-10-26)
Release candidate for 0.3.0, published to test the release process. See the 0.3.0 entry.
0.2.1 (2024-12-16)
Last release on the x-transformers backend.