A study measured the token cost of processing web pages for retrieval-augmented generation (RAG) pipelines and AI agents. The findings indicate that raw HTML pages are significantly token-inefficient, with a median of approximately 128,000 tokens. Converting these pages to LLM-oriented Markdown, after extracting only the main content and performing further cleanup, resulted in a median reduction of 98% fewer tokens compared to raw HTML and 63% fewer than full-page text. The study emphasizes that main-content extraction is the most impactful step in reducing token usage, with savings varying widely depending on the page's structure. AI
IMPACT Optimizing web page processing for LLMs can significantly reduce costs and improve retrieval accuracy in RAG systems.
RANK_REASON The item presents findings from a study measuring token efficiency for web pages processed by LLMs. [lever_c_demoted from research: ic=1 ai=1.0]
- DHL
- Federal Consumer Protection Agency
- Federal Environment Agency
- GPT-4o
- heise online
- MDN Web Docs
- MSN
- n-tv
- retrieval-augmented generation
- Siemens
- tiktoken
- T-Online
- Wikipedia
AI-generated summary · Google Gemini · from 1 sources. How we write summaries →