Lune

WWW2025Top-tier venue

HtmlRAG: HTML is Better Than Plain Text for Modeling Retrieved Knowledge in RAG Systems

Jiejun Tan, Zhicheng Dou, Wen Wang, Mang Wang, Weipeng Chen, Ji-Rong Wen

Abstract

Retrieval-Augmented Generation (RAG) has been shown to improve knowledge capabilities and alleviate the hallucination problem of LLMs. The Web is a major source of external knowledge used in RAG systems, and many commercial RAG systems have used Web search engines as their major retrieval systems. Typically, such RAG systems retrieve search results, download HTML sources of the results, and then extract plain texts from the HTML sources. Plain text documents or chunks are fed into the LLMs to augment the generation. However, much of the structural and semantic information inherent in HTML, such as headings and table structures, is lost during this plain-text-based RAG process. To alleviate this problem, we propose HtmlRAG, which uses HTML instead of plain text as the format of retrieved knowledge in RAG. We believe HTML is better than plain text in modeling knowledge in external documents, and most LLMs possess robust capacities to understand HTML. However, utilizing HTML presents new challenges. HTML contains additional content such as tags, JavaScript, and CSS specifications, which bring extra input tokens and noise to the RAG system. To address this issue, we propose HTML cleaning, compression, and a two-step block-tree-based pruning strategy, to shorten the HTML while minimizing the loss of information. Experiments on six QA datasets confirm the superiority of using HTML in RAG systems. Our code and datasets are available at https://github.com/plageon/HtmlRAG .

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

10 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Automatically Detecting Online Deceptive Patterns cites Training language models to follow instructions with human feedback
  • HierSearch: A Hierarchical Enterprise Deep Search Framework Integrating Local and Web Searches cites Self-RAG: Learning to Retrieve, Generate, and Critique through Self-Reflection
  • GPT-4V(ision) is a Generalist Web Agent, if Grounded cites Language Models can Solve Computer Tasks
  • Self-RAG: Learning to Retrieve, Generate, and Critique through Self-Reflection cites Training language models to follow instructions with human feedback
  • Self-RAG: Learning to Retrieve, Generate, and Critique through Self-Reflection cites Active Retrieval Augmented Generation
  • Language Models can Solve Computer Tasks cites Training language models to follow instructions with human feedback
  • Active Retrieval Augmented Generation cites Training language models to follow instructions with human feedback
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers10

  1. Quantifying and Improving the Robustness of Retrieval-Augmented Language Models Against Spurious Features in Grounding DataShiping Yang, Jie Wu, Wenbiao Ding, Ning Wu et al.ACL 2026 · 9 citations
  2. SAGEO Arena: A Realistic Environment for Evaluating Search-Augmented Generative Engine OptimizationSunghwan Kim, Wooseok Jeong, Serin Kim, Sangam Lee et al.KDD 2026 · 8 citations
  3. HierSearch: A Hierarchical Enterprise Deep Search Framework Integrating Local and Web SearchesJiejun Tan, Zhicheng Dou, Yan Yu, Jiehan Cheng et al.AAAI 2026 · 5 citations
  4. SCRIBES: Web-Scale Script-Based Semi-Structured Data Extraction with Reinforcement LearningShicheng Liu, Kai Sun, Lisheng Fu, Xilun Chen et al.ICLR 2026 · 2 citations
  5. Automatically Detecting Online Deceptive PatternsAsmit Nayak, Yash Wani, Shirley Zhang, Rishabh Khandelwal et al.CCS 2025

Builds on37

  1. Training language models to follow instructions with human feedbackLong Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida et al.NeurIPS 2022 · 24,707 citations
  2. Self-RAG: Learning to Retrieve, Generate, and Critique through Self-ReflectionAkari Asai, Zeqiu Wu, Yizhong Wang, Avirup Sil et al.ICLR 2024 · 1,798 citations
  3. Language Models can Solve Computer TasksGeunwoo Kim, Pierre Baldi, Stephen McAleerNeurIPS 2023 · 539 citations
  4. GPT-4V(ision) is a Generalist Web Agent, if GroundedBoyuan Zheng, Boyu Gou, Jihyung Kil, Huan Sun et al.ICML 2024 · 496 citations
  5. Active Retrieval Augmented GenerationZhengbao Jiang, Frank F. Xu, Luyu Gao, Zhiqing Sun et al.EMNLP 2023 · 315 citations

Related papers

  1. Careful Queries, Credible Results: Teaching RAG Models Advanced Web Search Tools with Reinforcement LearningYuqin Dai, Shuo Yang, Guoqing Wang, Yong Deng et al.AAAI 2026 · 5 citations
  2. METIS: Fast Quality-Aware RAG Systems with Configuration AdaptationSiddhant Ray, Rui Pan, Zhuohan Gu, Kuntai Du et al.SOSP 2025 · 3 citations
  3. Clue-RAG: Towards Accurate and Cost-Efficient Graph-Based RAG Via Multi-Partite Graph-Based IndexYaodong Su, Yixiang Fang, Yingli Zhou, Chuanhui YangICDE 2026
  4. Dynamic Graph Navigation via Triplet Chains for Structure-Aware Retrieval-Augmented GenerationFeng Zhao, Yufei Wu, Xianggan Liu, Ruilin ZhaoACL Findings 2026
  5. Graph-R1: Towards Agentic GraphRAG Framework via End-to-end Reinforcement LearningHaoran Luo, Haihong E, Guanting Chen, Qika Lin et al.ICML 2026 · 50 citations
Dusk over the sea between two cliffs drawn in fine vertical lines