Papers › Image-to-Markup Generation with Coarse-to-Fine Attention

Image-to-Markup Generation with Coarse-to-Fine Attention

16 Sep 2016ICML 2017 8arXiv:1609.04938archive 2025-07-28

Yuntian Deng, Anssi Kanervisto, Jeffrey Ling, Alexander M. Rush

We present a neural encoder-decoder model to convert images into presentational markup based on a scalable coarse-to-fine attention mechanism. Our method is evaluated in the context of image-to-LaTeX generation, and we introduce a new dataset of real-world rendered mathematical expressions paired with LaTeX markup. We show that unlike neural OCR techniques using CTC-based models, attention-based approaches can tackle this non-standard OCR task. Our approach outperforms classical mathematical OCR systems by a large margin on in-domain rendered data, and, with pretraining, also performs well on out-of-domain handwritten data. To reduce the inference complexity associated with the attention-based approaches, we introduce a new coarse-to-fine attention layer that selects a support region before applying attention.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 13 code samples harvested from 4 repositories linked to this paper: 5 ran (of which 0 constructed an object rather than computing a result; 4 with no instrument failure: 0 honoured, 0 violated, 4 with no contract checked; 1 where Syntology's instrument failed) · 8 unverified. Where Syntology's instrument failed: 1 where our contract draft was wrong; failures of Syntology's instrument, not of the code.

By repository: official repository: 1 sample from 1 repository, 0 ran (0 with no instrument failure; 0 where Syntology's instrument failed); community (archive-listed): 12 samples from 3 repositories, 5 ran (4 with no instrument failure; 1 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

No sample is linked to this paper from 1 of its repositories that Syntology harvested for other papers:

Levels written between 2026-09-22 and 2026-09-26 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed.

14 repositories listed; official and paper-mentioned ones first.

harvardnlp/im2markup officialmentioned on GitHubtorchSyntology: 1 sample, 0 ran · 1 unverified report
BachoSeven/stellestelline mentioned on GitHubtfSyntology: not harvested report
CT2001/image-to-latex mentioned on GitHubpytorchMITSyntology: 3 samples, 3 ran (0 instrument-failed) · 0 unverified report
CT2001/image-to-latex-biology mentioned on GitHubpytorchMITSyntology: not harvested report
aspnetcs/myim2latex-tensorflow-docker mentioned on GitHubtfSyntology: not harvested report
da03/Attention-OCR mentioned on GitHubtfSyntology: 1 sample, 1 ran (1 instrument-failed) · 0 unverified report
jvpoulos/Attention-OCR mentioned on GitHubtfMITSyntology: 8 samples, 1 ran (0 instrument-failed) · 7 unverified report
kingyiusuen/image-to-latex mentioned on GitHubpytorchMITSyntology: not harvested report
lukas-blecher/LaTeX-OCR mentioned on GitHubpytorchMITSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale (arXiv:2010.11929; that paper's own run record: 307 ran (of which 165 constructed an object rather than computing a result; 286 with no instrument failure: 8 honoured, 2 violated, 276 with no contract checked; 21 where Syntology's instrument failed) · 112 unverified); nothing checks that they implement this paper's method. report
lukecage0/implementation-of-Im2Latex mentioned on GitHubSyntology: not harvested report
opennmt/im2text mentioned on GitHubMITSyntology: not harvested report
LinXueyuanStdio/LaTeX_OCR_PRO tfGPL-3.0Syntology: not harvested report
tuanio/image2latex pytorchSyntology: not harvested report
untrix/im2latex tfAGPL-3.0Syntology: not harvested report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

A paper named beside a repository with no sample linked to this paper is shown with that paper's own run record, not this paper's: “ran” means executed on a synthesized input, not that the code is correct, and “where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Papers are listed in arXiv-id order, at most three per repository.

Code Syntology ran Syntology

13 samples harvested: 5 ran (of which 0 constructed an object rather than computing a result; 4 with no instrument failure: 0 honoured, 0 violated, 4 with no contract checked; 1 where Syntology's instrument failed) · 8 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page has not changed since , the first build that kept a record date for it; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

1ran · our draft was wrong
4ran
8unverified

Licence: 0 of the 13 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 4 repositories linked to this paper, official or community; the list below is grouped by repository, each group headed by its name and what it is to the paper. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of six reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity.

harvardnlp/im2markup official repository 1 sample, 0 ran · 1 unverified
process_args in 17 papers scripts/preprocessing/preprocess_images.py unverified MIT (permissive) · ae08cb323bcbd595 · report
CT2001/image-to-latex community (archive-listed) 3 samples, 3 ran (0 instrument-failed) · 0 unverified
FMM_func data-preprocess/no_chinese.py ran MIT (permissive) · 5bfcddf02c8fcf58 · report fixture: signature user_dict:list/1/str, sentence:str/0/str · returned list · level recorded 2026-09-26
find_first image_to_latex/models/resnet_transformer.py ran MIT (permissive) · d3fb41b62eaedad7 · report fixture: signature x:Tensor/2/float, element:int/0/int, dim:int/0/int · returned Tensor · level recorded 2026-09-26
generate_square_subsequent_mask in 30 papers image_to_latex/models/resnet_transformer.py ran fingerprinted MIT (permissive) · 9fae5025ebafa98e · report fixture: signature size:int/0/int · returned Tensor · level recorded 2026-09-26
da03/Attention-OCR community (archive-listed) 1 sample, 1 ran (1 instrument-failed) · 0 unverified
process_args in 17 papers src/launcher.py ran · our draft was wrong MIT (permissive) · 5f977334a9330cac · report fixture: signature args:list/1/str, defaults:Defaults/0/? · returned Namespace · level recorded 2026-09-22
jvpoulos/Attention-OCR community (archive-listed) 8 samples, 1 ran (0 instrument-failed) · 7 unverified
process_args in 17 papers src/launcher.py ran MIT (permissive) · e1ee189649199b8f · report fixture: signature args:list/1/str, defaults:Defaults/0/? · returned Namespace · level recorded 2026-09-26
get_wmt_enfr_dev_set src/model/data_utils.py unverified MIT (permissive) · ec532e8f70289f38 · report
get_wmt_enfr_train_set src/model/data_utils.py unverified MIT (permissive) · 0a7b6ca2e2bf4659 · report
max_2x1pool src/model/cnn.py unverified MIT (permissive) · 3ca4a31edc44c233 · report
max_2x2pool src/model/cnn.py unverified MIT (permissive) · 32711cdafa63eda4 · report
maybe_download in 10 papers src/model/data_utils.py unverified MIT (permissive) · 43ea785c6d00f3e4 · report
rnn_decoder src/model/seq2seq.py unverified MIT (permissive) · f44847e8b1c4bd91 · report
var_random src/model/cnn.py unverified MIT (permissive) · 213cd44559181629 · report

Tasks

DecoderOptical Character Recognition (OCR)

Datasets

Introduced by this paper, per the archive.

im2latex-100k

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections