SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2407.01523 · NeurIPS · 2024

MMLONGBENCH-DOC: Benchmarking Long-context Document Understanding with Visualizations

Ziyu Liu, Xiaoyi Dong, Jiaqi Wang, Aixin Sun, Yu-Gang Jiang, Yixin Cao, Liangyu Chen, Liangming Pan, Yuhang Zang, Yan Ma, Yubo Ma, Meiqi Chen, and 4 more

arXiv · PDF · Open in the Atlas

Code that ran

9 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; 1 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 3 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/2407.01523.json · badge: /api/ran/2407.01523.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
mayubo2333/mmlongbench-doc community (classifier label)
classifier basis not recorded on the link
9 ran · 2 no recorded run
FunctionStatusWhere it lives
anls_compute Ran
ran on a synthesized input
mayubo2333/mmlongbench-doc/eval/eval_score.py
code served (permissive licence) · get_code("b9646cb1dd61841b")
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 torch
import numpy as np

def levenshtein_distance(s1, s2):
    if len(s1) > len(s2):
        s1, s2 = (s2, s1)
    distances = range(len(s1) + 1)
    for i2, c2 in enumerate(s2):
        distances_ = [i2 + 1]
        for i1, c1 in enumerate(s1):
            if c1 == c2:
                distances_.append(distances[i1])
            else:
                distances_.append(1 + min((distances[i1], distances[i1 + 1], distances_[-1])))
        distances = distances_
    return distances[-1]

def anls_compute(groundtruth, prediction, threshold=0.5):
    dist = levenshtein_distance(groundtruth, prediction)
    length = max(len(groundtruth.upper()), len(prediction.upper()))
    value = 0.0 if length == 0 else float(dist) / float(length)
    anls = 1.0 - value
    if anls <= threshold:
        anls = 0.0
    return anls

groundtruth = "HELLO"
prediction = "HALLO"
threshold = 0.5

ARGS = {
    "groundtruth": groundtruth,
    "prediction": prediction,
    "threshold": threshold
}
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 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
build_transform Ran
ran; our contract draft was wrong, not the code
mayubo2333/mmlongbench-doc/models/internvl_chat.py
code served (permissive licence) · get_code("57e95166ade5f25c")
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 Compose. 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 torchvision.transforms as T
from torchvision.transforms.functional import InterpolationMode
from PIL import Image
import numpy as np

torch.manual_seed(0)

# Create a small test image to verify the transform works
test_image_array = np.random.randint(0, 256, (64, 64, 3), dtype=np.uint8)
test_image = Image.fromarray(test_image_array, mode='RGB')

ARGS = {
    'input_size': 224
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Compose — a Compose output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Compose 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
concat_images Ran
ran on a synthesized input
mayubo2333/mmlongbench-doc/run_lvlm.py
code served (permissive licence) · get_code("18507a5fed3525e6")
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 os
import math
from PIL import Image
import tempfile

# Create a temporary directory for test images
temp_dir = tempfile.mkdtemp()

# Create small test images
def create_test_image(filename, width=100, height=80):
    img = Image.new('RGB', (width, height), color='red')
    img.save(filename)
    return filename

# Create a list of test image paths
image_files = []
for i in range(4):
    img_path = os.path.join(temp_dir, f'test_image_batch_0_{i}.jpg')
    create_test_image(img_path)
    image_files.append(img_path)

ARGS = {
    'image_list': image_files,
    'concat_num': 1,
    'column_num': 3
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL — 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
dynamic_preprocess Ran
ran; our contract draft was wrong, not the code
mayubo2333/mmlongbench-doc/models/internvl_chat.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from OpenGVLab/MM-NIAH, is pointer only (licence: NONE) · get_code("d610b5eabe0c9db1")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from OpenGVLab/MM-NIAH, 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.

encode_image_to_base64 Ran
ran on a synthesized input
mayubo2333/mmlongbench-doc/run_api.py
code served (permissive licence) · get_code("f9d80f7332b0b8a1")
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 str. 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.

from PIL import Image
import numpy as np

# Create a small PIL Image with RGB mode
img_array = np.random.randint(0, 256, (10, 10, 3), dtype=np.uint8)
img = Image.fromarray(img_array, mode='RGB')

ARGS = {
    'img': img
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
find_closest_aspect_ratio Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
mayubo2333/mmlongbench-doc/models/internvl_chat.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from OpenGVLab/MM-NIAH, is pointer only (licence: NONE) · get_code("bd77f5f8067f18e9")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from OpenGVLab/MM-NIAH, 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.

get_response_concat Ran
ran on a synthesized input
mayubo2333/mmlongbench-doc/models/minicpm_llama3.py
code served (permissive licence) · get_code("9677a8f9d8728dbb")
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 str. 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 torch
import torch.nn as nn
from PIL import Image
import io

torch.manual_seed(0)

# Create a minimal mock model that implements the required interface
class MockVisionLanguageModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.tokenizer = MockTokenizer()
    
    def chat(self, msgs, context, image, max_new_tokens, temperature, do_sample, tokenizer):
        # Mock implementation that accepts the required arguments
        return "This is a mock response from the model."

class MockTokenizer:
    def __init__(self):
        pass

# Create a small dummy image and save to bytes for use
def create_dummy_image():
    img = Image.new('RGB', (32, 32), color='red')
    return img

# Save dummy images as temporary files using PIL in-memory
dummy_img1 = create_dummy_image()
dummy_img2 = create_dummy_image()

# Create image paths - we'll use a workaround by creating actual small image files
import tempfile
import os

temp_dir = tempfile.gettempdir()
img_path_1 = os.path.join(temp_dir, 'dummy_img_1.png')
img_path_2 = os.path.join(temp_dir, 'dummy_img_2.png')

dummy_img1.save(img_path_1)
dummy_img2.save(img_path_2)

# Construct the arguments
model = MockVisionLanguageModel()
question = "What is in this image?"
image_path_list = [img_path_1, img_path_2]
max_new_tokens = 256
temperature = 0.7

ARGS = {
    'model': model,
    'question': question,
    'image_path_list': image_path_list,
    'max_new_tokens': max_new_tokens,
    'temperature': temperature
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
is_float_equal Ran
ran on a synthesized input
mayubo2333/mmlongbench-doc/eval/eval_score.py
code served (permissive licence) · get_code("5e1f94bb8dee0afa")
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
import numpy as np
from math import isclose

# Setup for is_float_equal function
# The function takes:
# - reference: a number (or string representation of a number)
# - prediction: a number (or string representation of a number)
# - include_percentage: bool flag
# - is_close: bool flag for using isclose()

ARGS = {
    "reference": 42.5,
    "prediction": 42.501,
    "include_percentage": False,
    "is_close": False
}
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 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
levenshtein_distance Ran
ran, honoured the contract we drafted
mayubo2333/mmlongbench-doc/eval/eval_score.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from Brandon3964/MultiModal-Task-Vector, is pointer only (licence: NOASSERTION) · get_code("90a8e73fa6de72a4")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from Brandon3964/MultiModal-Task-Vector, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

init_model Not yet run
unverified (harvested, no recorded run)
mayubo2333/mmlongbench-doc/models/internlm_xc2_4khd.py
code served (permissive licence) · get_code("2e9e62e3fa0f5b69")
How it ran

no invocation recorded.

load_model Not yet run
unverified (harvested, no recorded run)
mayubo2333/mmlongbench-doc/run_lvlm.py
code served (permissive licence) · get_code("3c76aa11708f6da6")
How it ran

no invocation recorded.

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, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 3 the same month, 3 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.

FunctionAlso present inEarliest-datedOthers named
find_closest_aspect_ratio 43 other papers
8 dated earlier, 2 the same month, 33 later
1910.01108 (2019-10)
DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter
2312.13271 (2023-12)
Repaint123: Fast and High-quality One Image to 3D Generation with Progressive Controllable 2D Repainting
2403.15952 (2024-03)
IllusionVQA: A Challenging Optical Illusion Dataset for Vision Language Models
and 40 more not named here
build_transform 31 other papers
7 dated earlier, 3 the same month, 21 later
1910.01108 (2019-10)
DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter
2312.13271 (2023-12)
Repaint123: Fast and High-quality One Image to 3D Generation with Progressive Controllable 2D Repainting
2403.15952 (2024-03)
IllusionVQA: A Challenging Optical Illusion Dataset for Vision Language Models
and 28 more not named here
dynamic_preprocess 13 other papers
4 dated earlier, 2 the same month, 7 later
2312.13271 (2023-12)
Repaint123: Fast and High-quality One Image to 3D Generation with Progressive Controllable 2D Repainting
2405.14156 (2024-05)
Unveiling the Tapestry of Consistency in Large Vision-Language Models
2406.07230 (2024-06)
Needle In A Multimodal Haystack
and 10 more not named here
levenshtein_distance 2 other papers
2 dated earlier
2312.08578 (2023-12)
A Picture is Worth More Than 77 Text Tokens: Evaluating CLIP-Style Models on Dense Captions
2406.15334 (2024-06)
Multimodal Task Vectors Enable Many-Shot Multimodal In-Context Learning

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

Understanding documents with rich layouts and multi-modal components is a long-standing and practical task. Recent Large Vision-Language Models (LVLMs) have made remarkable strides in various tasks, particularly in single-page document understanding (DU). However, their abilities on long-context DU remain an open problem. This work presents MMLONGBENCH-DOC, a long-context, multimodal benchmark comprising 1,082 expert-annotated questions. Distinct from previous datasets, it is constructed upon 135 lengthy PDF-formatted documents with an average of 47.5 pages and 21,214 textual tokens. Towards comprehensive evaluation, answers to these questions rely on pieces of evidence from (1) different sources (text, image, chart, table, and layout structure) and (2) various locations (i.e., page number). Moreover, 33.7% of the questions are cross-page questions requiring evidence across multiple pages. 20.6% of the questions are designed to be unanswerable for detecting potential hallucinations. Experiments on 14 LVLMs demonstrate that long-context DU greatly challenges current models. Notably, the best-performing model, GPT-4o, achieves an F1 score of only 44.9%, while the second-best, GPT-4V, scores 30.5%. Furthermore, 12 LVLMs (all except GPT-4o and GPT-4V) even present worse performance than their LLM counterparts which are fed with lossy-parsed OCR documents. These results validate the necessity of future research toward more capable long-context LVLMs.

For agents

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

get_harvested_code_for_paper("2407.01523")
get_code_for_paper("2407.01523")
have("2407.01523")

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

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

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

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

Connect an agent — have() is free.