Elastic
Jina AI
Models
API
keyboard_arrow_down
Reader
Convert any URL to Markdown for better grounding LLMs.
Embeddings
Multimodal multilingual embeddings.
Reranker
Reranker for maximizing search relevance.
MCP
terminal
CLI
article
llms.txt
smart_toy
Agents
data_object
Schema
menu_book
Docs
Log in
login
warning
This model is deprecated by newer models.
Data Ingestion
copyright CC BY-NC 4.0
open_in_new Release Post

reader-lm-1.5b

A small language model for converting raw HTML into markdown
License
copyright CC-BY-NC-4.0
Release Date
calendar_month
2024-08-11
Input
abc
Text (HTML)
arrow_forward
Output
abc
Text (Markdown)
Model Details
Parameters: 1.54B
Input Token Length: 256K
Base Model help_outline
open_in_new
Qwen2-1.5B-Instruct
Trained Languages help_outline
2 languages
Supported Languages help_outline
29 languages
Related Models
link
reader-lm-0.5b
Available via
AWS SageMaker
Microsoft Azure
Hugging Face
Air-gapped
I/O graph

HTML

reader-lm

Markdown

Choose models to compare

Overview

reader-lm-1.5b is a 1.54B-parameter small language model that converts complex HTML documents into clean Markdown, outperforming models 50× its size including GPT-4 and Gemini-1.5-Pro on HTML-to-Markdown conversion. It handles documents up to 256K tokens natively, eliminating the need for expensive chunking operations. The model's 'shallow-but-wide' architecture is optimized for selective-copy operations, achieving high accuracy without the computational overhead of general-purpose LLMs.

Methods

The model employs a 'shallow-but-wide' decoder-only architecture: 28 transformer layers with 12 query heads and 2 key-value heads (GQA), 1536 hidden dimensions, and 8960 intermediate dimensions. This configuration challenges the conventional wisdom that deeper models are always better — for selective-copy tasks like HTML-to-Markdown, width (more parameters per layer) is more effective than depth (more layers). Training followed two stages: (1) short-and-simple HTML (32K tokens) for basic conversion patterns, (2) long-and-hard HTML (128K tokens) for real-world complexity. The zigzag-ring-attention mechanism enables 256K-token processing. Contrastive search and repetition detection prevent common small-LM pathologies like degeneration and token loops.

Performance

The model achieves ROUGE-L of 0.72 and Token Error Rate of 0.19, significantly outperforming GPT-4 (0.43 ROUGE-L, 0.50 TER) and Gemini-1.5-Pro (0.42 ROUGE-L, 0.48 TER) on HTML-to-Markdown conversion. Qualitative evaluations across four key dimensions — header extraction, main content extraction, rich structure preservation, and Markdown syntax usage — show consistent high accuracy across diverse document types: news articles, blog posts, landing pages, and forum posts. The model handles multiple languages including English, German, Japanese, and Chinese. This performance is achieved while processing documents up to 256K tokens, eliminating chunking overhead that larger models typically require.

Best Practice

Use this model for complex HTML document processing where accuracy and efficiency are paramount. It requires CUDA-capable GPU infrastructure for optimal performance but runs on more modest hardware than general-purpose LLMs. Available through AWS SageMaker and Azure Marketplace. The model is specifically optimized for HTML-to-Markdown conversion and is not suitable for general-purpose text generation or other NLP tasks. When processing extremely long documents (approaching 512K tokens), performance may degrade as this exceeds the model's training range (256K). Implement the provided repetition detection mechanisms and consider using contrastive search during inference to maintain output quality. For JSON extraction alongside Markdown, use ReaderLM-v2 which supports multi-objective optimization.

Blogs that mention this model
January 15, 2025 • 17 minutes read
ReaderLM v2: Frontier Small Language Model for HTML to Markdown and JSON
ReaderLM-v2 is a 1.5B small language model for HTML-to-Markdown conversion and HTML-to-JSON extraction with exceptional quality.
Jina AI
Orange text "ReaderLM-u2" on a vibrant dark red digital screen.
September 11, 2024 • 13 minutes read
Reader-LM: Small Language Models for Cleaning and Converting HTML to Markdown
Reader-LM-0.5B and Reader-LM-1.5B are two novel small language models inspired by Jina Reader, designed to convert raw, noisy HTML from the open web into clean markdown.
Jina AI
Technical screenshot displaying "REAPER-LM-0.5B/1.5B" with HTML source code for Jina's search grounding feature.
Current language / theme
Search Foundation
Reader
Embeddings
Reranker
Get Jina API key
Rate limit
About us
News
Download Jina logo
open_in_new
Download Elastic logo
open_in_new
API Status
Elastic © 2026.SecurityTerms & ConditionsPrivacyManage CookiesDo Not Sell or Share My Personal Information
This website and all associated content, software, products, and services are intended for professional use only. No consumer use is intended or directed.