Discover and explore top open-source AI tools and projects—updated daily.
ContextualAIResearch paper and models for generative representational instruction tuning
Top 50.0% on SourcePulse
This repository provides the code and resources for Generative Representational Instruction Tuning (GRIT), a novel method for training large language models to excel at both text generation and embedding tasks. It targets researchers and developers seeking to unify these capabilities in a single model, offering significant speedups for applications like Retrieval-Augmented Generation (RAG).
How It Works
GRIT trains a single model to handle both generative and embedding tasks by using specific instructions to differentiate between them. This approach, implemented via custom modeling files that enable bidirectional attention for embeddings and causal attention for generation, allows for a unified model that achieves state-of-the-art performance on embedding benchmarks (MTEB) and competitive results on generative tasks, without performance degradation compared to specialized models.
Quick Start & Requirements
pip install gritlmdevice_map="auto" is recommended.Highlighted Details
Maintenance & Community
Licensing & Compatibility
Limitations & Caveats
--mode unified with gradient_accumulation_steps > 1 is not supported.torch.compile fails in unified mode.accelerate and transformers.4 months ago
1 day
AkariAsai
SafeAILab
HandsOnLLM