---
title: Formats and versions
description: Markdown, JSON and plain text for every paper, figure assets, versioned and unversioned URLs, and how responses are cached.
sidebar:
  order: 3
---

Every format is a rendering of the same [document tree](/document-model).

## Formats

| Extension | Content-Type                   | Contents                                                                                                               |
| --------- | ------------------------------ | ---------------------------------------------------------------------------------------------------------------------- |
| `.md`     | `text/markdown; charset=utf-8` | YAML front matter, `# Title`, `## Abstract`, sections, LaTeX math, GFM tables, figures, `## References`, footnotes     |
| `.json`   | `application/json`             | Metadata, build info, token count, the full tree and inferred fields. See [JSON schema](/json)                         |
| `.txt`    | `text/plain; charset=utf-8`    | Plain text: headings as plain lines, math kept as LaTeX, tables tab-separated, `References` and `Footnotes` at the end |

```bash
curl https://arxivv.org/1706.03762.md
curl https://arxivv.org/1706.03762.json
curl https://arxivv.org/1706.03762.txt
```

## Markdown conventions

| Element         | Rendering                                                                                                    |
| --------------- | ------------------------------------------------------------------------------------------------------------ |
| Front matter    | `arxiv`, `version`, `title`, `authors`, `date`, `categories`, `license` (when known), `url` (arXiv abstract) |
| Title           | `# Attention Is All You Need`                                                                                |
| Abstract        | `## Abstract`                                                                                                |
| Section heading | Level-1 sections are `##`, subsections `###`, then `####`: `### 3.2 Attention {#S3.SS2}`                     |
| Inline math     | `$d_k$`                                                                                                      |
| Display math    | `$$...$$` followed by ` (1)` on the same line when numbered                                                  |
| Citation        | `[12]`, as printed in the paper                                                                              |
| Cross-reference | `[2](#S3.F2)`: the printed text, linked to the target id                                                     |
| Figure          | `![alt](https://arxivv.org/1706.03762v7/assets/Figures/ModalNet-21.png)` then `*Figure 1: caption*`          |
| Table           | `*Table 1: caption*` then a GFM table (first row is the header row, `\|` escaped)                            |
| Theorem         | `**Theorem 1 (title).**` then the body; proofs start `*Proof.*`                                              |
| Footnote        | `[^footnote3]`, defined at the very end                                                                      |
| Bibliography    | Numbered list under `## References`                                                                          |

Image URLs are absolute and point at the [asset route](#figure-assets). Alt text is the image's own alt, or the figure caption.

```markdown
---
arxiv: "1706.03762"
version: 7
title: "Attention Is All You Need"
authors: "Ashish Vaswani, Noam Shazeer, Niki Parmar, ..."
date: "2023-08-02"
categories: ["cs.CL", "cs.LG"]
license: "http://creativecommons.org/licenses/by/4.0/"
url: "https://arxiv.org/abs/1706.03762v7"
---

# Attention Is All You Need

## Abstract

The dominant sequence transduction models are based on complex recurrent or
convolutional neural networks...

## 3 Model Architecture {#S3}

### 3.2 Attention {#S3.SS2}
```

`/<paper>/sections/<anchor>.md` returns one section subtree in the same form, heading included, followed by the definitions of any footnotes it uses.

## Figure assets

`/<paper>/assets/<path>` serves a file referenced by arXiv's HTML, such as a figure image. `<path>` is the image's `src` in the tree, e.g. `Figures/ModalNet-21.png`.

| Property      | Value                                                                                                               |
| ------------- | ------------------------------------------------------------------------------------------------------------------- |
| Availability  | Mirrored from arXiv asynchronously after the first build; `404 not-found` until mirrored                            |
| Content-Type  | As stored from arXiv, else `application/octet-stream`                                                               |
| Cache-Control | Versioned: `public, max-age=31536000, immutable`; unversioned: `public, max-age=3600, stale-while-revalidate=86400` |
| Headers       | `ETag`, `X-Arxivv-Schema`, `X-Arxivv-Version`; `Cache-Tag: paper:<id>` on unversioned requests                      |

```bash
curl -O https://arxivv.org/1706.03762v7/assets/Figures/ModalNet-21.png
```

## Versions

| URL                | Serves             | Extra headers                                                              |
| ------------------ | ------------------ | -------------------------------------------------------------------------- |
| `/1706.03762.md`   | Latest version     | `Link: </1706.03762v7.md>; rel="canonical"`, `Cache-Tag: paper:1706.03762` |
| `/1706.03762v7.md` | Version 7, forever | None                                                                       |
| `/1706.03762v1.md` | Version 1, forever | None                                                                       |

- Unversioned URLs follow arXiv: they serve the latest known version.
- Every response states its version in `X-Arxivv-Version`.
- Versioned URLs are immutable. Cite them.
- An unknown paper or version is looked up on arXiv (OAI-PMH) on first request.
- Old-style IDs work the same way: `/hep-th/9901001.md`, `/hep-th/9901001v1.json`.

### Daily harvest

| Property | Value                                                                                               |
| -------- | --------------------------------------------------------------------------------------------------- |
| Schedule | Daily at 03:00 UTC                                                                                  |
| Source   | arXiv OAI-PMH `ListRecords` (`arXivRaw`) for the previous day                                       |
| Effect   | Updates latest-version pointers and metadata                                                        |
| Purge    | When a known paper gains a version, unversioned responses tagged `paper:<id>` are purged from cache |
| Builds   | The new version is built on its first request, not by the harvest                                   |

## Caching

| Response                                                                                   | `Cache-Control`                                      |
| ------------------------------------------------------------------------------------------ | ---------------------------------------------------- |
| Versioned URL                                                                              | `public, max-age=31536000, immutable`                |
| Unversioned URL                                                                            | `public, max-age=3600, stale-while-revalidate=86400` |
| `.json`, `outline.json` or `metadata.json` while inferred fields are `pending` or `failed` | `public, max-age=30`                                 |
| `metadata.json` before the tree is built                                                   | `public, max-age=30`                                 |
| A `Prefer` preference was applied                                                          | `no-store`                                           |
| Errors                                                                                     | `no-store`                                           |

Assets follow the URL rule: versioned asset URLs are immutable, unversioned ones (`/1706.03762/assets/...`) use the unversioned policy and carry `Cache-Tag`.

`/<paper>/metadata.json` never triggers a build and ignores `Prefer`, so it is never `no-store`. Once the tree is built and inferred fields are `ready`, it follows the URL rule like any other route.

Precedence: `no-store` first, then pending or failed, then the URL rule. Every paper response carries `Vary: Prefer`.

## Response headers

Every arXivv paper response carries these headers:

| Header             | Example                               | Meaning                                                               |
| ------------------ | ------------------------------------- | --------------------------------------------------------------------- |
| `X-Arxivv-Schema`  | `1`                                   | Major [schema version](/json#compatibility)                           |
| `X-Arxivv-Version` | `7`                                   | arXiv version served                                                  |
| `X-Arxivv-Quality` | `0.97`                                | Conversion [quality score](/document-model#quality-score)             |
| `X-Arxivv-Source`  | `arxiv-html`                          | Where the tree was built from                                         |
| `Vary`             | `Prefer`                              | Responses differ by `Prefer`                                          |
| `Cache-Control`    | See [caching](#caching)               |                                                                       |
| `Link`             | `</1706.03762v7.md>; rel="canonical"` | Unversioned requests only                                             |
| `Cache-Tag`        | `paper:1706.03762`                    | Unversioned requests only (assets too); used to purge on new versions |

`X-Arxivv-Quality` and `X-Arxivv-Source` are absent from `202` responses and from `metadata.json` for an unbuilt paper, since no tree exists yet. See [first request](/first-request) for `Preference-Applied`, `Retry-After` and `Location`.
