What happened
The pipeline has two stages: featurization creates mean token embeddings from a sentence transformer, and training uses those embeddings as targets for a static Model2Vec model. (github.com) The tokenlearn.featurize CLI builds a featurized dataset from a HuggingFace dataset and saves it as a standard HuggingFace dataset under --output-dir; --push-to-hub can publish that dataset to the Hub. (github.com)
Then tokenlearn.train trains on the featurized dataset, and its --data-path can point to a HuggingFace Hub repository ID. Training produces a base model and a weighted version; the repository recommends using the weighted model for downstream tasks. (github.com)
The original version was used to train potion-base-32M, potion-base-8M, potion-base-4M and potion-base-2M; the current version was used for potion-multilingual-128M. (github.com) The repository is MIT-licensed.
Limits and uncertainty
Check the tokenizer’s padding token ID before training: the code assumes it is 0, and needs modification otherwise. (github.com) The repository names PCA and SIF reweighting among techniques associated with Tokenlearn, but does not explain their implementation details here. (github.com)
Skill to build now
Install with pip install tokenlearn. (github.com) For a first check, use the repository’s optional evaluation dependencies and example to run a trained model on test splits.
Reader takeaway
Tokenlearn separates training into featurization and model training: first create mean token embeddings as targets, then train a static Model2Vec model from that dataset. Training yields both a base model and a weighted version; the repository recommends the weighted model for downstream tasks. Verify that your tokenizer uses padding ID 0 before running the pipeline.