AI
Luxical: A Fast Hybrid Text Embedding Tool That Bridges Sparse and Neural Models
A new open-source library combines the speed of lexical methods with the flexibility of transformer embeddings, achieving dramatic speedups for large-scale text processing.
Organizing massive text datasets for machine learning training typically forces researchers into a difficult choice: use fast but rigid lexical classifiers, or rely on slower but versatile neural embedding models. A new library called Luxical attempts to escape this tradeoff by merging the computational efficiency of sparse methods with the flexibility of dense neural embeddings.
The Problem Luxical Solves#
Building frontier language models depends heavily on the ability to systematically organize web-scale text collections. Traditional lexical tools like FastText process data rapidly but only output classification scores, limiting their applicability to downstream tasks. Modern transformer-based embedding models, by contrast, produce vector representations that unlock numerous use cases—clustering, ranking, semantic search, and data filtering—but demand significant computational resources to generate at scale.
How Luxical Works#
The Luxical approach combines three key ingredients: sparse TF-IDF features (which capture term frequency patterns efficiently), a compact ReLU neural network, and knowledge distillation (a training technique that teaches a smaller model to mimic a larger one). This hybrid design approximates the output quality of large transformer models while consuming a fraction of the computing power.
Demonstrated Performance#
In tests across two practical scenarios—retrieving relevant documents from targeted web crawls and curating training data through text classification—Luxical delivered speedups between 3x and 100x relative to various neural baselines. For the data curation task, its inference speed matched FastText directly, suggesting it can operate at the speed tier of classical lexical methods without sacrificing output quality. The evaluation showed the model achieves comparable results to full neural systems on the tasks tested.
Availability#
The Luxical library is released as open-source software, making the approach available for researchers and practitioners working on large-scale text organization tasks.

