SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2509.17589 · NeurIPS · 2025

Table2LaTeX-RL: High-Fidelity LaTeX Code Generation from Table Images via Reinforced Multimodal Language Models

Peng Wang, Tao Huang, Yang Yang, Ying Zhou, Heng Shen, Shibo Zhou, Jun Ling, Yao Qi, Yanqin Huang, Jiang Yang, Ziqi Song

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, 1 violated it and 0 have no contract verdict; 3 failures of our instrument; 2 no recorded run), measured 2026-11-24; 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/2509.17589.json · badge: /api/ran/2509.17589.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
newLLing/Table2LaTeX-RL canonical (classifier label)
classifier basis: census
4 ran · 2 no recorded run
FunctionStatusWhere it lives
ce_loss_func Ran
ran; our contract draft was wrong, not the code
newLLing/Table2LaTeX-RL/swift/plugin/loss.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from byyx666/DC-SFT, is pointer only (licence: NONE) · get_code("b40d46077f78e7de")
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 byyx666/DC-SFT, 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.

download_and_extract_source Ran
ran, violated the contract we drafted
newLLing/Table2LaTeX-RL/arxiv_papers_get.py
code served (permissive licence) · get_code("fadf2c53aeda98dc")
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 requests
from unittest.mock import Mock, patch
import os
import tempfile

# Create a temporary directory to avoid actual file I/O to D:/
temp_dir = tempfile.mkdtemp()

# Mock the requests.get to avoid actual network calls
def mock_get(url, stream=True, timeout=10):
    response = Mock()
    response.status_code = 200
    response.content = b'fake tar gz content'
    return response

ARGS = {
    'arxiv_id': '2410.12345',
    'id': '2410',
    'timeout': 10
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
requests — 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
lora_state_dict Ran
ran; our contract draft was wrong, not the code
newLLing/Table2LaTeX-RL/swift/tuners/lora_layers.py
code served (permissive licence) · get_code("974f5e5ea25a6532")
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 dict. 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 state_dict with LoRA parameters and bias terms
state_dict = {
    'linear1.lora_default.weight': torch.randn(4, 3),
    'linear1.lora_default.bias': torch.randn(4),
    'linear2.lora_default.weight': torch.randn(5, 4),
    'linear2.bias': torch.randn(5),
    'linear3.weight': torch.randn(6, 5),
}

ARGS = {
    'state_dict': state_dict,
    'adapter_name': 'default',
    'bias': 'lora_only',
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
loss_scale_func Ran
ran; our contract draft was wrong, not the code
newLLing/Table2LaTeX-RL/swift/plugin/loss.py
code served (permissive licence) · get_code("4b35155697e70ad7")
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 as nn
from torch.nn import CrossEntropyLoss

torch.manual_seed(0)

# Create a mock outputs object with logits attribute
class MockOutputs:
    def __init__(self, logits):
        self.logits = logits

# Create mock outputs with shape (batch_size=2, seq_len=5, vocab_size=10)
batch_size = 2
seq_len = 5
vocab_size = 10

logits = torch.randn(batch_size, seq_len, vocab_size)
outputs = MockOutputs(logits)

# Create labels tensor with shape (batch_size=2, seq_len=5)
# Include some -100 tokens (which will be masked out)
labels = torch.randint(0, vocab_size, (batch_size, seq_len))
labels[0, 2] = -100  # Add a masked token
labels[1, 4] = -100  # Add another masked token

# Create loss_scale tensor matching labels shape
loss_scale = torch.rand(batch_size, seq_len)

# num_items_in_batch represents count of non-masked tokens
# We have 5 tokens per sample, minus 1 masked per sample = 8 total
num_items_in_batch = 8

ARGS = {
    'outputs': outputs,
    'labels': labels,
    'loss_scale': loss_scale,
    'num_items_in_batch': num_items_in_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 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
get_model_arch Not yet run
unverified (harvested, no recorded run)
newLLing/Table2LaTeX-RL/swift/llm/model/model_arch.py
code served (permissive licence) · get_code("0d5b179849faddf7")
How it ran

no invocation recorded.

register_loss_func Not yet run
unverified (harvested, no recorded run)
newLLing/Table2LaTeX-RL/swift/plugin/loss.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from byyx666/DC-SFT, is pointer only (licence: NONE) · get_code("5a3ac54293be7e23")
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 byyx666/DC-SFT, 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. 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, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 4 later) and 2 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
lora_state_dict 7 other papers
3 dated earlier, 4 later
2409.13191 (2024-09)
Diabetica: Adapting Large Language Model to Enhance Multiple Medical Tasks in Diabetes Care and Management
2411.18145 (2024-11)
CHOICE: Benchmarking the Remote Sensing Capabilities of Large Vision-Language Models
2506.14674 (2025-06)
Recognition through Reasoning: Reinforcing Image Geo-localization with Large Vision-Language Models
and 4 more not named here
ce_loss_func 4 other papers
2 dated earlier, 2 later
2411.18145 (2024-11)
CHOICE: Benchmarking the Remote Sensing Capabilities of Large Vision-Language Models
2506.14674 (2025-06)
Recognition through Reasoning: Reinforcing Image Geo-localization with Large Vision-Language Models
2602.10815 (2026-02)
Why Does RL Generalize Better Than SFT? A Data-Centric Perspective on VLM Post-Training
and 1 more not named here
loss_scale_func 3 other papers
1 dated earlier, 2 later
2506.14674 (2025-06)
Recognition through Reasoning: Reinforcing Image Geo-localization with Large Vision-Language Models
2602.10815 (2026-02)
Why Does RL Generalize Better Than SFT? A Data-Centric Perspective on VLM Post-Training
2602.11909 (2026-02)
Echo: Towards Advanced Audio Comprehension via Audio-Interleaved Reasoning
register_loss_func 3 other papers
1 dated earlier, 2 later
2506.14674 (2025-06)
Recognition through Reasoning: Reinforcing Image Geo-localization with Large Vision-Language Models
2602.10815 (2026-02)
Why Does RL Generalize Better Than SFT? A Data-Centric Perspective on VLM Post-Training
2602.11909 (2026-02)
Echo: Towards Advanced Audio Comprehension via Audio-Interleaved Reasoning

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-24.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

In this work, we address the task of table image to LaTeX code generation, with the goal of automating the reconstruction of high-quality, publication-ready tables from visual inputs. A central challenge of this task lies in accurately handling complex tables-those with large sizes, deeply nested structures, and semantically rich or irregular cell content-where existing methods often fail. We begin with a comprehensive analysis, identifying key challenges and highlighting the limitations of current evaluation protocols. To overcome these issues, we propose a reinforced multimodal large language model (MLLM) framework, where a pre-trained MLLM is fine-tuned on a large-scale table-to-LaTeX dataset. To further improve generation quality, we introduce a dual-reward reinforcement learning strategy based on Group Relative Policy Optimization (GRPO). Unlike standard approaches that optimize purely over text outputs, our method incorporates both a structure-level reward on LaTeX code and a visual fidelity reward computed from rendered outputs, enabling direct optimization of the visual output quality. We adopt a hybrid evaluation protocol combining TEDS-Structure and CW-SSIM, and show that our method achieves state-of-the-art performance, particularly on structurally complex tables, demonstrating the effectiveness and robustness of our approach. Code and dataset are available at https://github.com/newLLing/Table2LaTeX-RL.

For agents

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

get_harvested_code_for_paper("2509.17589")
get_code_for_paper("2509.17589")
have("2509.17589")

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

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

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

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

Connect an agent — have() is free.