TL;DR
NeuSym-RAG bridges the gap between fuzzy semantic search and precise structured queries by unifiying neural and symbolic retrieval into a single, interactive framework for PDF question answering. By parsing semi-structured PDFs into a tightly coupled relational database and vectorstore, it enables large language model (LLM) agents to iteratively gather multi-view context. This hybrid approach yields massive performance gains over classic RAG, particularly on complex queries involving tables, formulas, and document structure.
What Problem Does This Paper Address?
Traditional Retrieval-Augmented Generation (RAG) relies heavily on neural retrieval, where documents are chopped into fixed-length text chunks and matched against user queries using vector embeddings. While excellent for fuzzy semantic matching, this approach fails spectacularly on precise queries that require mathematical operations, structural awareness, or aggregations (e.g., "How many tables are in the Experiment section?").
Conversely, symbolic retrieval (such as Text-to-SQL) excels at precise data extraction from structured databases but breaks down when confronted with semantic variations or fuzzy text matching. Furthermore, standard flat-chunking strategies completely ignore the rich layout and hierarchical structure inherent to PDF documents, such as sections, tables, figures, and formulas.
The authors introduce NeuSym-RAG to resolve this dichotomy, creating a unified framework that utilizes both retrieval paradigms interactively while preserving the multi-view layout of PDF files.
Methods
NeuSym-RAG operates in three distinct stages:
- Multiview Document Parsing: Raw PDFs are processed through a pipeline that extracts metadata via scholar APIs, segments text across multiple granularities (pages, sections, and fixed-length chunks) using PyMuPDF, and extracts paratextual elements (tables, figures, formulas) via OCR tools like MinerU. This rich, structured data is populated into a relational database (DuckDB).
- Multimodal Vector Encoding: Long-form text fields and visual bounding boxes from the database are vectorized using embedding models and stored in a vectorstore (Milvus). Crucially, each vector entry maintains a strict one-to-one mapping back to its corresponding database row using a unique triplet identifier (table name, column name, and primary key).
- Iterative Agent Interaction: To answer a question, an LLM agent uses the ReAct (Reasoning and Acting) framework to interact with the hybrid environment over multiple turns. The agent can execute five parameterized actions:
RETRIEVEFROMVECTORSTORE: For semantic fuzzy matching.RETRIEVEFROMDATABASE: For executing precise SQL queries.VIEWIMAGE: For cropping and sending specific PDF regions to a Vision-Language Model (VLM).CALCULATEEXPR: A Python-based calculator to prevent math hallucinations.GENERATEANSWER: The terminal action to output the final response.
Datasets
The framework was evaluated on three full-PDF QA benchmarks:
- AIRQA-REAL: A newly introduced, human-annotated dataset containing 553 complex questions based on 6,797 academic papers from ACL, ICLR, and arXiv. It covers single-doc details, multi-doc analysis, and paper retrieval across text, tables, images, formulas, and metadata. It features an execution-based evaluation with 18 precise functions.
- M3SciQA & SciDQA: Two existing scientific QA datasets that the authors converted into their structured format to validate the universality of NeuSym-RAG.
Key Insights and Ideas
- Neuro-Symbolic Synergy: The agent can dynamically chain retrieval types. For example, it can execute a SQL query to filter relevant rows by metadata, and then feed those specific primary keys into the vectorstore's filter parameter to perform a localized semantic search.
- The Power of Multi-View Chunking: Retaining structural boundaries (like sections and pages) allows the model to answer layout-dependent questions that are impossible to resolve with standard sequential token chunking.
- Reasoning vs. Formatting Constraints: In ablation studies, specialized reasoning models (like the R1-Distill series) struggled with strict action-formatting constraints despite generating high-quality internal thoughts, highlighting a common trade-off in post-training instruction tuning.
Key Results
- Outperforming Classic RAG: NeuSym-RAG consistently outperformed classic RAG across all models, achieving a minimum 17.3% absolute improvement on the AIRQA-REAL dataset.
- Open-Source Excellence: When powered by open-source VLMs like Qwen2.5-VL-72B-Instruct, NeuSym-RAG boosted overall accuracy by 29.1% compared to classic RAG, even surpassing closed-source alternatives like GPT-4o-mini by 8.9%.
- Multi-Turn Advantage: Iterative, agentic retrieval methods stably defeated two-stage (single-shot retrieval) baselines, proving that allowing the agent to refine its strategy based on intermediate observations is critical for complex QA.
Limitations and Future Work
- Pre-processing Overhead: The multi-view parsing and OCR pipeline is computationally heavy and slow, making it less ideal for scenarios requiring real-time uploads of unindexed PDFs.
- Inference Latency: Multi-turn agentic loops naturally introduce higher time delays and API costs compared to standard single-shot RAG.
- Structural Dependency: The framework relies on documents possessing some degree of implicit layout or structure (like academic papers). The authors plan to expand their evaluation to other structured domains, such as financial reports and legal documents, in future work.
Summary updated