SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2203.16618 · 2022

End-to-end Document Recognition and Understanding with Dessurt

arXiv · PDF · Open in the Atlas

Code that ran

11 of 11 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 10 have no contract verdict; 1 failure of our instrument; 0 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/2203.16618.json · badge: /api/ran/2203.16618.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
herobd/dessurt canonical (classifier label)
classifier basis not recorded on the link
11 ran · 0 no recorded run
FunctionStatusWhere it lives
addPair Ran
ran on a synthesized input
herobd/dessurt/gpt_forms.py
code served (permissive licence) · get_code("878f53e85ae3fbfd")
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 bool, 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 torch

torch.manual_seed(0)

# Construct arguments for addPair function
q = "question1"
a = "answer1"
pairs = []
seen_pairs = set()
seen_qs = []
seen_as = []

ARGS = {
    "q": q,
    "a": a,
    "pairs": pairs,
    "seen_pairs": seen_pairs,
    "seen_qs": seen_qs,
    "seen_as": seen_as
}
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 bool, 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
attention Ran
ran on a synthesized input
herobd/dessurt/model/attention.py
code served (permissive licence) · get_code("89ca2234fcb6c0d7")
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 math
import torch
import torch.nn as nn
import torch.nn.functional as F

torch.manual_seed(0)

# Define a simple dropout module
dropout_module = nn.Dropout(p=0.1)

# Create small tensors with distinct dimensions
batch_size = 2
seq_len_query = 3
seq_len_key = 4
d_k = 5

query = torch.randn(batch_size, seq_len_query, d_k)
key = torch.randn(batch_size, seq_len_key, d_k)
value = torch.randn(batch_size, seq_len_key, d_k)

# Create mask tensor (1s where we attend, 0s where we don't)
mask = torch.ones(batch_size, 1, seq_len_query, seq_len_key)

# Create key padding mask (True where padding, False elsewhere)
key_padding_mask = torch.zeros(batch_size, seq_len_key, dtype=torch.bool)
key_padding_mask[0, -1] = True  # Mark last position of first batch as padding

# Create attention bias
att_bias = torch.randn(batch_size, seq_len_query, seq_len_key)

ARGS = {
    "query": query,
    "key": key,
    "value": value,
    "mask": mask,
    "key_padding_mask": key_padding_mask,
    "dropout": dropout_module,
    "fixed": False,
    "att_bias": att_bias,
}
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
clones Ran
ran; our contract draft was wrong, not the code
herobd/dessurt/model/attention.py
code served (permissive licence) · get_code("14af88ba47b4b98a")
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 ModuleList. 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
import math
import copy

torch.manual_seed(0)

# Create a simple module to clone
simple_module = nn.Linear(4, 3)

# Define the arguments dictionary
ARGS = {
    "module": simple_module,
    "N": 5
}
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 ModuleList — a ModuleList output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ModuleList output the recorded ndim 1 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
findNonEscaped Ran
ran on a synthesized input
herobd/dessurt/funsd_eval_json.py
code served (permissive licence) · get_code("0ba1f51d68df0e77")
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

# Analyze the function: findNonEscaped(s, target)
# - s: a string to search in
# - target: a substring to find
# The function searches for 'target' in 's', but skips over escaped occurrences
# (preceded by backslash). It returns the position of the first non-escaped occurrence.

# Test case 1: Simple string with target not escaped
s1 = "hello world"
target1 = "world"

# Test case 2: String with escaped target
s2 = "hello\\nworld"
target2 = "n"

# Test case 3: String where target appears but is escaped
s3 = "test\\:value"
target3 = ":"

ARGS = {
    "s": "hello world",
    "target": "world"
}
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
getScore Ran
ran on a synthesized input
herobd/dessurt/get_GAnTED_for_Dessurt.py
code served (permissive licence) · get_code("0b062bbeed5dd70a")
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, 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 torch.nn as nn

torch.manual_seed(0)

# Create a minimal scorer function that takes pred and gt and returns a score
def scorer(pred, gt):
    return float(torch.sum(pred - gt))

# Create a minimal table class with set_row_major method
class Table:
    def __init__(self):
        self.row_major = True
    
    def set_row_major(self, value):
        self.row_major = value

# Create sample tensors for pred and gt
pred = torch.randn(2, 4)
gt = torch.randn(2, 4)

# Create a list of tables for testing recursive calls
tables = [Table(), Table(), Table()]

ARGS = {
    "scorer": scorer,
    "pred": pred,
    "gt": gt,
    "tables": tables
}
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, ndim 1, dtype family float — a list 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
learned_attention Ran
ran on a synthesized input
herobd/dessurt/model/attention.py
code served (permissive licence) · get_code("829347111c022cc9")
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
import torch.nn.functional as F

torch.manual_seed(0)

# Query, key, value tensors
# Shape: (batch_size, heads, seq_len, d_model)
batch_size = 2
heads = 3
query_seq_len = 4
key_seq_len = 5
d_model = 6

query = torch.randn(batch_size, heads, query_seq_len, d_model)
key = torch.randn(batch_size, heads, key_seq_len, d_model)
value = torch.randn(batch_size, heads, key_seq_len, d_model)

# Mask: shape (batch_size, heads, query_seq_len, key_seq_len) with 1s and 0s
mask = torch.ones(batch_size, heads, query_seq_len, key_seq_len)

# Dropout layer
dropout = nn.Dropout(p=0.1)

# Network that processes concatenated query-key pairs
# Input shape after reshaping: (batch_size * heads, query_seq_len * key_seq_len, d_model * 2)
# Output shape: (batch_size * heads, query_seq_len * key_seq_len, 1)
class AttentionNetwork(nn.Module):
    def __init__(self, input_dim, output_dim=1):
        super().__init__()
        self.fc = nn.Linear(input_dim, output_dim)
    
    def forward(self, x):
        return self.fc(x)

network = AttentionNetwork(input_dim=d_model * 2, output_dim=1)

ARGS = {
    'query': query,
    'key': key,
    'value': value,
    'mask': mask,
    'dropout': dropout,
    'network': network
}
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
my_loss Ran
ran on a synthesized input
herobd/dessurt/model/loss.py
code served (permissive licence) · get_code("9b37cbfef516510b")
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 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 torch
import torch.nn.functional as F

torch.manual_seed(0)

# F.nll_loss expects:
# - y_input: log probabilities, shape (batch_size, num_classes)
# - y_target: class indices, shape (batch_size,)

batch_size = 2
num_classes = 4

y_input = F.log_softmax(torch.randn(batch_size, num_classes), dim=1)
y_target = torch.randint(0, num_classes, (batch_size,))

ARGS = {
    "y_input": y_input,
    "y_target": y_target,
}
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 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
parseOutput Ran
ran on a synthesized input
herobd/dessurt/gpt_forms.py
code served (permissive licence) · get_code("51d1cddcc7ad2f46")
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, ndim 2, 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 re

def parseOutput(output):
    endindex = output.find('<|endoftext|>')
    if endindex >= 0:
        output = output[:endindex]
    output = re.sub('\n+', '\n', output)
    lines = output.split('\n')
    lines = lines[1:]
    pairs = []
    seen_pairs = set()
    seen_qs = []
    seen_as = []
    i = 0
    while i < len(lines):
        qa = lines[i].split(':')
        if len(qa) == 2:
            q = qa[0].strip()
            a = qa[1].strip()
            if len(a) == 0:
                if i < len(lines) - 1:
                    next_line = lines[i + 1]
                    if next_line.count(':') > 1:
                        i += 1
                    else:
                        q = qa[0].strip()
                        a = next_line.strip()
                        if not addPair(q, a, pairs, seen_pairs, seen_qs, seen_as):
                            break
                        i += 2
                else:
                    i += 1
            else:
                if not addPair(q, a, pairs, seen_pairs, seen_qs, seen_as):
                    break
                i += 1
        else:
            i += 1
    return pairs

def addPair(q, a, pairs, seen_pairs, seen_qs, seen_as):
    pair = q + ':' + a
    if pair in seen_pairs:
        return False
    for sq in range(len(seen_qs) - 1):
        if seen_qs[sq] == seen_qs[-1] and seen_qs[sq + 1] == q:
            return False
    all_same_a = len(seen_as) >= 3
    for sa in seen_as[-3:]:
        if sa != a:
            all_same_a = False
            break
    if all_same_a:
        return False
    pairs.append((q, a))
    seen_pairs.add(pair)
    seen_qs.append(q)
    seen_as.append(a)
    return True

# Create a sample output string with Q&A format
sample_output = """Start
Q1: A1
Q2: A2
Q3: A3
"""

ARGS = {
    "output": sample_output
}
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 list, ndim 2, dtype family float — a list 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
rfindNonEscaped Ran
ran on a synthesized input
herobd/dessurt/funsd_eval_json.py
code served (permissive licence) · get_code("bce0e34f850f8471")
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

def rfindNonEscaped(s, target):
    while True:
        loc = s.rfind(target)
        if loc <= 0 or s[loc - 1] != '\\':
            return loc
        else:
            s = s[:loc]

# Construct valid arguments
s = "hello\\nworld\\ntest"
target = "n"

ARGS = {
    "s": s,
    "target": target
}
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
sigmoid_BCE_loss Ran
ran on a synthesized input
herobd/dessurt/model/loss.py
code served (permissive licence) · get_code("6324a51484358da4")
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 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 torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create small tensors for binary cross entropy with logits
# y_input: logits (raw predictions before sigmoid)
# y_target: binary targets (0 or 1)
y_input = torch.randn(2, 4)  # batch_size=2, num_classes=4
y_target = torch.randint(0, 2, (2, 4)).float()  # binary targets

ARGS = {
    "y_input": y_input,
    "y_target": y_target
}
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 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
sigmoid_BCE_mask_loss Ran
ran on a synthesized input
herobd/dessurt/model/loss.py
code served (permissive licence) · get_code("2ed706c4d8f6c76f")
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 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 torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create small tensors for the function
# y_input: logits (before sigmoid), shape (2, 4)
y_input = torch.randn(2, 4)

# y_target: binary targets, shape (2, 4)
y_target = torch.randint(0, 2, (2, 4)).float()

ARGS = {
    "y_input": y_input,
    "y_target": y_target,
}
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 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

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 1 the same month, 1 later) and 10 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
clones 79 other papers
40 dated earlier, 4 the same month, 35 later · 11 only as an assembly brick
1411.4555 (2014-11)
Show and Tell: A Neural Image Caption Generator
1612.00563 (2016-12)
Self-critical Sequence Training for Image Captioning
1706.03762 (2017-06)
Attention Is All You Need
and 76 more not named here

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

We introduce Dessurt, a relatively simple document understanding transformer capable of being fine-tuned on a greater variety of document tasks than prior methods. It receives a document image and task string as input and generates arbitrary text autoregressively as output. Because Dessurt is an end-to-end architecture that performs text recognition in addition to the document understanding, it does not require an external recognition model as prior methods do. Dessurt is a more flexible model than prior methods and is able to handle a variety of document domains and tasks. We show that this model is effective at 9 different dataset-task combinations.

For agents

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

get_harvested_code_for_paper("2203.16618")
get_code_for_paper("2203.16618")
have("2203.16618")

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

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

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

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

Connect an agent — have() is free.