Introduction
As Large Language Models (LLMs) evolve to support context windows exceeding 100,000 tokens, the challenge of evaluating their true comprehension of book-length documents has intensified. Traditional benchmarks often rely on "needle-in-a-haystack" tests, which measure simple retrieval rather than narrative understanding, or require prohibitively expensive human annotation. To bridge this gap, we introduce HAMLET, a holistic and automated framework designed to evaluate multi-level comprehension in long-context LLMs.
The HAMLET Framework
HAMLET operates by structuring source texts into a hierarchical "Key-fact Tree," which categorizes information into three levels of abstraction: Root (overarching themes), Branch (supporting subtopics), and Leaf (fine-grained details). This structure allows for a granular assessment of how models navigate between the "forest" and the "trees."
The framework follows a three-stage pipeline:
- Query Construction: Source documents are segmented into chunks. An LLM extracts a hierarchy of facts to build the Key-fact Tree and generates specific analytical or narrative queries.
- Summary Generation: The target LLM processes the entire document to answer these queries, forcing it to synthesize information across the full context.
- Automated Evaluation: An LLM-as-a-judge evaluates the generated summaries against the localized Key-fact Tree, measuring both Recall (information retrieval) and Faithfulness (absence of hallucinations).
Experimental Setup and Dataset
To ensure the benchmark remains challenging and avoids data contamination, the researchers curated a dataset of 16 English novels published after January 2025. This collection averages 101,000 tokens per book and resulted in a benchmark of 814 unique queries and over 22,000 verified key-facts. This automated approach is approximately 25 times more cost-effective than human evaluation while maintaining over 90% agreement with expert human judgments.
Results and Analysis
Evaluation of state-of-the-art models reveals several critical insights into the current state of long-context comprehension:
The Detail Drop-off
While proprietary models like GPT-4o and Claude-3.5-Sonnet excel at identifying high-level (Root) themes, their performance significantly degrades when tasked with retrieving fine-grained (Leaf) details. This suggests that while models can grasp the general narrative arc, they struggle to maintain precision across massive contexts.
Positional Bias and Query Type
The study confirms the "lost-in-the-middle" phenomenon, where models show lower recall for information located in the center of a document compared to the beginning or end. This effect is particularly pronounced for Leaf-level details. Furthermore, "analytical" queries (focusing on reasoning and 'why') prove consistently more difficult for models than "narrative" queries (focusing on 'what happened').
Model Performance Gaps
Proprietary models consistently outperform open-source alternatives. While large open-source models like Llama-3.1-405B are competitive at the Root level, they lag behind in detail-oriented recall. Interestingly, the study found that reasoning-optimized models sometimes show lower raw recall than their standard counterparts, potentially indicating a trade-off between inference depth and information extraction.
Conclusion
HAMLET provides a scalable and reliable method for stress-testing LLMs on book-length contexts. By revealing the significant performance gap between high-level themes and fine-grained details, the framework highlights a critical area for future model development. Future work will focus on expanding the framework to multilingual contexts and exploring more complex metrics like cross-level abstraction ability.
Summary updated