Introduction
Processing extensive documents—such as complete books or technical papers—presents a significant challenge for Large Language Models (LLMs). While feeding an entire document into a model's context window provides high accuracy, it is computationally expensive due to the quadratic scaling of attention mechanisms. Conversely, traditional Retrieval-Augmented Generation (RAG) methods are efficient but often lack global context and struggle with multi-hop reasoning by retrieving a fixed number of chunks regardless of query complexity.
PECAN (Progress Control with Attention-Guided Hierarchical Weighted Graph) addresses this "Goldilocks" problem by combining the accuracy of LLMs with the efficiency of retrieval-based systems. It leverages the model's internal attention weights to build a semantic map and introduces a dynamic search mechanism that knows when to stop.
Methodology
PECAN operates through a two-stage process designed to optimize both information retrieval and processing efficiency.
1. Attention-Guided Hierarchical Weighted Graph (HWDAG)
Instead of flat text chunks, PECAN constructs a Hierarchical Weighted Directed Acyclic Graph. The document is distilled into "Information Points" (IPs)—concise, event-focused bullet points. The connections between these points are derived directly from the LLM’s internal attention weights during summarization. This approach captures complex many-to-many relationships, allowing high-level summaries to link precisely to multiple detailed sources across the document.
2. Dynamic Progress Control and KV Caching
Unlike standard RAG, which retrieves a static "Top-K" set of documents, PECAN employs Dynamic Progress Control. The LLM iteratively assesses whether the currently retrieved information is sufficient to answer the query. If the model returns a "No," the search continues deeper into the graph. To ensure this iterative process remains efficient, PECAN utilizes Key-Value (KV) caching, allowing the model to append new information to its memory without re-processing previously seen tokens.
Experimental Results
The researchers evaluated PECAN across four challenging benchmarks: NarrativeQA (books/scripts), Qasper (scientific papers), HotpotQA (multi-hop), and MuSiQue (complex multi-hop reasoning).
PECAN demonstrated state-of-the-art performance, significantly outperforming traditional RAG baselines (BM25, SBERT) and advanced tree-based methods like RAPTOR. Notably, on the NarrativeQA dataset, PECAN achieved an F1 score of 61.1, surpassing the 53.7 F1 score of a full-context Llama-3.1-8B model while being approximately 108x more computationally efficient (measured in TFLOPs).
Key Insights and Discussion
The success of PECAN stems from several innovative design choices:
- Attention as a Semantic Map: Using internal attention weights as graph edges provides a more nuanced representation of information flow than external embedding similarity.
- The "Stop" Signal: The dynamic progress control mimics human reading behavior, reallocating resources from simple queries to those requiring deeper reasoning.
- Event-Based Tracking: By focusing on event-based Information Points rather than arbitrary text blocks, the system navigates multi-hop dependencies more effectively.
Limitations and Future Work
Despite its advantages, PECAN faces challenges with "noisy" attention, where semantically insignificant words can influence graph edges. Future iterations may explore fine-grained weighting strategies and further optimize the one-time preprocessing cost of HWDAG construction for massive, frequently updated datasets.
Conclusion
PECAN represents a significant step forward in long-document QA, proving that hierarchical, attention-guided structures combined with dynamic control can deliver superior accuracy at a fraction of the computational cost of full-context LLM processing.
Summary updated