Loading…
The P-Completeness of Inverted Index Traversal: On the Complexity of Evaluating Boolean Query DAGs
Summary
Modern artificial intelligence agents increasingly rely on search infrastructure to run complex, neuro-symbolic reasoning workflows that compile into deeply nested, non-monotonic Boolean queries. Standard inverted index evaluation methods struggle with these query structures, facing either exponential query complexity under Document-at-a-Time models or universe-scale space penalties under Term-at-a-Time models during logical negation. To address these theoretical limitations, the author formalizes a DAG-based retrieval language named L_R and proves its query evaluation problem is strictly P-Complete. The paper introduces ComputePN, a deterministic and sparsity-aware algorithm that employs a Positive-Negative dual representation alongside native DAG memoization. This mechanism bounds evaluation time to O(|Q| · |U_active|), effectively evaluating P-Complete queries natively over the index while bypassing combinatorial tree expansion and universal scan overhead.
Context
Modern AI workflows often generate complex, deeply nested Boolean queries over text fields. Evaluating these queries natively over inverted indices causes Document-at-a-Time iterators to suffer an exponential worst-case blowup of O(2^|Q|) when unrolling re-convergent logic, while Term-at-a-Time models face an Omega(|U|) space penalty during negation.
Approach / What changed
The author formalizes a DAG-based retrieval language, L_R, proves its evaluation is P-Complete, and introduces ComputePN. ComputePN is a deterministic, sparsity-aware evaluation algorithm that utilizes native DAG memoization and decouples logical negation from full universe materialization via a Positive-Negative dual representation.
Takeaways
- The query evaluation problem for the DAG-based retrieval language L_R is strictly P-Complete.
- Document-at-a-Time evaluation suffers an O(2^|Q|) exponential complexity blowup on re-convergent logic, whereas Term-at-a-Time incurs an Omega(|U|) space penalty on negation.
- ComputePN uses a Positive-Negative dual representation and DAG memoization to bound evaluation time to O(|Q| · |U_active|), avoiding both tree-expansion bottlenecks and universal scans.
Related reading
Apple ·
STARFlow2: Bridging Language Models and Normalizing Flows for Unified Multimodal Generation
Existing multimodal models struggle with structural fragmentation, often sacrificing visual fidelity via discrete tokenization or breaking structural symmetry by pairing causal text generation with diffusion-based denoising. STARFlow2 addresses these limitations by leveraging autoregressive normalizing flows, which share the causal mask, key-value cache mechanism, and left-to-right structure of large language models. Built upon the Pretzel architecture, the system vertically interleaves a frozen pretrained vision-language model stream with a TARFlow stream through residual skip connections under a single causal mask. A deep-shallow flow design combined with a unified FAE latent space allows both text and continuous visual outputs to enter the key-value cache directly without re-encoding. Benchmark experiments validate strong performance across multimodal understanding and continuous image generation tasks.
Airbnb ·
From weeks to a day: how we made LLM evaluation fast enough to iterate on