SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2106.00676 · 2021

VILA: Improving Structured Content Extraction from Scientific PDFs Using Visual Layout Groups

arXiv · PDF · Open in the Atlas

Code that ran

4 of 6 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 4 have no contract verdict; 0 failures of our instrument; 2 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/2106.00676.json · badge: /api/ran/2106.00676.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
allenai/VILA canonical (classifier label)
classifier basis: census
4 ran · 2 no recorded run
FunctionStatusWhere it lives
columns_used_in_model_inputs Ran
ran on a synthesized input
allenai/VILA/src/vila/predictors.py
code served (permissive licence) · get_code("a4bbce8fc073bbb9")
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
import inspect

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, input_ids, attention_mask, token_type_ids):
        x = self.linear(torch.randn(2, 4))
        return x

model = SimpleModel()

ARGS = {
    "model": model
}
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
flatten_group_level_prediction Ran
ran on a synthesized input
allenai/VILA/src/vila/predictors.py
code served (permissive licence) · get_code("8a6aeb8c178b2bb1")
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 torch
import itertools

torch.manual_seed(0)

# Analyzing the function:
# - batched_group_pred: iterable of items, each item is iterable of (pred, label) tuples
# - batched_group_word_count: iterable of items, each item is iterable of (line_id, count) tuples
# - The function zips group_pred and group_word_count, so they must have same length
# - For each (pred, label) and (line_id, count) pair, it creates a list [[pred, label, line_id]] * count
# - These are flattened and returned

# Constructing valid arguments:
# batch_size = 2 (outer batches)
# groups per batch = 3 (inner items in each batch)

batched_group_pred = [
    [
        (0.8, 1),      # (pred, label) for group 0
        (0.6, 0),      # (pred, label) for group 1
        (0.9, 1),      # (pred, label) for group 2
    ],
    [
        (0.4, 0),      # (pred, label) for group 0
        (0.7, 1),      # (pred, label) for group 1
        (0.5, 0),      # (pred, label) for group 2
    ]
]

batched_group_word_count = [
    [
        (101, 2),      # (line_id, count) for group 0
        (102, 3),      # (line_id, count) for group 1
        (103, 1),      # (line_id, count) for group 2
    ],
    [
        (201, 4),      # (line_id, count) for group 0
        (202, 2),      # (line_id, count) for group 1
        (203, 3),      # (line_id, count) for group 2
    ]
]

ARGS = {
    "batched_group_pred": batched_group_pred,
    "batched_group_word_count": batched_group_word_count,
}
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 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
is_in Ran
ran on a synthesized input
allenai/VILA/src/vila/utils.py
code served (permissive licence) · get_code("1ad2bb03b5ef4f13")
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 torch.nn as nn

torch.manual_seed(0)

class MockLayoutElement:
    """Mock layout element that implements is_in method."""
    
    def __init__(self, x, y, width, height):
        self.x = x
        self.y = y
        self.width = width
        self.height = height
    
    def is_in(self, other, soft_margin=None, center=False):
        """Check if this block is inside another block."""
        if soft_margin is None:
            soft_margin = {'top': 0, 'bottom': 0, 'left': 0, 'right': 0}
        
        # Simple containment check with soft margins
        self_left = self.x - soft_margin.get('left', 0)
        self_right = self.x + self.width + soft_margin.get('right', 0)
        self_top = self.y - soft_margin.get('top', 0)
        self_bottom = self.y + self.height + soft_margin.get('bottom', 0)
        
        other_left = other.x
        other_right = other.x + other.width
        other_top = other.y
        other_bottom = other.y + other.height
        
        is_contained = (
            self_left >= other_left and
            self_right <= other_right and
            self_top >= other_top and
            self_bottom <= other_bottom
        )
        
        return is_contained

# Create two mock layout elements
block_a = MockLayoutElement(x=10, y=10, width=20, height=20)
block_b = MockLayoutElement(x=0, y=0, width=100, height=100)

ARGS = {
    'block_a': block_a,
    'block_b': block_b,
}
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
union_box Ran
ran on a synthesized input
allenai/VILA/src/vila/utils.py
code served (permissive licence) · get_code("ef0bcc11085b5fe0")
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 int; 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 logging

logger = logging.getLogger(__name__)

# The function union_box takes a list of bounding boxes
# Each bbox is expected to be indexable with [0], [1], [2], [3]
# representing x1, y1, x2, y2 coordinates

# Create sample bounding boxes (list of lists with 4 coordinates each)
blocks = [
    [10, 20, 100, 150],
    [30, 40, 120, 160],
    [5, 15, 95, 140]
]

ARGS = {
    'blocks': blocks
}
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 int — 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
instantiate_textline_encoder Not yet run
unverified (harvested, no recorded run)
allenai/VILA/src/vila/models/hierarchical_model.py
code served (permissive licence) · get_code("3490b2bdd7f4ec6b")
How it ran

no invocation recorded.

instantiate_textline_model Not yet run
unverified (harvested, no recorded run)
allenai/VILA/src/vila/models/hierarchical_model.py
code served (permissive licence) · get_code("364fe0222f94071b")
How it ran

no invocation recorded.

Also present in other papers' code

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

Accurately extracting structured content from PDFs is a critical first step for NLP over scientific papers. Recent work has improved extraction accuracy by incorporating elementary layout information, e.g., each token's 2D position on the page, into language model pretraining. We introduce new methods that explicitly model VIsual LAyout (VILA) groups, i.e., text lines or text blocks, to further improve performance. In our I-VILA approach, we show that simply inserting special tokens denoting layout group boundaries into model inputs can lead to a 1.9% Macro F1 improvement in token classification. In the H-VILA approach, we show that hierarchical encoding of layout-groups can result in up-to 47% inference time reduction with less than 0.8% Macro F1 loss. Unlike prior layout-aware approaches, our methods do not require expensive additional pretraining, only fine-tuning, which we show can reduce training cost by up to 95%. Experiments are conducted on a newly curated evaluation suite, S2-VLUE, that unifies existing automatically-labeled datasets and includes a new dataset of manual annotations covering diverse papers from 19 scientific disciplines. Pre-trained weights, benchmark datasets, and source code are available at https://github.com/allenai/VILA.

For agents

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

get_harvested_code_for_paper("2106.00676")
get_code_for_paper("2106.00676")
have("2106.00676")

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

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

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

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

Connect an agent — have() is free.