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.
Reader
copyright CC BY-NC 4.0
open_in_new Release Post

reader-lm-0.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: 494M
Input Token Length: 256K
Base Model help_outline
open_in_new
Qwen2-0.5B-Instruct
Trained Languages help_outline
2 languages
Supported Languages help_outline
29 languages
Related Models
link
reader-lm-1.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-0.5b is a 494M-parameter small language model specialized for converting messy HTML documents into clean, structured Markdown. It addresses a critical bottleneck in modern data pipelines: transforming web content for LLM consumption without brittle rule-based systems or resource-intensive large models. It achieves professional-grade HTML processing with a compact footprint, handling documents up to 256K tokens.

Methods

The model employs a 'shallow-but-wide' decoder-only architecture specifically optimized for selective-copy operations rather than creative text generation. It features 24 transformer layers with 896 hidden dimensions, 14 query heads, and 2 key-value heads (GQA configuration). Training involved two distinct stages: first, training on shorter, simpler HTML (32K tokens) to learn basic conversion patterns; second, training on complex, real-world HTML (128K tokens) to handle challenging cases with inline CSS, scripts, and complex DOM structures. The model incorporates contrastive search during training and implements a repetition detection mechanism to prevent degeneration issues like token loops. A zigzag-ring-attention mechanism enables handling of extremely long sequences up to 256K tokens while maintaining stable performance.

Performance

The model achieves a ROUGE-L score of 0.56, indicating strong content preservation, and maintains a low token error rate of 0.34, showing minimal hallucination. In qualitative evaluations across 22 diverse HTML sources (news articles, blog posts, e-commerce pages in multiple languages), it shows particular strength in structure preservation and Markdown syntax usage. It excels at handling complex modern web pages where inline CSS and scripts can expand to hundreds of thousands of tokens — a scenario where traditional rule-based approaches (BeautifulSoup, Readability) often fail. However, it may require additional processing for highly dynamic or JavaScript-heavy pages where content is rendered client-side.

Best Practice

The model works best with raw HTML input and doesn't require special prefixes or instructions. For optimal performance, implement the provided repetition detection mechanism to prevent token loops in output generation. The model supports multiple languages and various HTML structures, but is specifically designed for content extraction and Markdown conversion — do not use it for text generation, summarization, or direct question answering. Available through AWS SageMaker for production deployment and via a Google Colab notebook for experimentation. While the model handles documents up to 256K tokens, processing very large inputs may require additional memory management. For production workloads, CUDA-capable GPU is recommended. For higher accuracy, use reader-lm-1.5b or ReaderLM-v2. For JSON extraction, use ReaderLM-v2 which supports multi-objective optimization for both Markdown and JSON output.

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.