SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.14251 · EMNLP · 2023

FACTSCORE: Fine-grained Atomic Evaluation of Factual Precision in Long Form Text Generation

Luke Zettlemoyer, Hannaneh Hajishirzi, Sewon Min, Kalpesh Krishna, Mohit Iyyer, Xinxi Lyu, Wen-tau Yih, Pang Wei Koh, M. Lewis

arXiv · PDF · Open in the Atlas

Code that ran

11 of 15 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; 1 honoured the contract we drafted, 3 violated it and 1 has no contract verdict; 6 failures of our instrument; 4 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/2305.14251.json · badge: /api/ran/2305.14251.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
shmsw25/factscore canonical (classifier label)
classifier basis: census
10 ran · 2 no recorded run
tatsu-lab/linguistic_calibration community
Papers with Code archive
1 ran · 2 no recorded run
FunctionStatusWhere it lives
Retrieval Ran
ran on a synthesized input · constructed an object; no result was computed
tatsu-lab/linguistic_calibration/src/linguistic_calibration/auto_annotations/factscore_retrieval_utils.py
code served (permissive licence) · get_code("7ad7a356ddeef1cb")
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, Retrieval: 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 json
import numpy as np
import os
import pickle as pkl
import tempfile

class MockDB:
    def get_text_from_title(self, topic):
        # Return a list of passage dicts with 'title' and 'text' keys
        return [
            {'title': 'passage1', 'text': 'content one'},
            {'title': 'passage2', 'text': 'content two'},
            {'title': 'passage3', 'text': 'content three'},
        ]

# Create temporary directories for cache files
temp_dir = tempfile.mkdtemp()
cache_path = os.path.join(temp_dir, 'cache.json')
embed_cache_path = os.path.join(temp_dir, 'embed_cache.pkl')

# Initialize empty cache files
with open(cache_path, 'w') as f:
    json.dump({}, f)

with open(embed_cache_path, 'wb') as f:
    pkl.dump({}, f)

db = MockDB()

ARGS = {
    'db': db,
    'cache_path': cache_path,
    'embed_cache_path': embed_cache_path,
    'retrieval_type': 'bm25',
    'batch_size': 32,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sentence_transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Retrieval — 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 Retrieval 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
best_demos Ran
ran; our contract draft was wrong, not the code
shmsw25/factscore/factscore/atomic_facts.py
pointer only (licence: MIT); the stored copy get_code serves, from dmis-lab/olaph, is pointer only (licence: NONE) · get_code("510528f4db1006bc")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from dmis-lab/olaph, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

call_ChatGPT Ran
ran; our contract draft was wrong, not the code
shmsw25/factscore/factscore/openai_lm.py
code served (permissive licence) · get_code("6c0eab0d68ea3036")
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 openai
import sys
import time
import numpy as np
import logging

# Mock the openai module to avoid actual API calls
class MockChatCompletion:
    @staticmethod
    def create(model, messages, max_tokens, temperature):
        return {
            "id": "chatcmpl-123",
            "object": "chat.completion",
            "created": 1234567890,
            "model": model,
            "choices": [
                {
                    "index": 0,
                    "message": {
                        "role": "assistant",
                        "content": "This is a mock response."
                    },
                    "finish_reason": "stop"
                }
            ],
            "usage": {
                "prompt_tokens": 10,
                "completion_tokens": 20,
                "total_tokens": 30
            }
        }

openai.ChatCompletion = MockChatCompletion

# Set up logging
logging.basicConfig(level=logging.INFO)

# Define valid arguments for call_ChatGPT
ARGS = {
    'message': [
        {
            'role': 'user',
            'content': 'What is the capital of France?'
        }
    ],
    'model_name': 'gpt-3.5-turbo',
    'max_len': 1024,
    'temp': 0.7,
    'verbose': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, openai — 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
call_GPT3 Ran
ran; our contract draft was wrong, not the code
shmsw25/factscore/factscore/openai_lm.py
code served (permissive licence) · get_code("e5bb87d92ea99a8b")
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 openai
import sys
import time
import numpy as np
import logging

# Mock the openai module since we can't make real API calls
class MockCompletion:
    @staticmethod
    def create(model, prompt, max_tokens, temperature, logprobs, echo):
        return {
            'id': 'mock-id',
            'object': 'text_completion',
            'created': 1234567890,
            'model': model,
            'choices': [
                {
                    'text': 'This is a mock response.',
                    'index': 0,
                    'logprobs': None,
                    'finish_reason': 'length'
                }
            ],
            'usage': {
                'prompt_tokens': 10,
                'completion_tokens': 5,
                'total_tokens': 15
            }
        }

class MockError(Exception):
    pass

class MockInvalidRequestError(MockError):
    pass

# Patch openai module
openai.Completion = MockCompletion
openai.error = type('error', (), {'InvalidRequestError': MockInvalidRequestError})()

ARGS = {
    'prompt': 'What is the capital of France?',
    'model_name': 'text-davinci-003',
    'max_len': 512,
    'temp': 0.7,
    'num_log_probs': 0,
    'echo': False,
    'verbose': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, openai — 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
get_memory_footprint Ran
ran, honoured the contract we drafted
shmsw25/factscore/factscore/utils.py
code served (permissive licence) · get_code("f06c53e363e1ebaa")
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 int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        # Add parameters
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
        # Add buffers (non-parameter tensors)
        self.register_buffer('running_mean', torch.randn(3))
        self.register_buffer('running_var', torch.randn(3))
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        return x

model = SimpleModel()

ARGS = {
    'model': model,
    'return_buffers': True,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
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
is_invalid_paragraph_ppl Ran
ran, violated the contract we drafted
shmsw25/factscore/factscore/abstain_detection.py
pointer only (licence: MIT); the stored copy get_code serves, from dmis-lab/olaph, is pointer only (licence: NONE) · get_code("8eb846a8e76a79b8")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from dmis-lab/olaph, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

is_invalid_ppl Ran
ran, violated the contract we drafted
shmsw25/factscore/factscore/abstain_detection.py
pointer only (licence: MIT); the stored copy get_code serves, from dmis-lab/olaph, is pointer only (licence: NONE) · get_code("672bd38d830be48d")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from dmis-lab/olaph, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

normalize_answer Ran
ran; our contract draft was wrong, not the code
shmsw25/factscore/factscore/atomic_facts.py
pointer only (licence: MIT); the stored copy get_code serves, from saptarshi059/cdqa-project, is pointer only (licence: NONE) · get_code("6a96435eba311b08")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from saptarshi059/cdqa-project, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

remove_citation Ran
ran; our contract draft was wrong, not the code
shmsw25/factscore/factscore/abstain_detection.py
pointer only (licence: MIT); the stored copy get_code serves, from rhyang2021/logu, is pointer only (licence: NONE) · get_code("3635046105ae0fce")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from rhyang2021/logu, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

softmax Ran
ran, violated the contract we drafted
shmsw25/factscore/factscore/npm.py
code served (permissive licence) · get_code("925c59b7e44138ab")
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 ndarray, ndim 1, dtype family float, shape (4,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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 numpy as np

# The softmax function takes a single parameter 'x' which should be a numpy array
# The function computes exp(x - max(x)) / sum(exp(x - max(x)))
# So x needs to be a 1D or 2D numpy array of numeric values

x = np.array([1.0, 2.0, 3.0, 4.0])

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (4,) — shape (4,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
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
text_to_sentences Ran
ran; our contract draft was wrong, not the code
shmsw25/factscore/factscore/atomic_facts.py
pointer only (licence: MIT); the stored copy get_code serves, from dmis-lab/olaph, is pointer only (licence: NONE) · get_code("13867f872a481bd3")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from dmis-lab/olaph, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

DocDB Not yet run
unverified (harvested, no recorded run)
tatsu-lab/linguistic_calibration/src/linguistic_calibration/auto_annotations/factscore_retrieval_utils.py
code served (permissive licence) · get_code("c4456232ee580c04")
How it ran

no invocation recorded.

FactScorer Not yet run
unverified (harvested, no recorded run)
tatsu-lab/linguistic_calibration/src/linguistic_calibration/auto_annotations/factscore_retrieval_utils.py
code served (permissive licence) · get_code("d14a268e400630cf")
How it ran

no invocation recorded.

convert_model_to_int8_on_gpu Not yet run
unverified (harvested, no recorded run)
shmsw25/factscore/factscore/utils.py
code served (permissive licence) · get_code("7e4c366c4dbf9568")
How it ran

no invocation recorded.

recover_instruct_llama Not yet run
unverified (harvested, no recorded run)
shmsw25/factscore/factscore/download_data.py
code served (permissive licence) · get_code("02c83d89394be1c7")
How it ran

no invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 15 distinct functions with an identity, 12 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 1 the same month, 12 later) and 3 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.

FunctionAlso present inEarliest-datedOthers named
normalize_answer 37 other papers
17 dated earlier, 1 the same month, 18 later, 1 same year, order not determinable · 1 only as an assembly brick
1808.07042 (2018-08)
CoQA: A Conversational Question Answering Challenge
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1902.01718 (2019-02)
End-to-End Open-Domain Question Answering with BERTserini
and 34 more not named here
is_invalid_paragraph_ppl 6 other papers
6 later
2402.12659 (2024-02)
FinBen: A Holistic Financial Benchmark for Large Language Models
2402.18045 (2024-02)
Multi-FAct: Assessing Factuality of Multilingual LLMs using FActScore
2403.03823 (2024-03)
A Modular Approach for Multimodal Summarization of TV Shows
and 3 more not named here
is_invalid_ppl 6 other papers
6 later
2402.12659 (2024-02)
FinBen: A Holistic Financial Benchmark for Large Language Models
2402.18045 (2024-02)
Multi-FAct: Assessing Factuality of Multilingual LLMs using FActScore
2403.03823 (2024-03)
A Modular Approach for Multimodal Summarization of TV Shows
and 3 more not named here
remove_citation 6 other papers
6 later
2402.12659 (2024-02)
FinBen: A Holistic Financial Benchmark for Large Language Models
2402.18045 (2024-02)
Multi-FAct: Assessing Factuality of Multilingual LLMs using FActScore
2403.03823 (2024-03)
A Modular Approach for Multimodal Summarization of TV Shows
and 3 more not named here
best_demos 5 other papers
5 later
2402.12659 (2024-02)
FinBen: A Holistic Financial Benchmark for Large Language Models
2402.18045 (2024-02)
Multi-FAct: Assessing Factuality of Multilingual LLMs using FActScore
2403.03823 (2024-03)
A Modular Approach for Multimodal Summarization of TV Shows
and 2 more not named here
text_to_sentences 5 other papers
5 later
2402.12659 (2024-02)
FinBen: A Holistic Financial Benchmark for Large Language Models
2402.18045 (2024-02)
Multi-FAct: Assessing Factuality of Multilingual LLMs using FActScore
2403.03823 (2024-03)
A Modular Approach for Multimodal Summarization of TV Shows
and 2 more not named here
recover_instruct_llama 4 other papers
4 later
2402.12659 (2024-02)
FinBen: A Holistic Financial Benchmark for Large Language Models
2402.18045 (2024-02)
Multi-FAct: Assessing Factuality of Multilingual LLMs using FActScore
2403.03823 (2024-03)
A Modular Approach for Multimodal Summarization of TV Shows
and 1 more not named here
convert_model_to_int8_on_gpu 3 other papers
1 dated earlier, 2 later
2212.10511 (2022-12)
When Not to Trust Language Models: Investigating Effectiveness of Parametric and Non-Parametric Memories
2402.18045 (2024-02)
Multi-FAct: Assessing Factuality of Multilingual LLMs using FActScore
2403.03823 (2024-03)
A Modular Approach for Multimodal Summarization of TV Shows
get_memory_footprint 3 other papers
1 dated earlier, 2 later
2212.10511 (2022-12)
When Not to Trust Language Models: Investigating Effectiveness of Parametric and Non-Parametric Memories
2402.18045 (2024-02)
Multi-FAct: Assessing Factuality of Multilingual LLMs using FActScore
2403.03823 (2024-03)
A Modular Approach for Multimodal Summarization of TV Shows
softmax 3 other papers
3 later
2402.12659 (2024-02)
FinBen: A Holistic Financial Benchmark for Large Language Models
2402.18045 (2024-02)
Multi-FAct: Assessing Factuality of Multilingual LLMs using FActScore
2403.03823 (2024-03)
A Modular Approach for Multimodal Summarization of TV Shows
call_ChatGPT 2 other papers
2 later
2402.18045 (2024-02)
Multi-FAct: Assessing Factuality of Multilingual LLMs using FActScore
2403.03823 (2024-03)
A Modular Approach for Multimodal Summarization of TV Shows
call_GPT3 1 other paper
1 later
2403.03823 (2024-03)
A Modular Approach for Multimodal Summarization of TV Shows

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

Evaluating the factuality of long-form text generated by large language models (LMs) is nontrivial because (1) generations often contain a mixture of supported and unsupported pieces of information, making binary judgments of quality inadequate, and (2) human evaluation is time-consuming and costly. In this paper, we introduce FACTSCORE, a new evaluation that breaks a generation into a series of atomic facts and computes the percentage of atomic facts supported by a reliable knowledge source. We conduct an extensive human evaluation to obtain FACTSCOREs of people biographies generated by several state-of-the-art commercial LMs-InstructGPT, ChatGPT, and the retrievalaugmented PerplexityAI-and report new analysis demonstrating the need for such a finegrained score (e.g., ChatGPT only achieves 58%). Since human evaluation is costly, we also introduce an automated model that estimates FACTSCORE using retrieval and a strong language model, with less than a 2% error rate. Finally, we use this automated metric to evaluate 6,500 generations from a new set of 13 recent LMs that would have cost $26K if evaluated by humans, with various findings: GPT-4 and ChatGPT are more factual than public models, and Vicuna and Alpaca are some of the best public models. FACTSCORE is available for public use via pip install factscore. 1 † Core contributors. 1 Source code and guidelines are available at https:// github.com/shmsw25/FActScore. -Bridget Moynahan is American. -Bridget Moynahan is an actress. -Bridget Moynahan is a model. -Bridget Moynahan is a producer. -She is best known for her roles in Grey's Anatomy. -She is best known for her roles in I, Robot. -She is best known for her roles in Blue Bloods. -She studied acting. -She studied at the American Academy of Dramatic Arts. -… Tell me a bio of Bridget Moynahan. Bridget Moynahan is an American actress, model and producer. She is best known for her roles in Grey's Anatomy, I, Robot and Blue Bloods. She studied acting at the American Academy of Dramatic Arts, and … Bridget Moynahan is an American filmmaker and writer. She is best known for her work on the soap opera General Hospital, which she co-created with husband Charles Kelly. Moynahan was raised in a middle-class family in Los Angeles, … -Bridget Moynahan is American. -Bridget Moynahan is a filmmaker. -Bridget Moynahan is a writer. -She is best known for her work on General Hospital. -General Hospital is the soap opera. -She co-created General Hospital. -She co-created General Hospital with her husband. -Her husband is Charles Kelly. -Moynahan was raised in a middle-class family. -Moynahan was raised in Los Angeles. -… Stable LM

For agents

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

get_harvested_code_for_paper("2305.14251")
get_code_for_paper("2305.14251")
have("2305.14251")

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

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

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

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

Connect an agent — have() is free.