/ Модель

Характеристики

Лицензия
Apache 2.0
Архитектура
falcon_ocr · dense
Библиотека
transformers
Опубликована
22 фев 2026

Falcon-OCR

Генерация текстаТекст → текст15 профессий

Компактная модель TII распознаёт текст, формулы и таблицы на изображениях документов.

5 519скачиваний за 30 дней161лайквеса обновлены11 сен 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

Публичные оценки2

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

  • allenai/olmOCR-bench

    score · выше — лучше

    Результат

    80,3

    baseline 99,5headers_footers 94table_tests 90,3
    Hugging Face Leaderboards

    Публичная таблицаревизия не подтверждена

  • llamaindex/ParseBench

    score · выше — лучше

    Результат

    53,08

    text_content 78,59table 74,7layout 63,37
    Hugging Face Leaderboards

    Публичная таблицаревизия не подтверждена

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Falcon OCR — модель TII для распознавания текста и разбора документов по изображению. Это компактная модель на 270 млн параметров с ранним слиянием визуальных и текстовых токенов: единый Transformer обрабатывает патчи изображения и текст в общем пространстве параметров, используя двунаправленное внимание для изображения и причинное декодирование текста с учётом изображения.

Модель извлекает обычный текст, формулы в LaTeX и таблицы в HTML; промпты позволяют выбирать категории элементов страницы. Она рассчитана на сканы, фотографии документов, чеки, рукописные заметки, формы, журналы и другие материалы. Для большинства страниц рекомендуется сквозной OCR; для очень плотных многоколоночных страниц доступен двухэтапный сценарий с детектором макета PP-DocLayoutV3.

Версия 1.5 дообучена с GRPO для улучшения работы с реальными документами, сложными таблицами, рукописным текстом и деградированными сканами, а также для снижения галлюцинаций и повторов. Компактный размер помогает снизить задержку и стоимость обслуживания; в описанной авторами конфигурации vLLM пропускная способность может быть в 2–3 раза выше, чем у OCR VLM размером около 0,9 млрд параметров, в зависимости от длины последовательностей и пакетирования. Для запуска требуются PyTorch 2.5 или новее и Transformers. Лицензия — Apache-2.0.

Сценарии применения

  • извлечение текста из сканов и фотографий документов
  • распознавание рукописных заметок и заполненных форм
  • извлечение таблиц из документов с сохранением структуры в HTML
  • распознавание формул с выдачей LaTeX
  • оцифровка чеков, журналов и страниц книг
  • разбор плотных многоколоночных газетных страниц

Ограничения

Мелкие символы и сильно повреждённые сканы остаются сложными для распознавания. Различия в представлении таблиц и правилах нормализации формул могут влиять на оценку качества.

Для каких профессий подходит15

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Falcon OCR

Falcon OCR is a 270M parameter early-fusion vision-language model for document OCR. Given an image, it can produce plain text, LaTeX for formulas, or HTML for tables.

Most OCR VLM systems are built as a pipeline with a vision encoder feeding a separate text decoder, plus additional task-specific glue. Falcon OCR takes a different approach: a single Transformer processes image patches and text tokens in a shared parameter space from the first layer, using a hybrid attention mask where image tokens attend bidirectionally and text tokens decode causally conditioned on the image.

We built it this way for two practical reasons. First, it keeps the interface simple: one backbone, one decoding path, and task switching through prompts rather than a growing set of modules. Second, a 270M model has a lower latency and cost footprint than 0.9B-class OCR VLMs, and in our vLLM-based serving setup this translates into higher throughput, often 2–3× faster depending on sequence lengths and batch configuration. To our knowledge, this is one of the first attempts to apply this early-fusion single-stack recipe directly to competitive document OCR at this scale.

Links

Model updates

DateUpdate
2026-03-111.5 — Updated model.safetensors. Improved real-world document handling, complex tables, handwriting, and degraded/historical scans; better end-to-end OCR and reduced hallucinations.

Broader document coverage

We rebuilt the finetuning mix to balance the old strengths with new sources:

  • Historical and scanned documets
  • Handwriting and real-world captures — notes, forms, photos with text in scene
  • Everyday documents —receipts, magazines, book scans, exam papers
  • Hard tables — multi-table PDFs, synthetic complex and real-world tables
  • Internal data

RL

We further post-trained Falcon-OCR-1.5 with GRPO. This allows, for instance, to mitigate hallucinations (plausible text that isn't on the page) or runaway loops (the model keeps repeating a phrase or a table row) as well as table and formulas correctness and formatting.

Element-wise reward attribution

For the rewards, we use first element-wise attribution: we match blocks to corresponding GT using OmniDocBench style matching (text, formulas table), all the tokens in the match get assigned a reward and an advantage measuring its fidelity with respect to the ground-truth. This is measured by its native metric:

ElementReward signal
textcharacter edit distance
formulalatex validity × (1 − edit distance)
tableTEDS (tree-edit structural similarity)

Structural Rewards

On top of the per-element scores, a small set of structural gates put the entire rollout's reward to zero for the degenerate behaviors we want to avoid:

  • Repetition / loops: caught two ways: a compression check for catastrophic collapse, plus a word-n-gram detector.
  • Omission: outputs that silently drop ground-truth blocks.
  • Over-generation: outputs far longer than the page.

Quickstart

Installation

pip install "torch>=2.5" transformers pillow einops

Falcon OCR requires PyTorch 2.5 or newer for FlexAttention. The first call may be slower as torch.compile builds optimized kernels.

Single-Image OCR

import torch
from PIL import Image
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained(
    "tiiuae/Falcon-OCR",
    trust_remote_code=True,
    torch_dtype=torch.bfloat16,
    device_map="auto",
)
image = Image.open("document.png")
texts = model.generate(image)  # default category is "plain"
print(texts[0])

Choose an output format with category

texts = model.generate(image, category="text")     # plain text
texts = model.generate(image, category="formula")  # LaTeX
texts = model.generate(image, category="table")    # HTML table

API

model.generate(images, category="plain", **kwargs)

  • Inputs:
    • images: a PIL.Image.Image or a list of images
    • category: one of plain, text, table, formula, caption, footnote, list-item, page-footer, page-header, section-header, title
  • Returns: list[str], one extracted string per image

Layout OCR (Two-Stage Pipeline)

We recommend end-to-end OCR (model.generate) for most documents — send the full page directly to the model. Use layout + OCR only for very dense pages (e.g. dense newspapers). The optional two-stage pipeline:

  1. A layout detector finds regions on the page.
  2. Falcon OCR runs independently on each crop with a category-specific prompt. We use PP-DocLayoutV3 as the layout detector.
results = model.generate_with_layout(image)
for det in results[0]:
    print(f"[{det['category']}] {det['text'][:100]}...")

Batch mode:

results = model.generate_with_layout(
    [Image.open("page1.png"), Image.open("page2.png")],
    ocr_batch_size=32,
)

The layout model is loaded lazily on the first generate_with_layout() call and runs on the same GPU as the OCR model. Returns: list[list[dict]], one list per image, in reading order:

{
    "category": "text",       # layout category
    "bbox": [x1, y1, x2, y2], # in original image pixels
    "score": 0.93,            # detection confidence
    "text": "..."             # extracted text
}

When to Use What

ModeBest forHow
End-to-end OCR (recommended)Photos, receipts, slides, handwriting, scans, most documentsmodel.generate(image)
Layout + OCRVery dense multi-column pages (newspapers, tightly packed layouts)model.generate_with_layout(image)

Benchmark Results

Category-wise accuracy (%) on olmOCR splits. We omit the official Header/Footer category — it penalizes faithfully reproducing visible page headers and footers.

Full-page document parsing. Overall↑ aggregates sub-metrics. 1−Edit↑ is text accuracy (higher is better). TEDS↑ measures table structure. CDM↑ evaluates formulas.

Results Analysis

First, a compact model can be competitive when the interface is simple and the training signal is targeted. On olmOCR, Falcon OCR performs strongly on multi-column documents and tables, and is competitive overall against substantially larger systems. Second, evaluation on full-page parsing is sensitive to matching and representation details. On OmniDocBench, the table and formula metrics depend not only on recognition quality but also on how predicted elements are matched to ground truth and how output structure is normalized.

More broadly, these results suggest that an early-fusion single-stack Transformer can be a viable alternative to the common "vision encoder plus text decoder" recipe for OCR. We do not view this as a finished answer, but as a promising direction: one early-fusion backbone, a shared parameter space between text and images, a single decoding interface, and better data and training signals, rather than increasingly complex pipelines. To our knowledge, this is among the first demonstrations that this early-fusion recipe can reach competitive document OCR accuracy at this scale, and we hope it encourages further work in this direction.

Serving Throughput

Measured on a single A100-80GB GPU with vLLM, processing document images from olmOCR-Bench under high concurrency for optimal vLLM utilization.

  • Layout + OCR — The full end-to-end pipeline: layout detection finds regions on each page, crops them, and vLLM runs OCR on every crop. This represents the real-world serving throughput, inclusive of both layout detection and OCR time.
Modetok/simg/sDescription
Layout + OCR5,8252.9Full pipeline: layout detection → crop → per-region OCR

At 270M (+30M with layout model) parameters, Falcon OCR is roughly 3× smaller than 0.9B-class OCR VLMs (e.g., PaddleOCR VL), which translates directly into higher serving.

Limitations

  • Old scans and tiny text: Heavily degraded scans and very small glyphs remain challenging. These cases often require higher effective resolution and better coverage in the training mixture.
  • Non-unique table representations: Visually identical tables can be encoded in structurally different HTML forms, which can affect tree-based metrics.
  • Formula matching sensitivity: LaTeX and Unicode conventions can be penalized differently depending on the benchmark normalization and matching pipeline.

Examples

Falcon OCR 1.5

v1.5 improves real-world captures, complex tables, handwriting, and degraded documents (faded scans, historical pages) over v1 — while keeping the same 270M early-fusion architecture.

Falcon OCR 1.0

Click each section below to expand.

vLLM Server

We also provide a Docker-based vLLM-backed inference server capable of serving approximately 6,000 tokens per second.

Single Docker image with two services:

ServiceDefault PortDescription
vLLM8000Falcon-OCR vision-language model (OpenAI-compatible API)
Pipeline5002Full document parsing: layout detection → crop → OCR → markdown

The layout model runs inside the pipeline process — it is not a standalone service.

Quick Start

Prefer end-to-end parsing (skip_layout: true) for most documents; use layout mode only for very dense pages.

docker run -d --name falcon-ocr \
  --gpus '"device=0,1"' \
  -e EXPOSED_GPU_IDS=0,1 \
  -e VLLM_GPU=0 \
  -e PIPELINE_GPU=1 \
  -e VLLM_GPU_MEM_UTIL=0.90 \
  -p 8000:8000 \
  -p 5002:5002 \
  ghcr.io/tiiuae/falcon-ocr:latest

API

curl http://localhost:8000/health      # vLLM
curl http://localhost:5002/health      # Pipeline

The easiest way to send files. Supports images and multi-page PDFs:

# Single image
curl -X POST http://localhost:5002/falconocr/upload \
  -F "files=@photo.jpg;type=image/jpeg"
# PDF document
curl -X POST http://localhost:5002/falconocr/upload \
  -F "files=@document.pdf;type=application/pdf"

Send the full image directly to the VLM:

curl -X POST http://localhost:5002/falconocr/parse \
  -H "Content-Type: application/json" \
  -d '{
    "images": ["data:image/jpeg;base64,<...>"],
    "skip_layout": true
  }'

Send base64-encoded images for layout detection, cropping, and OCR:

curl -X POST http://localhost:5002/falconocr/parse \
  -H "Content-Type: application/json" \
  -d '{
    "images": ["data:image/jpeg;base64,<...>"],
    "skip_layout": false
  }'

Response:

{
  "json_result": [[{
    "index": 0,
    "mapped_label": "text",
    "content": "The Manuscript",
    "bbox": [273, 273, 937, 380],
    "score": 0.3145
  }]],
  "markdown_result": "The Manuscript",
  "total_output_tokens": 93,
  "processing_time_ms": 414
}
curl -X POST http://localhost:8000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "falcon-ocr",
    "messages": [{"role": "user", "content": [
      {"type": "image_url", "image_url": {"url": "data:image/png;base64,<...>"}},
      {"type": "text", "text": "Extract the text content from this image.\n<|OCR_PLAIN|>"}
    ]}],
    "max_tokens": 2048
  }'

Configuration

All settings are controlled via environment variables at docker run time.

VariableDefaultDescription
VLLM_GPU0Host GPU ID for the vLLM process
PIPELINE_GPU0Host GPU ID for the pipeline (layout model)
EXPOSED_GPU_IDS(all visible)Comma-separated host GPU IDs passed via --gpus (for index remapping)
VariableDefaultDescription
VLLM_PORT8000Port for the vLLM OpenAI-compatible API
PIPELINE_PORT5002Port for the pipeline API
VariableDefaultDescription
VLLM_GPU_MEM_UTIL0.90Fraction of GPU memory vLLM can use
MAX_NUM_SEQS2048Max concurrent sequences in vLLM
MAX_MODEL_LEN16384Max model context length
DTYPEbfloat16Model dtype
MAX_NUM_BATCHED_TOKENS(auto)Max batched tokens per iteration
CHUNKED_PREFILLfalseEnable chunked prefill
VariableDefaultDescription
LAYOUT_BATCH_SIZE64Batch size for layout detection inference
VariableDefaultDescription
FALCON_OCR_MODEL/models/Falcon-OCRPath to Falcon-OCR VLM weights (inside container)
SERVED_MODEL_NAMEfalcon-ocrModel name exposed by vLLM API

Deployment Modes

vLLM on one GPU, layout model on another — zero GPU contention:

docker run -d --name falcon-ocr \
  --gpus '"device=3,4"' \
  -e EXPOSED_GPU_IDS=3,4 \
  -e VLLM_GPU=3 \
  -e PIPELINE_GPU=4 \
  -e VLLM_GPU_MEM_UTIL=0.90 \
  -p 8000:8000 \
  -p 5002:5002 \
  ghcr.io/tiiuae/falcon-ocr:latest

Both services share one GPU — tune VLLM_GPU_MEM_UTIL to leave room for the layout model:

docker run -d --name falcon-ocr \
  --gpus '"device=0"' \
  -e EXPOSED_GPU_IDS=0 \
  -e VLLM_GPU=0 \
  -e PIPELINE_GPU=0 \
  -e VLLM_GPU_MEM_UTIL=0.55 \
  -e LAYOUT_BATCH_SIZE=32 \
  -e MAX_NUM_SEQS=512 \
  -p 8000:8000 \
  -p 5002:5002 \
  ghcr.io/tiiuae/falcon-ocr:latest
docker run -d --name falcon-ocr \
  --gpus '"device=0,1"' \
  -e EXPOSED_GPU_IDS=0,1 \
  -e VLLM_GPU=0 \
  -e PIPELINE_GPU=1 \
  -e VLLM_PORT=18000 \
  -e PIPELINE_PORT=15002 \
  -p 18000:18000 \
  -p 15002:15002 \
  ghcr.io/tiiuae/falcon-ocr:latest

Docker --gpus "device=3,4" makes the container see GPUs as local indices 0,1. EXPOSED_GPU_IDS=3,4 allows you to reference host GPU IDs (VLLM_GPU=3, PIPELINE_GPU=4); the entrypoint remaps them to the correct container-local indices.

Citation

If you use Falcon OCR, please cite:

@article{bevli2026falcon,
  title   = {Falcon Perception},
  author  = {Bevli, Aviraj and Chaybouti, Sofian and Dahou, Yasser and Hacid, Hakim and Huynh, Ngoc Dung and Le Khac, Phuc H. and Narayan, Sanath and Para, Wamiq Reyaz and Singh, Ankit},
  journal = {arXiv preprint arXiv:2603.27365},
  year    = {2026},
  url     = {https://arxiv.org/abs/2603.27365}
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers

Можно запустить

Подбираем GPU…

Класс архитектуры
FalconOCRForCausalLM
Ревизия весов
fe757d5

0 моделей