Abstract
Text2Token is a novel unsupervised framework that learns high-quality text embeddings by training models to predict "key tokens" rather than using traditional contrastive learning. By aligning the representation space directly with the model's vocabulary space, it achieves state-of-the-art performance on the MTEB benchmark, proving that generative objectives can be more effective than discriminative ones for LLM-based encoders.
Introduction
In Natural Language Processing (NLP), Text Representation Learning (TRL) involves transforming text into dense vectors that capture semantic meaning. Traditionally, contrastive learning has been the dominant approach, pulling similar sentences together and pushing dissimilar ones apart. However, modern Large Language Models (LLMs) are fundamentally generative, trained for next-token prediction. This creates a conceptual mismatch when forcing them into discriminative frameworks. Text2Token addresses this by proposing a generative task natively compatible with LLM architectures.
Methodology
The core of Text2Token is the "Reversibility Hypothesis": the relationship between representation space (vectors) and vocabulary space (words) is reversible. If a model can map a vector to the correct "key tokens" of a text, it has learned a high-quality representation.
The framework employs a two-stage unsupervised training paradigm:
- Data-Driven Target Construction: The model predicts tokens present in the input. Importance is determined via TF-IDF scoring and a Part-of-Speech (POS) filter prioritizing nouns and adjectives.
- Model-Derived Target Construction: This stage captures latent semantic meaning by using the LLM's internal priors to find related tokens. To ensure specificity, a "common distribution" (average corpus prediction) is subtracted from the results.
Training is optimized using KL-Divergence between the predicted token distribution and the constructed targets, with efficiency gains from Low-Rank Adaptation (LoRA).
Experimental Results
Text2Token was evaluated on the MTEB v2 benchmark using Llama3-8B and Mistral-7B backbones. It consistently outperformed LLM2Vec, the previous state-of-the-art for unsupervised contrastive learning.
Key results include:
- Llama3-8B: Achieved an average MTEB score of 55.25, surpassing LLM2Vec’s 53.29.
- Mistral-7B: Achieved 55.10, surpassing LLM2Vec’s 53.94.
- Pooling Strategy: "Last-token" pooling was found to be significantly more effective than mean pooling for this generative objective.
Conclusion
Text2Token demonstrates that the discrete vocabulary of an LLM can serve as a structured supervisory signal, bypassing the need for noisy negative samples in contrastive learning. By aligning the embedding space with the generative nature of LLMs, the framework achieves superior performance across diverse NLP tasks. Future work will explore the integration of this generative objective with supervised fine-tuning.
Summary updated