Nougat (Neural Optical Understanding for Academic Documents) is an open-source document AI model that converts images of scientific pages into structured Markdown, including mathematical formulas in LaTeX and tables. Released by Meta AI in 2023, it reads a rendered page directly and generates text token by token, which makes it a representative of OCR-free document understanding in the Document AI field.
Nougat was designed for a narrow but difficult task: recovering the semantic content of academic papers, especially equations, that classical OCR engines and PDF text extraction handle poorly. The name refers only to this model; it is not to be confused with the confection or with unrelated software projects of the same name.
How Nougat converts a page into Markdown
Nougat is an image-to-sequence transformer that maps a page image straight to markup. It follows the same encoder-decoder design as Donut: a Swin Transformer encoder turns the rasterized page into visual embeddings, and an mBART-style decoder generates the output text autoregressively, attending to those embeddings at each step.
The pipeline needs no text layer and no external OCR engine. Each PDF page is rendered at a fixed resolution, the model predicts a lightweight Markdown dialect with LaTeX for inline and display math, and a post-processing step assembles the pages into one document. Because the model reads pixels, it works on born-digital PDFs and on clean scans of printed papers.
The table below summarizes the main architectural parameters of the published model.
| Property | Value or approach | Effect |
|---|---|---|
| Encoder | Swin Transformer | Captures layout and fine glyph detail |
| Decoder | mBART-style transformer | Generates Markdown token by token |
| Input resolution | 896 by 672 pixels per page | Enough detail for subscripts and symbols |
| Model sizes | About 250M and 350M parameters | Trade-off between speed and accuracy |
| Output format | Markdown with LaTeX math and tables | Machine-readable scientific text |
| Maximum sequence | About 3,584 to 4,096 tokens | Very dense pages may be truncated |
Training data and output quality
Nougat was trained on pairs of rendered PDF pages and their source markup, built mainly from arXiv papers whose LaTeX sources are public, supplemented with PubMed Central articles and pages from an industry documents archive. Aligning source text to individual pages required heuristic page splitting, which is one reason for occasional boundary errors.
On scientific papers the model achieves low edit distance on plain text and markedly better formula recovery than general OCR, because it predicts LaTeX rather than isolated characters. Tables are reproduced as LaTeX tabular markup, with lower accuracy than running text. Quality falls on documents that differ from the training distribution, such as handwriting, non-Latin scripts and complex magazine layouts.
Nougat compared with related document AI tools
Nougat occupies a specialized niche within document-to-Markdown conversion. Classical engines recognize characters and need separate layout and formula handling, while general vision-language models are broader but heavier. The following comparison places Nougat among its closest neighbors.
| Tool or approach | Method | Best fit | Main limitation |
|---|---|---|---|
| Nougat | OCR-free image-to-markup model | Scientific papers with math | Narrow domain, hallucination risk |
| Tesseract | Classical OCR engine | General printed text | No formula or structure recovery |
| Donut | OCR-free image-to-JSON model | Receipts, forms, classification | Needs task-specific fine-tuning |
| Docling | Layout pipeline with specialized models | Mixed business and technical PDFs | Several components to maintain |
| PDF text extraction | Reads the embedded text layer | Born-digital PDFs, fast batch work | Breaks formulas and reading order |
In practice, Nougat is often combined with other tools: a fast text-layer extractor for simple pages and Nougat only for pages with dense mathematics, which balances throughput and quality.
Typical applications
Nougat is used mainly where mathematical content must remain machine-readable. Its output feeds language model pipelines, search indexes and accessibility tools that cannot work with raw PDF text.
- Building training corpora of scientific text for language models, where equations must stay intact.
- Retrieval-augmented generation over research libraries, using Markdown chunks with preserved headings.
- Accessibility conversion of papers into formats that screen readers and math renderers can handle.
- Digitizing older scanned papers that lack any usable text layer.
- Mathematical expression recognition as a component in larger document processing systems.
Limitations and failure modes
Because Nougat generates text rather than recognizing it, its most serious weakness is fluent hallucination: the output can look plausible while differing from the page. A characteristic failure is the repetition loop, in which the decoder repeats a sentence until the token limit; the reference implementation detects this and may mark the page as failed or missing.
The table below lists the common symptoms, their causes and practical mitigations.
| Symptom | Likely cause | Mitigation |
|---|---|---|
| Repeated lines | Decoder degeneration | Repetition detection, retry, fallback extractor |
| Missing page | Page skipped after failure | Log skipped pages and process them separately |
| Garbled foreign text | Mostly English training data | Use a multilingual OCR engine instead |
| Slow throughput | Autoregressive decoding on large pages | GPU batching, route simple pages elsewhere |
| Wrong table structure | Limited table supervision | Validate tables against a dedicated extractor |
Processing speed is a real constraint: decoding is orders of magnitude slower than text-layer extraction and usually requires a GPU. Organizations should therefore validate output with character error rate checks on a sample before relying on it at scale.
Explained without jargon
Scientific papers are full of formulas. Ordinary text recognition sees them as strange symbols and scrambles them. Nougat looks at the page like a picture and writes it out again as clean text.
It is a bit like a skilled typist who copies a printed paper into a computer and types every equation in a form computers understand. The typist is fast and usually accurate. Sometimes, however, the typist gets tired and repeats a line or guesses a word, so important results still deserve a quick check.
A typical use case
A university library wants to make 12,000 physics papers from the 1990s searchable in an internal research assistant. Many files are scans with no text layer, and the rest contain equations that standard PDF extraction turns into unreadable fragments.
The library’s data team routes each page through a simple test. Pages with a clean text layer and no formulas go to a fast extractor, while math-heavy and scanned pages go to Nougat running on two GPUs. Pages flagged for repetition are retried and, if they fail again, sent to a classical OCR engine for manual review.
After four weeks, about 96 percent of pages are converted to Markdown with intact LaTeX formulas. Researchers can now search for specific equations and ask the assistant questions grounded in the converted text, while the remaining pages are reviewed by staff.