/ Модель

Характеристики

Контекст
8 192 токена
Параметры
395 млн
Лицензия
MIT
Архитектура
modernbert · dense
Базовая модель
ModernBERT-base
Опубликована
10 фев 2025

lettucedect-large-modernbert-en-v1

Разметка токеновТекст → label6 профессий

Дообученная англоязычная ModernBERT-модель размечает неподтверждённые фрагменты ответов по заданному контексту для проверки RAG-систем.

4 612скачиваний за 30 дней30лайковвеса обновлены1 апр 2025

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

LettuceDetect large modernbert en v1 — англоязычная модель KRLabsOrg для выявления галлюцинаций в ответах на основе заданного контекста, в частности в системах Retrieval-Augmented Generation (RAG). Это дообученная для классификации токенов модель ModernBERT-large; в метаданных базовой моделью указана answerdotai/ModernBERT-base. Репозиторий содержит веса Safetensors, модель насчитывает 394,7 млн параметров и поддерживает контекст до 8192 токенов.

Модель анализирует контекст вместе с ответом и размечает токены ответа, которые не подтверждаются контекстом; оценки по токенам можно объединить в фрагменты, чтобы показать подозрительные места. Она предназначена для проверки ответов RAG и локализации неподтверждённых утверждений. В README приведён результат F1 79,22% на тестовой выборке RAGTruth для оценки на уровне примеров. Указана лицензия MIT. Заявленные характеристики и результаты относятся к описанной конфигурации и набору данных; качество на других данных может отличаться.

Сценарии применения

  • поиск неподтверждённых утверждений в ответе RAG-системы
  • разметка токенов ответа, не подтверждённых документами
  • локализация подозрительных фрагментов для последующей проверки
  • оценка достоверности ответов по длинному контексту

Ограничения

Модель описана для английского языка и проверки ответов относительно предоставленного контекста; её качество за пределами тестовой выборки RAGTruth не установлено в приведённых данных.

Для каких профессий подходит6

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

LettuceDetect: Hallucination Detection Model

Model Name: lettucedect-large-modernbert-en-v1
Organization: KRLabsOrg
Github: https://github.com/KRLabsOrg/LettuceDetect

Overview

LettuceDetect is a transformer-based model for hallucination detection on context and answer pairs, designed for Retrieval-Augmented Generation (RAG) applications. This model is built on ModernBERT, which has been specifically chosen and trained becasue of its extended context support (up to 8192 tokens). This long-context capability is critical for tasks where detailed and extensive documents need to be processed to accurately determine if an answer is supported by the provided context.

This is our Large model based on ModernBERT-large

Model Details

  • Architecture: ModernBERT (Large) with extended context support (up to 8192 tokens)
  • Task: Token Classification / Hallucination Detection
  • Training Dataset: RagTruth
  • Language: English

How It Works

The model is trained to identify tokens in the answer text that are not supported by the given context. During inference, the model returns token-level predictions which are then aggregated into spans. This allows users to see exactly which parts of the answer are considered hallucinated.

Usage

Installation

Install the 'lettucedetect' repository

pip install lettucedetect

Using the model

from lettucedetect.models.inference import HallucinationDetector

# For a transformer-based approach:
detector = HallucinationDetector(
    method="transformer", model_path="KRLabsOrg/lettucedect-base-modernbert-en-v1"
)

contexts = ["France is a country in Europe. The capital of France is Paris. The population of France is 67 million.",]
question = "What is the capital of France? What is the population of France?"
answer = "The capital of France is Paris. The population of France is 69 million."

# Get span-level predictions indicating which parts of the answer are considered hallucinated.
predictions = detector.predict(context=contexts, question=question, answer=answer, output_format="spans")
print("Predictions:", predictions)

# Predictions: [{'start': 31, 'end': 71, 'confidence': 0.9944414496421814, 'text': ' The population of France is 69 million.'}]

Performance

Example level results

We evaluate our model on the test set of the RAGTruth dataset. Our large model, lettucedetect-large-v1, achieves an overall F1 score of 79.22%, outperforming prompt-based methods like GPT-4 (63.4%) and encoder-based models like Luna (65.4%). It also surpasses fine-tuned LLAMA-2-13B (78.7%) (presented in RAGTruth) and is competitive with the SOTA fine-tuned LLAMA-3-8B (83.9%) (presented in the RAG-HAT paper). Overall, lettucedetect-large-v1 and lettucedect-base-v1 are very performant models, while being very effective in inference settings.

The results on the example-level can be seen in the table below.

Span-level results

At the span level, our model achieves the best scores across all data types, significantly outperforming previous models. The results can be seen in the table below. Note that here we don't compare to models, like RAG-HAT, since they have no span-level evaluation presented.

Citing

If you use the model or the tool, please cite the following paper:

@misc{Kovacs:2025,
      title={LettuceDetect: A Hallucination Detection Framework for RAG Applications}, 
      author={Ádám Kovács and Gábor Recski},
      year={2025},
      eprint={2502.17125},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2502.17125}, 
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · token-classification

Можно запустить

Подбираем GPU…

Класс архитектуры
ModernBertForTokenClassification
Ревизия весов
22296c7

0 моделей