TL;DR
Halo is a long-context question-answering (QA) framework that transforms passive prompt-engineered domain knowledge into active, executable pipeline operators. By structurally pruning documents, filtering chunks with small language models, and verifying answers against constraints, Halo improves QA accuracy by up to 13% while slashing API costs by up to 4.8×.
What Problem Does This Paper Address?
When querying massive documents—like 200,000-token financial reports or full-length novels—current LLM approaches face a harsh accuracy-cost tradeoff. Processing an entire document in a single frontier LLM call is prohibitively expensive and prone to "lost in the middle" hallucinations. Conversely, standard Retrieval-Augmented Generation (RAG) reduces token costs but introduces retrieval errors, often missing crucial context or delivering fragmented information.
Domain experts frequently try to mitigate this by adding explicit instructions to their prompts (e.g., "focus only on tables," "ignore legal disclosures"). However, standard systems treat this domain knowledge as passive prompt tokens. The LLM frequently ignores these instructions in long contexts, and because the entire text or RAG chunk pool is still processed, it provides zero cost reduction.
Methods
Halo shifts domain knowledge from passive text tokens into structured, executable database-style operators across a multi-stage query execution pipeline.
The framework operates in four main query-time stages:
- KnowledgeParser: An LLM extracts unstructured prompt instructions into a structured taxonomy of three directive types: Structural (where to look), Filter (what to ignore), and Validate (how to verify).
- ContextSelector (Structural Operator): Prunes the document's structure before chunking based on user guidance (e.g., isolating only tabular elements), drastically narrowing the initial search space.
- InferenceEngine (Filter Operator): Implements a model cascade. A highly efficient Small Language Model (SLM, ~4B parameters) evaluates chunks against semantic filter directives (e.g., identifying and discarding "risk disclosures") so that only relevant chunks are passed to the expensive frontier LLM.
- Verifier (Validate Operator): Eliminates downstream hallucinations by scoring chunk-level candidate responses against positive and negative constraints (e.g., promoting answers containing "diluted EPS" while penalizing those with "basic EPS") using embedding cosine similarity.
To ensure robustness against bad or imprecise user instructions, Halo includes a Fallback Manager. If an operator accidentally strips away the correct answer, Halo detects runtime anomalies—such as universal answer refusal ("answer not in context") or low validation score variance—and automatically disables the problematic operator to revert safely to baseline execution.
Datasets
The authors evaluated Halo across three distinct domains:
- DocFinQA: Financial SEC 10-K filings averaging 193,000 tokens, testing complex numerical reasoning.
- NovelQA: Full-length English novels averaging 230,000 tokens, focusing on single-hop narrative QA.
- QASPER: Academic NLP research papers averaging 7,000 tokens, evaluating information-seeking QA over shorter, highly structured text.
Key Insights and Ideas
- Instructions as Code, Not Tokens: Treating domain knowledge as explicit query optimization operators rather than text tokens forces deterministic execution, ensuring the system actually follows user constraints.
- Model Cascades for Context: Tiny, cheap SLMs make excellent semantic gatekeepers. Using a 4B model to filter out irrelevant chunks before calling a frontier LLM yields massive cost savings without sacrificing accuracy.
- Contrasting Constraints for Verification: Hallucinations often mimic the correct answer's format. By explicitly contrasting positive and negative user constraints, the system can accurately rank candidate responses without needing additional, expensive LLM validation calls.
Key Results
- Higher Accuracy, Lower Cost: On the DocFinQA dataset, Halo achieved up to 13% higher accuracy and a 4.8× reduction in cost compared to standard baselines.
- Bridging the Model Scale Gap: Remarkably, Halo enabled a lightweight open-source model (Qwen3-30B) to approach the accuracy of a frontier model (Claude Sonnet 4.5) at a 78× lower cost.
- Negligible Overhead: The extraction and execution of Halo's domain operators are highly optimized, accounting for a mere 2.04% of the total query cost.
Limitations and Future Work
While highly effective, Halo's fallback mechanism heavily relies on the underlying LLM's capacity to refuse to answer when context is missing. If a model confidently hallucinates instead of returning an "answer not in context" refusal, the context fallback will not trigger. Additionally, the Structural operator provides fewer benefits on unstructured narrative text (like novels) where information is evenly distributed.
The authors note that the framework is highly extensible, and future work includes developing additional specialized operators, such as NORMALIZE for handling terminology equivalences and PRECEDENCE for resolving conflicting document sources.
Summary updated