SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2104.14839 · 2021

The Factual Inconsistency Problem in Abstractive Text Summarization: A Survey

arXiv · PDF · Open in the Atlas

Code that ran

5 of 7 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 0 failures of our instrument; 2 no recorded run), measured 2026-11-22; 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/2104.14839.json · badge: /api/ran/2104.14839.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
huffon/factsumm community (classifier label)
classifier basis not recorded on the link
5 ran · 2 no recorded run
FunctionStatusWhere it lives
f1_score Ran
ran on a synthesized input
huffon/factsumm/factsumm/utils/utils.py
code served (permissive licence) · get_code("74f6c7af6784dc33")
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 float, ndim 0, dtype family float, 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 re
import string
from collections import Counter

def f1_score(gold_answer: str, pred_answer: str) -> float:
    """
    Calculate token-level F1 score

        See also https://github.com/W4ngatang/qags/blob/master/qa_utils.py#L43

    Args:
        gold_answer (str): answer selected based on source document
        pred_answer (str): answer selected based on generated summary

    """

    def _normalize_answer(text: str):

        def _remove_punc(text: str):
            exclude = set(string.punctuation)
            return ''.join((ch for ch in text if ch not in exclude))

        def _remove_articles(text: str):
            return re.sub('\\b(a|an|the)\\b', ' ', text)

        def _white_space_fix(text: str):
            return ' '.join(text.split())
        return _white_space_fix(_remove_articles(_remove_punc(text.lower())))
    gold_toks = _normalize_answer(gold_answer).split()
    pred_toks = _normalize_answer(pred_answer).split()
    common_toks = Counter(gold_toks) & Counter(pred_toks)
    num_same_toks = sum(common_toks.values())
    if gold_answer == '<unanswerable>' or pred_answer == '<unanswerable>':
        return int(gold_answer == pred_answer)
    if num_same_toks == 0:
        return 0.0
    precision = 1.0 * num_same_toks / len(pred_toks)
    recall = 1.0 * num_same_toks / len(gold_toks)
    f1 = 2 * precision * recall / (precision + recall)
    return f1


ARGS = {
    "gold_answer": "The quick brown fox jumps over the lazy dog",
    "pred_answer": "The quick brown fox jumps over a lazy dog"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, 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
load_qa Ran
ran on a synthesized input
huffon/factsumm/factsumm/utils/module_question.py
code served (permissive licence) · get_code("bf66eb9f81bbffce")
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 function. 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 logging
from typing import List

torch.manual_seed(0)

ARGS = {
    'model': 'deepset/roberta-base-squad2',
    'device': 'cpu'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
requests, torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
load_qg Ran
ran on a synthesized input
huffon/factsumm/factsumm/utils/module_question.py
code served (permissive licence) · get_code("d01c369c00b0e2a4")
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 function. 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 logging

# Mock tokenizer class that satisfies the interface used in load_qg
class MockTokenizer:
    def __call__(self, text, padding=None, max_length=None, truncation=None, return_tensors=None):
        # Return a dict with 'input_ids' and 'attention_mask' as tensors
        return {
            'input_ids': torch.tensor([[101, 2054, 2003, 102]], dtype=torch.long),
            'attention_mask': torch.tensor([[1, 1, 1, 1]], dtype=torch.long)
        }
    
    def decode(self, token_ids):
        # Simple mock decode that returns a string with expected format
        return '</s><pad> question: What is this? </s>'

# Mock model class that satisfies the interface used in load_qg
class MockSeq2SeqModel(torch.nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = torch.nn.Linear(4, 4)
    
    def to(self, device):
        # Return self to allow chaining
        return self
    
    def generate(self, input_ids, attention_mask, max_length=None):
        # Return mock token ids
        return torch.tensor([[101, 2054, 2003, 102]], dtype=torch.long)

# Set seed for reproducibility
torch.manual_seed(0)

ARGS = {
    'model': 'mock-model-name',
    'device': 'cpu'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
requests, torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
load_rel Ran
ran on a synthesized input
huffon/factsumm/factsumm/utils/module_entity.py
code served (permissive licence) · get_code("f998e8bf879a2c1e")
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 function. 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 torch.nn as nn
from typing import Dict, Any

torch.manual_seed(0)

# Create a mock tokenizer that matches LukeTokenizer's interface
class MockLukeTokenizer:
    def __call__(self, text: str, entity_spans: list, return_tensors: str = None):
        # Return a dict with tensors that the model expects
        return {
            'input_ids': torch.randint(0, 100, (1, 8)),
            'attention_mask': torch.ones(1, 8),
            'entity_span_ids': torch.zeros((1, 2), dtype=torch.long),
        }

# Create a mock model that matches LukeForEntityPairClassification interface
class MockLukeModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(8, 5)  # 5 relation classes
        self.config = type('Config', (), {
            'id2label': {0: 'no_relation', 1: 'relation_a', 2: 'relation_b', 3: 'relation_c', 4: 'relation_d'}
        })()
    
    def forward(self, input_ids, attention_mask, entity_span_ids):
        # Return outputs with logits attribute
        logits = self.linear(input_ids.float().mean(dim=1, keepdim=True).expand(-1, 8))
        return type('Output', (), {'logits': logits})()
    
    def to(self, device):
        return super().to(device)

# Mock the from_pretrained methods
original_luke_tokenizer_from_pretrained = None
original_luke_model_from_pretrained = None

def mock_tokenizer_from_pretrained(model_name):
    return MockLukeTokenizer()

def mock_model_from_pretrained(model_name):
    return MockLukeModel()

# Patch the transformers module functions
import transformers
transformers.LukeTokenizer.from_pretrained = staticmethod(mock_tokenizer_from_pretrained)
transformers.LukeForEntityPairClassification.from_pretrained = staticmethod(mock_model_from_pretrained)

ARGS = {
    'model': 'luke-base',
    'device': 'cpu',
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
requests, torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
score_qags Ran
ran on a synthesized input
huffon/factsumm/factsumm/utils/utils.py
code served (permissive licence) · get_code("96fd3bec20261001")
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 float, ndim 0, dtype family float, 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 re
import string
from collections import Counter
from typing import List

torch_seed = 0

# Create minimal valid arguments for score_qags
# The function expects:
# - source_answers: List of dicts with 'prediction' key containing answer strings
# - summary_answers: List of dicts with 'prediction' key containing answer strings

source_answers = [
    {'prediction': 'The capital of France is Paris'},
    {'prediction': 'Machine learning is a subset of artificial intelligence'},
    {'prediction': 'Python is a programming language'}
]

summary_answers = [
    {'prediction': 'Paris is the capital of France'},
    {'prediction': 'Machine learning is part of artificial intelligence'},
    {'prediction': 'Python is a language for programming'}
]

ARGS = {
    'source_answers': source_answers,
    'summary_answers': summary_answers
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, 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
load_ner Not yet run
unverified (harvested, no recorded run)
huffon/factsumm/factsumm/utils/module_entity.py
code served (permissive licence) · get_code("912017c3d64cbbff")
How it ran

no invocation recorded.

load_summarizer Not yet run
unverified (harvested, no recorded run)
huffon/factsumm/factsumm/utils/utils.py
code served (permissive licence) · get_code("dc931cb63623808d")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 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 7 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-22.

Repositories linked to this paper

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

Abstract

Recently, various neural encoder-decoder models pioneered by Seq2Seq framework have been proposed to achieve the goal of generating more abstractive summaries by learning to map input text to output text. At a high level, such neural models can freely generate summaries without any constraint on the words or phrases used. Moreover, their format is closer to human-edited summaries and output is more readable and fluent. However, the neural model's abstraction ability is a double-edged sword. A commonly observed problem with the generated summaries is the distortion or fabrication of factual information in the article. This inconsistency between the original text and the summary has caused various concerns over its applicability, and the previous evaluation methods of text summarization are not suitable for this issue. In response to the above problems, the current research direction is predominantly divided into two categories, one is to design fact-aware evaluation metrics to select outputs without factual inconsistency errors, and the other is to develop new summarization systems towards factual consistency. In this survey, we focus on presenting a comprehensive review of these fact-specific evaluation methods and text summarization models.

For agents

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

get_harvested_code_for_paper("2104.14839")
get_code_for_paper("2104.14839")
have("2104.14839")

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

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

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

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

Connect an agent — have() is free.