SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2404.10774 · EMNLP · 2024

MiniCheck: Efficient Fact-Checking of LLMs on Grounding Documents

Greg Durrett, Philippe Laban, Liyan Tang

arXiv · PDF · Open in the Atlas

Code that ran

2 of 8 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 1 failure of our instrument; 6 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2404.10774.json · badge: /api/ran/2404.10774.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
liyan06/minicheck canonical (classifier label)
classifier basis: census
1 ran · 3 no recorded run
Liyan06/MiniCheck community
Papers with Code archive
1 ran · 3 no recorded run
FunctionStatusWhere it lives
MiniCheck Ran
ran on a synthesized input · constructed an object; no result was computed
Liyan06/MiniCheck/minicheck/minicheck.py
code served (permissive licence) · get_code("f28664b6930ce419")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, MiniCheck: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from unittest.mock import Mock, MagicMock
import nltk

torch.manual_seed(0)

# Download required NLTK data
try:
    nltk.data.find('tokenizers/punkt')
except LookupError:
    nltk.download('punkt', quiet=True)

# Create a minimal mock tokenizer
class MockTokenizer:
    def __init__(self):
        self.model_max_length = 512
    
    def __call__(self, text, padding=False, add_special_tokens=False, max_length=None, truncation=False):
        # Return mock token IDs
        words = text.split()
        token_count = len(words)
        return {
            'input_ids': list(range(token_count)),
            'attention_mask': [1] * token_count
        }
    
    def encode(self, text, max_length=None, truncation=False):
        words = text.split()
        return list(range(len(words)))

# Create a minimal mock model for Seq2Seq
class MockSeq2SeqModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def eval(self):
        return self
    
    def forward(self, input_ids, attention_mask=None, **kwargs):
        output = Mock()
        output.logits = torch.randn(2, 4, 4)
        return output

# Create a minimal mock model for Sequence Classification
class MockSequenceClassificationModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 2)
    
    def eval(self):
        return self
    
    def forward(self, input_ids, attention_mask=None, **kwargs):
        output = Mock()
        output.logits = torch.randn(2, 2)
        return output

# Mock AutoConfig
class MockAutoConfig:
    def __init__(self):
        self.num_labels = 2
        self.problem_type = 'single_label_classification'

# Create patches for transformers functions
original_AutoModelForSeq2SeqLM = __import__('transformers').AutoModelForSeq2SeqLM
original_AutoModelForSequenceClassification = __import__('transformers').AutoModelForSequenceClassification
original_AutoConfig = __import__('transformers').AutoConfig
original_AutoTokenizer = __import__('transformers').AutoTokenizer

def mock_from_pretrained_seq2seq(*args, **kwargs):
    return MockSeq2SeqModel()

def mock_from_pretrained_classification(*args, **kwargs):
    return MockSequenceClassificationModel()

def mock_config_from_pretrained(*args, **kwargs):
    return MockAutoConfig()

def mock_tokenizer_from_pretrained(*args, **kwargs):
    return MockTokenizer()

# Monkey patch
__import__('transformers').AutoModelForSeq2SeqLM.from_pretrained = mock_from_pretrained_seq2seq
__import__('transformers').AutoModelForSequenceClassification.from_pretrained = mock_from_pretrained_classification
__import__('transformers').AutoConfig.from_pretrained = mock_config_from_pretrained
__import__('transformers').AutoTokenizer.from_pretrained = mock_tokenizer_from_pretrained

ARGS = {
    'model_name': 'roberta-large',
    'max_model_len': 512,
    'batch_size': 2,
    'cache_dir': None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
nltk, numpy, torch, tqdm, transformers, vllm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MiniCheck — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MiniCheck output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_permutations_of_facts Ran
ran; our contract draft was wrong, not the code
liyan06/minicheck/synthetic_data_gen/D2C_gen.py
code served (permissive licence) · get_code("b8617b4254aed28c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from itertools import permutations

# The function expects a list of facts (strings or objects that can be converted to strings)
facts = [
    "The cat is on the mat",
    "The dog is in the house",
    "It is raining outside"
]

ARGS = {
    "facts": facts
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
Inferencer Not yet run
unverified (harvested, no recorded run)
Liyan06/MiniCheck/minicheck/minicheck.py
code served (permissive licence) · get_code("73b4776d89175db5")
How it ran

no invocation recorded.

LLMCheck Not yet run
unverified (harvested, no recorded run)
Liyan06/MiniCheck/minicheck/minicheck.py
code served (permissive licence) · get_code("81822f43aa62fd5c")
How it ran

no invocation recorded.

construct_removed_sent_dict_wrapper Not yet run
unverified (harvested, no recorded run)
liyan06/minicheck/synthetic_data_gen/C2D_gen.py
code served (permissive licence) · get_code("166f1ad6d53d618d")
How it ran

no invocation recorded.

get_response_for_all_chunks Not yet run
unverified (harvested, no recorded run)
liyan06/minicheck/synthetic_data_gen/D2C_gen.py
code served (permissive licence) · get_code("06201cbb8367e9c9")
How it ran

no invocation recorded.

sent_tokenize_with_newlines Not yet run
unverified (harvested, no recorded run)
Liyan06/MiniCheck/minicheck/minicheck.py
code served (permissive licence) · get_code("d3facd3508b51062")
How it ran

no invocation recorded.

split_into_chunks Not yet run
unverified (harvested, no recorded run)
liyan06/minicheck/synthetic_data_gen/D2C_gen.py
code served (permissive licence) · get_code("4cb70b41a391c83d")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 8 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Recognizing if LLM output can be grounded in evidence is central to many tasks in NLP: retrieval-augmented generation, summarization, document-grounded dialogue, and more. Current approaches to this kind of factchecking are based on verifying each piece of a model generation against potential evidence using an LLM. However, this process can be very computationally expensive, requiring many calls to a model to check a single response. In this work, we show how to build small fact-checking models that have GPT-4level performance but for 400x lower cost. We do this by constructing synthetic training data with GPT-4, which involves creating realistic yet challenging instances of factual errors via a structured generation procedure. Training on this data teaches models to check each fact in the claim and recognize synthesis of information across sentences. For evaluation, we unify datasets from recent work on factchecking and grounding LLM generations into a new benchmark, LLM-AGGREFACT. Our best system MiniCheck-FT5 (770M parameters) outperforms all systems of comparable size and reaches GPT-4 accuracy. We release LLM-AGGREFACT, code for data synthesis, and models. 1 Chunk Chunk 2 Abla#on 1 Chunk 2 Abla#on 2 Chunk 1 Chunk 2 Chunk 3 Chunk 2 Abl. 1 Chunk 2 Abl. 2

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2404.10774")
get_code_for_paper("2404.10774")
have("2404.10774")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2404.10774.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2404.10774.svg)](https://syntology.ai/paper/2404.10774)

Connect an agent — have() is free.