SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2306.11386 · ACL · 2023

Did the Models Understand Documents? Benchmarking Models for Language Understanding in Document-Level Relation Extraction

Xiangdong Zhou, Haotian Chen, Bingsheng Chen

arXiv · PDF · Open in the Atlas

Code that ran

4 of 4 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 3 have no contract verdict; 1 failure of our instrument; 0 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/2306.11386.json · badge: /api/ran/2306.11386.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
Hytn/DocRED-HWE canonical (classifier label)
classifier basis: census
4 ran · 0 no recorded run
FunctionStatusWhere it lives
attack_ratio Ran
ran on a synthesized input
Hytn/DocRED-HWE/run_utils.py
code served (permissive licence) · get_code("67b0460df210fa28")
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 tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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

torch.manual_seed(0)

# Construct ori_features: a list of dicts, each with a 'title' key
ori_features = [
    {'title': 'feature_1', 'data': 0.5},
    {'title': 'feature_2', 'data': 0.7},
    {'title': 'feature_3', 'data': 0.3},
    {'title': 'feature_4', 'data': 0.9},
]

# Construct ori_key_res: dict mapping titles to lists of values
ori_key_res = {
    'feature_1': [1, 2, 3],
    'feature_2': [4, 5],
    'feature_3': [6, 7, 8, 9],
}

# Construct key_res: dict mapping titles to lists of values
# Mix of overlapping and non-overlapping keys/values with ori_key_res
key_res = {
    'feature_1': [1, 10],  # overlaps with ori_key_res['feature_1']
    'feature_2': [11, 12],  # no overlap with ori_key_res['feature_2']
    'feature_4': [13, 14],  # feature_4 not in ori_key_res
}

ARGS = {
    'ori_key_res': ori_key_res,
    'key_res': key_res,
    'ori_features': ori_features,
}
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 tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
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
collate_fn Ran
ran on a synthesized input
Hytn/DocRED-HWE/utils.py
code served (permissive licence) · get_code("ccf74d358834c781")
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 tuple. 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

torch.manual_seed(0)

# Construct a batch of sample data
# Each item in the batch is a dict with 'input_ids', 'labels', 'entity_pos', 'hts'
batch = [
    {
        'input_ids': [101, 2054, 2003],
        'labels': [1, 0, 1],
        'entity_pos': [[0, 1], [2, 3]],
        'hts': [[0, 1], [1, 2]]
    },
    {
        'input_ids': [101, 2054],
        'labels': [0, 1],
        'entity_pos': [[0, 2]],
        'hts': [[0, 1]]
    }
]

ARGS = {
    'batch': batch
}
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 tuple — a tuple output has no array shape of its own; none is 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
process_long_input Ran
ran; our contract draft was wrong, not the code
Hytn/DocRED-HWE/utils.py
code served (permissive licence) · get_code("4ee612c0923a9c01")
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 tuple. 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

torch.manual_seed(0)

class MockModel(nn.Module):
    def __init__(self, hidden_size=4):
        super().__init__()
        self.hidden_size = hidden_size
        self.linear = nn.Linear(768, hidden_size)
    
    def forward(self, input_ids, attention_mask, output_attentions=False):
        batch_size = input_ids.size(0)
        seq_len = input_ids.size(1)
        
        sequence_output = torch.randn(batch_size, seq_len, self.hidden_size)
        attention_weights = torch.randn(batch_size, 12, seq_len, seq_len)
        attention_weights = torch.softmax(attention_weights, dim=-1)
        
        if output_attentions:
            return (sequence_output, None, None, attention_weights)
        return (sequence_output,)

model = MockModel(hidden_size=4)

batch_size = 2
seq_len = 128
hidden_size = 768

input_ids = torch.randint(0, 1000, (batch_size, seq_len))
attention_mask = torch.ones(batch_size, seq_len)
attention_mask[0, 100:] = 0
attention_mask[1, 110:] = 0

start_tokens = [101]
end_tokens = [102]

ARGS = {
    "model": model,
    "input_ids": input_ids,
    "attention_mask": attention_mask,
    "start_tokens": start_tokens,
    "end_tokens": end_tokens,
}
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 tuple — a tuple output has no array shape of its own; none is 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
sharpen Ran
ran on a synthesized input
Hytn/DocRED-HWE/MAP_metric.py
code served (permissive licence) · get_code("fabdd1c4c1560dd8")
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 2, dtype family float, shape (4, 3) 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

# Construct arguments for the sharpen function
# The function takes:
# - arr: a numpy array
# - T: a temperature parameter (scalar)

# Create a small 2D array with shape (4, 3)
# This represents some kind of probability or score distribution
arr = np.array([
    [0.5, 0.3, 0.2],
    [0.1, 0.6, 0.3],
    [0.4, 0.4, 0.2],
    [0.2, 0.3, 0.5]
], dtype=np.float32)

# Temperature parameter - a scalar that controls sharpening
# Lower T values make the distribution sharper
T = 0.5

ARGS = {
    "arr": arr,
    "T": T
}
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 2, dtype family float, shape (4, 3) — shape (4, 3) 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

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 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
process_long_input 3 other papers
1 dated earlier, 1 later, 1 same year, order not determinable
2023.findings-emnlp.253 (2023 (year only))
Adaptive Hinge Balance Loss for Document-Level Relation Extraction
2304.09048 (2023-04)
CodeKGC: Code Language Model for Generative Knowledge Graph Construction
2025.findings-acl.727 (2025 (year only))
GLiM: Integrating Graph Transformer and LLM for Document-Level Biomedical Relation Extraction with Incomplete Labeling

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

Document-level relation extraction (DocRE) attracts more research interest recently. While models achieve consistent performance gains in DocRE, their underlying decision rules are still understudied: Do they make the right predictions according to rationales? In this paper, we take the first step toward answering this question and then introduce a new perspective on comprehensively evaluating a model. Specifically, we first conduct annotations to provide the rationales considered by humans in DocRE. Then, we conduct investigations and reveal the fact that: In contrast to humans, the representative state-of-the-art (SOTA) models in DocRE exhibit different decision rules. Through our proposed RE-specific attacks, we next demonstrate that the significant discrepancy in decision rules between models and humans severely damages the robustness of models and renders them inapplicable to real-world RE scenarios. After that, we introduce mean average precision (MAP) to evaluate the understanding and reasoning capabilities of models. According to the extensive experimental results, we finally appeal to future work to consider evaluating both performance and the understanding ability of models for the development of their applications. We make our annotations and code publicly available 1 .

For agents

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

get_harvested_code_for_paper("2306.11386")
get_code_for_paper("2306.11386")
have("2306.11386")

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

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

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

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

Connect an agent — have() is free.