HyperAIHyperAI

Command Palette

Search for a command to run...

تقطيع المستندات المدرك للاسترجاع (D-RAC): استيعاب شامل مدرك للاسترجاع لمستندات المؤسسات عبر التطبيع إلى PDF والتحويل متعدد الوسائط إلى Markdown

Uday Allu Abhivanth Sivaprakash Pratik Singh Aman Manocha

الملخص

يتعين على أنظمة التوليد المعزز بالاسترجاع (RAG) التي تعمل على قواعد المعرفة المؤسسية أن تستوعب صيغ مستندات غير متجانسة — ملفات PDF ومستندات Word والعروض التقديمية والمستندات الممسوحة ضوئيًا — حيث يكون محتواها محبوسًا داخل تخطيطات بصرية معقدة وصفحات متعددة الأعمدة وجداول كثيفة. تعتمد خطوط أنابيب الاستيعاب التقليدية على استخراج النص القائم على القواعد أو التعرّف الضوئي على الحروف (OCR)، وهو ما يُفسد في كثير من الأحيان ترتيب القراءة ويُسطّح الجداول ويتسبب في فقدان التسلسل الهرمي للعناوين، مما يُضعف جودة الاسترجاع اللاحق. أما التقطيع المعتمد كليًا على الوكلاء فوق النص المستخرج الخام فيستعيد بعضًا من التماسك الدلالي، لكنه يترتب عليه تكاليف رموز مرتفعة وخطر الهلوسة. نقدم في هذه الورقة تقطيع المستندات المدرك للاسترجاع (D-RAC)، وهو امتداد لإطار عملنا لتقطيع الويب المدرك للاسترجاع (W-RAC) ليشمل أي صيغة من صيغ المستندات. يقوم D-RAC أولًا بتطبيع أي مستند مُدخل — سواء كان ملف DOCX أو ملف PPTX أو ملف XLSX أو صورة ممسوحة ضوئيًا أو ملف PDF أصلي — إلى PDF، مستفيدًا من أن كل صيغة مستندات تقريبًا تمتلك تصيير PDF مطابقًا وحتميًا. ثم يُجري مرورًا واحدًا عبر نموذج لغوي كبير متعدد الوسائط يحوّل الصفحات المُصيَّرة إلى Markdown محسّن للاسترجاع — بحيث تُطبَّع الجداول في صورة عبارات نثرية قائمة بذاتها مع الحفاظ على التسلسل الهرمي للعناوين — وبعد ذلك يسير التقطيع تمامًا كما في W-RAC: تحليل حتمي إلى وحدات قابلة للعنونة بالمعرفات، يليه تخطيط تقطيع خفيف قائم على نموذج لغوي كبير فوق المعرفات بدلًا من النص. لا يُعاد توليد النص المصدر أبدًا أثناء التقطيع، مما يحافظ على مزايا W-RAC من حيث التكلفة والحتمية وقابلية الملاحظة، مع فتح المجال لكل صيغة مستندات قابلة للتصيير لتكون مدخلًا من الدرجة الأولى. على المجموعة الفرعية من ملفات PDF المكوّنة من 236 مستندًا و795 صفحة ضمن الاختبار المعياري RAG-Multi-Corpus — التي تغطي مجالات السيارات والمجال الأكاديمي والخدمات السحابية وتكنولوجيا المؤسسات والخدمات المصرفية — يحوّل D-RAC المجموعة الكاملة ويقطّعها في 72 دقيقة دون أي أخطاء، وينتج 1,748 مقطعًا جاهزًا للاسترجاع. وبالمقارنة مع التقطيع المعتمد على الوكلاء باستخدام نماذج لغوية كبيرة رائدة، يقلل D-RAC رموز الإخراج في مرحلة التقطيع بنسبة 95.7%، ويخفض تكلفة التقطيع بنسبة 77.8% وفق تسعير GPT-4.1 وبنسبة 85.6% وفق تسعير Gemini 2.5 Pro، ويقلل زمن التقطيع بنسبة 75%. كما يتوسع D-RAC خطيًا مع مستندات تزيد عن 500 صفحة.

One-sentence Summary

Researchers at Yellow.ai propose Document Retrieval-Aware Chunking (D-RAC), which extends W-RAC by normalizing heterogeneous enterprise documents to PDF and applying a single multimodal LLM pass to produce retrieval-optimized Markdown, followed by deterministic ID-addressable parsing and lightweight identifier-based chunk planning without source-text regeneration; on the 236-document, 795-page PDF subset of the RAG-Multi-Corpus benchmark, D-RAC converts and chunks the corpus in 72 minutes with zero errors, producing 1,748 retrieval-ready chunks, and compared to agentic chunking it reduces chunking-stage output tokens by 95.7%, cuts cost by 77.8% under GPT-4.1 pricing and 85.6% under Gemini 2.5 Pro pricing, and reduces chunking time by 75%.

Key Contributions

  • Document Retrieval-Aware Chunking (D-RAC) extends retrieval-aware chunking from web content to arbitrary enterprise documents by normalizing DOCX, PPTX, XLSX, scanned images, and native PDFs into PDF and applying a single multimodal LLM pass to convert rendered pages into retrieval-optimized Markdown with preserved heading hierarchy and self-contained prose table statements.
  • The chunking stage parses the converted Markdown into ID-addressable units and performs lightweight LLM-based chunk planning over identifiers only, so source text is never regenerated during chunking and the one-time conversion cost is decoupled from repeatable re-chunking.
  • On the 236-document, 795-page PDF subset of RAG-Multi-Corpus, D-RAC converts and chunks the corpus in 72 minutes with zero errors and 1,748 retrieval-ready chunks; compared with agentic chunking, it reduces chunking-stage output tokens by 95.7%, chunking cost by 77.8% under GPT-4.1 pricing and 85.6% under Gemini 2.5 Pro pricing, and chunking time by 75%, while scaling linearly to documents over 500 pages.

Introduction

Retrieval-Augmented Generation has become the standard way to ground large language models in enterprise knowledge, but enterprise corpora are dominated by PDFs whose presentation-oriented layout breaks conventional text extraction. Prior work, Web Retrieval-Aware Chunking (W-RAC), reduced chunking cost and latency by planning chunk boundaries over deterministic identifiers, yet it assumed recoverable HTML-like structure and therefore could not handle PDFs, while rule-based, OCR/layout-analysis, and agentic alternatives either inherit extraction artifacts or pay repeated text-generation costs. The authors introduce D-RAC, which normalizes any input document to PDF and adds one retrieval-aware multimodal pass that converts rendered pages into structured Markdown, allowing the unchanged W-RAC pipeline to ingest arbitrary enterprise documents.

Dataset

The authors use the PDF subset of RAG-Multi-Corpus, the benchmark introduced with W-RAC, for evaluation.

Dataset composition and sources

  • Main evaluation corpus: 236 PDF documents totaling 795 pages across five fictional enterprise organizations in distinct industry verticals.
  • Document types reflect enterprise knowledge base content: product sheets, FAQs, policy and procedure documents, parts catalogs, and service guides.
  • Formatting is table-heavy and layout-rich, typical of each domain.

Query subset

  • 762 curated queries with supporting-fact ground truth are used for retrieval evaluation.
  • Queries cover four of the five organizations; CloudWay-24 has no annotated queries in the reference set.
  • Queries are categorized into seven types to test factual recall, reasoning, comparison, and procedural understanding.
  • Each query is annotated with one or more supporting facts: verbatim snippets from the source documents and their originating file.

Processing and usage

  • Because all inputs are natively PDF, Stage 1 normalization is treated as identity.
  • A separate 503-page financial prospectus is used as a scalability stress test.
  • Processing uses AWS Bedrock with temperature 0.1.
  • Conversion uses a maximum of 8,192 output tokens per batch and chunk planning of 16,384 tokens per section call.
  • Documents are processed in 5-page batches with 5 parallel workers.

The provided excerpt focuses on evaluation data. It does not describe training splits, mixture ratios, filtering rules, or cropping strategies.

Method

The authors propose Document Retrieval-Aware Chunking (D-RAC), a pipeline designed to convert heterogeneous documents into retrieval-optimized chunks. The system architecture comprises four distinct stages: normalize and render, convert, parse and section, and plan and reconstruct.

Refer to the framework diagram for the overall pipeline structure.

In the first stage, the authors ensure format agnosticism by treating PDF as the universal visual interchange format. Any input document that is not already a PDF is converted using standard deterministic tooling. Each page of the normalized PDF is then rendered to a PNG image at 200 DPI, downscaled to ensure no dimension exceeds 1,568 pixels to match common vision-encoder input limits. This step is entirely deterministic and involves no LLM calls.

The second stage involves multimodal Markdown conversion. Rendered pages are grouped into batches and sent to a multimodal LLM. The conversion prompt enforces strict retrieval-aware output rules. Text content is preserved verbatim, and explicit hierarchy is reconstructed using Markdown heading levels. Crucially, the system applies retrieval-aware table normalization. Instead of using Markdown table syntax, every table row is transformed into a self-contained sentence using column headers as context.

As shown in the figure below, this row-level table prose ensures that every tabular fact becomes an independently embeddable statement.

The authors explicitly forbid collapsing multiple rows into disjunctive sentences to prevent precision loss during retrieval. Image suppression is also applied to omit logos and decorative graphics, preventing hallucinated captions from polluting the index.

In the third stage, the converted Markdown undergoes deterministic parsing and sectioning. The text is parsed into ID-addressable elements, such as headers and content blocks. For documents exceeding a planning budget, a recursive sectioning algorithm splits the element sequence at header boundaries. Each section is accompanied by its parent-header context, allowing the planner to understand the document hierarchy without re-sending content.

The final stage focuses on LLM chunk planning and reconstruction. The LLM receives only element IDs, truncated text previews, and hierarchy metadata, returning chunk plans as ordered ID lists. The planner is instructed to group content blocks around single topics and reuse header IDs across chunks for context. Coverage is verified programmatically to guarantee lossless ingestion. Final chunks are reconstructed locally by mapping IDs back to the verbatim converted text. Each chunk is prefixed with its full ancestor-heading chain and annotated with a human-readable breadcrumb before being embedded and indexed. Because the converted Markdown and element IDs are persisted, retrieval strategy changes require only re-planning, avoiding the need for re-conversion or re-OCR of the source PDF.

Experiment

The evaluation uses the PDF subset of RAG-Multi-Corpus across five enterprise domains, with 762 annotated queries covering seven reasoning types. Experiments show that D-RAC converts all documents without errors and scales linearly on a large stress test, while chunk planning remains inexpensive, stable, and lossless. Retrieval results indicate D-RAC outperforms fixed-size parsing and matches or exceeds agentic chunking, especially on boundary-sensitive query types, with consistent performance across domains. Cost analysis further shows D-RAC reaches this quality at a fraction of agentic chunking cost by minimizing output tokens and avoiding prose regeneration.

D-RAC achieves the highest structure recovery and retrievability among the compared ingestion strategies while keeping chunking output costs very low and avoiding prose generation. It matches or exceeds agentic chunking on overall metrics even though it processes rendered PDF pages, and its planning-only re-chunking scales more efficiently than full regeneration. The approach is stable across domains and shows the largest quality gains on boundary-sensitive query types. D-RAC is the only strategy with high structure recovery, high retrievability, and high scalability to large page counts at the same time. Agentic chunking incurs high LLM output cost and some hallucination risk, while D-RAC reduces output to planning-only identifiers with very low to no hallucination surface. D-RAC matches or exceeds agentic chunking across all seven overall metrics despite working from rendered PDF pages, the hardest input format. The largest gains appear for temporal, comparative, and analytical queries, while boolean queries remain an edge case where agentic chunking retains an advantage.

The evaluated PDF subset spans five fictional enterprise domains and includes realistic table-heavy documents such as product sheets, FAQs, policy documents, parts catalogs, and service guides. D-RAC matches or exceeds agentic chunking on overall retrieval metrics while working directly from rendered PDF pages, with the largest gains on temporal, comparative, and analytical queries. Its planning stage also cuts output tokens and processing time substantially compared with agentic rewriting, while recall remains stable across domains. The evaluated subset spans five fictional enterprise domains, with banking and academia contributing the heaviest page loads and cloud services the lightest. The documents mirror realistic enterprise knowledge base content, including product sheets, FAQs, policy documents, parts catalogs, and service guides, with table-heavy layouts. D-RAC matches or exceeds agentic chunking on overall retrieval metrics despite working from rendered PDF pages rather than clean structured sources. Temporal, comparative, and analytical queries gain the most from topic-coherent chunk boundaries; boolean queries are the one area where agentic chunking remains ahead. Recall stays consistent across organizations, indicating the pipeline does not overfit to a particular document style. D-RAC's planning output is far smaller than agentic rewriting, so output token costs collapse and processing time drops substantially.

The evaluated query set spans seven categories designed to balance factual recall, reasoning, comparison, and procedural understanding. Procedural questions form the largest category, while temporal questions are the smallest. Retrieval gains from topic-coherent chunking are most pronounced for temporal, comparative, and analytical queries, though boolean queries remain the one category where agentic chunking retains an edge. Procedural queries form the largest category, followed by comparative and descriptive questions. Temporal queries are the smallest category but benefit most from topic-coherent chunk boundaries and row-level table prose. Boolean queries are the sole category where agentic chunking keeps an advantage over topic-coherent chunking.

Across five organizations, the corpus of 236 PDF documents and 795 pages converted into roughly one million characters of Markdown with zero errors. Average file conversion times ranged from about 12 to 22 seconds, and page-level throughput varied by organization, with Cendara University being the fastest per page and Velvera Technologies the slowest. Rendering overhead was minimal, with multimodal inference dominating conversion cost. All 236 documents converted without a single error, including parts catalogs, fee-schedule tables, and multi-column product sheets. Page rendering was negligible, while multimodal inference was the main driver of conversion time and scaled across parallel page batches.

Chunk planning covers every content element exactly once with zero chunking errors, and it remains inexpensive relative to conversion and agentic chunking because the planner outputs only ID arrays. Average chunk sizes stay within a stable, dense retriever friendly range across organizations without hard size limits. Planning cost is a small fraction of conversion time and much lower than agentic chunking, driven by minimal ID-only output. Chunk sizes remain stable and retriever-friendly across organizations, averaging between about 580 and 850 characters.

The experiments evaluate D-RAC against agentic and other chunking strategies on a table-heavy enterprise PDF corpus spanning five fictional domains and on a query set covering factual, procedural, comparative, temporal, and boolean questions. D-RAC validates that planning-only, identifier-based chunking recovers document structure most accurately, preserves retrievability, and scales to large page counts without prose generation or high LLM output cost. It matches or exceeds agentic chunking on overall retrieval quality even from rendered PDF pages, with the largest gains for temporal, comparative, and analytical queries and stable recall across domains, while boolean queries remain the one category where agentic chunking retains an edge. The pipeline also shows high reliability in practice, with error-free document conversion, negligible rendering overhead dominated by multimodal inference, and inexpensive zero-error chunk planning that yields stable retriever-friendly chunk sizes.


بناء الذكاء الاصطناعي بالذكاء الاصطناعي

من الفكرة إلى الإطلاق — سرّع تطوير الذكاء الاصطناعي الخاص بك مع المساعدة البرمجية المجانية بالذكاء الاصطناعي، وبيئة جاهزة للاستخدام، وأفضل أسعار لوحدات معالجة الرسومات.

البرمجة التعاونية باستخدام الذكاء الاصطناعي
وحدات GPU جاهزة للعمل
أفضل الأسعار

HyperAI Newsletters

اشترك في آخر تحديثاتنا
سنرسل لك أحدث التحديثات الأسبوعية إلى بريدك الإلكتروني في الساعة التاسعة من صباح كل يوم اثنين
مدعوم بواسطة MailChimp