SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2311.05419 · EMNLP · 2023

Mirror: A Universal Framework for Various Information Extraction Tasks

Min Zhang, Xiaoye Qu, Zhefeng Wang, Mengsong Wu, Baoxing Huai, Wenliang Chen, Tong Zhu, Junfei Ren, ♡ Zijian, Guoliang Zhang

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 0 have no contract verdict; 4 failures of our instrument; 0 no recorded run), measured 2026-11-23; 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/2311.05419.json · badge: /api/ran/2311.05419.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
Spico197/Mirror canonical (classifier label)
classifier basis: census
4 ran · 0 no recorded run
FunctionStatusWhere it lives
decode_nnw_thw_mat Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Spico197/Mirror/src/utils.py
code served (permissive licence) · get_code("49942e541948a84c")
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 list. 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
from collections import defaultdict

torch.manual_seed(0)

# Create a small batch matrix for testing
# Shape: (batch_size=2, cls_num=2, seq_len=4, seq_len=4)
# This represents 2 instances, each with 2 classes (nnw and thw), and 4x4 adjacency matrices

# For instance 0: create a simple adjacency pattern
# nnw_mat (index 0): nodes 0->1->2, with self-loop at 2
nnw_mat_0 = torch.zeros(4, 4, dtype=torch.long)
nnw_mat_0[0, 1] = 1  # 0 -> 1
nnw_mat_0[1, 2] = 1  # 1 -> 2
nnw_mat_0[2, 2] = 1  # self-loop at 2

# thw_mat (index 1): connections from end to start
thw_mat_0 = torch.zeros(4, 4, dtype=torch.long)
thw_mat_0[2, 0] = 1  # end node 2, start node 0

# Stack into instance 0
instance_0 = torch.stack([nnw_mat_0, thw_mat_0], dim=0)

# For instance 1: simpler pattern
# nnw_mat: nodes 1->3
nnw_mat_1 = torch.zeros(4, 4, dtype=torch.long)
nnw_mat_1[1, 3] = 1  # 1 -> 3
nnw_mat_1[3, 3] = 1  # self-loop at 3

# thw_mat: connection from 3 to 1
thw_mat_1 = torch.zeros(4, 4, dtype=torch.long)
thw_mat_1[3, 1] = 1  # end node 3, start node 1

# Stack into instance 1
instance_1 = torch.stack([nnw_mat_1, thw_mat_1], dim=0)

# Batch both instances
batch_mat = torch.stack([instance_0, instance_1], dim=0)

# Define offsets for each instance
offsets = [0, 5]

ARGS = {
    "batch_mat": batch_mat,
    "nnw_id": 0,
    "thw_id": 1,
    "offsets": offsets,
}
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 list — a list 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
find_paths_from_adj_mat Ran
ran; our contract draft was wrong, not the code
Spico197/Mirror/src/utils.py
code served (permissive licence) · get_code("f21a8d4442498c31")
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 list. 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)

# Create a small adjacency matrix
# The function expects a square 2D tensor
# Let's create a 4x4 adjacency matrix with some edges and a self-loop
adj_mat = torch.zeros(4, 4, dtype=torch.float32)

# Add some edges: 0->1, 1->2, 2->3, 0->2
adj_mat[0, 1] = 1
adj_mat[1, 2] = 1
adj_mat[2, 3] = 1
adj_mat[0, 2] = 1

# Add a self-loop at node 3
adj_mat[3, 3] = 1

ARGS = {
    "adj_mat": adj_mat
}
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 list — a list 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
multilabel_categorical_crossentropy Ran
ran; our contract draft was wrong, not the code
Spico197/Mirror/src/model.py
code served (permissive licence) · get_code("d612fab4384dbec0")
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 Tensor, ndim 1, dtype family float, shape (2,) 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

torch.manual_seed(0)

# Create small tensors for multilabel classification
batch_size = 2
num_classes = 4

# y_pred: predicted logits, shape (batch_size, num_classes)
y_pred = torch.randn(batch_size, num_classes)

# y_true: binary labels, shape (batch_size, num_classes)
y_true = torch.randint(0, 2, (batch_size, num_classes)).float()

# bit_mask: optional mask, left as None for the default case
bit_mask = None

ARGS = {
    "y_pred": y_pred,
    "y_true": y_true,
    "bit_mask": bit_mask,
}
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 Tensor, ndim 1, dtype family float, shape (2,) — shape (2,) 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
parse_args Ran
ran; our contract draft was wrong, not the code
Spico197/Mirror/src/wait.py
code served (permissive licence) · get_code("5f7018b28cf3c813")
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 Namespace. 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 argparse

ARGS = {
    'in_args': [
        '--task_name', 'my_task',
        '--cuda', 'cuda:0',
        '--req_gpu_num', '2',
        '--wait', 'schedule'
    ]
}
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 Namespace — a Namespace output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Namespace 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

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, 0 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
parse_args 1 other paper
1 dated earlier
ijcai2022_0632 (2022 (year only))
Efficient Document-level Event Extraction via Pseudo-Trigger-aware Pruned Complete Graph

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

Sharing knowledge between information extraction tasks has always been a challenge due to the diverse data formats and task variations. Meanwhile, this divergence leads to information waste and increases difficulties in building complex applications in real scenarios. Recent studies often formulate IE tasks as a triplet extraction problem. However, such a paradigm does not support multi-span and nary extraction, leading to weak versatility. To this end, we reorganize IE problems into unified multi-slot tuples and propose a universal framework for various IE tasks, namely Mirror. Specifically, we recast existing IE tasks as a multi-span cyclic graph extraction problem and devise a non-autoregressive graph decoding algorithm to extract all spans in a single step. It is worth noting that this graph structure is incredibly versatile, and it supports not only complex IE tasks, but also machine reading comprehension and classification tasks. We manually construct a corpus containing 57 datasets for model pretraining, and conduct experiments on 30 datasets across 8 downstream tasks. The experimental results demonstrate that our model has decent compatibility and outperforms or reaches competitive performance with SOTA systems under fewshot and zero-shot settings. The code, model weights, and pretraining corpus are available at https://github.com/Spico197/Mirror . * Corresponding author Relation Extraction ADR muscle fatigue pain CEO of Tim Cook Apple Discontinuous NER [(ADR, muscle pain), (ADR, muscle fatigue)] [(Tim Cook, CEO of, Apple)]

For agents

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

get_harvested_code_for_paper("2311.05419")
get_code_for_paper("2311.05419")
have("2311.05419")

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

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

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

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

Connect an agent — have() is free.