Papers
Topics
Authors
Recent
Search
2000 character limit reached

Adaptive Query Sharing Methods

Updated 6 July 2026
  • Adaptive Query Sharing is a set of techniques that reuse a common computational substrate and condition execution on individual queries to reduce redundancy and improve performance.
  • These methods are applied in neural architectures via prompt retrieval and token selection, and in data systems through query batching and shared state management.
  • Empirical evidence demonstrates improvements in accuracy, latency, throughput, and memory efficiency, underpinning their practical impact in both computer vision and database domains.

Searching arXiv for the cited papers to ground the article in current records. Searching for "Adaptive Query Prompting for Multi-Domain Landmark Detection" and related query-sharing papers. Adaptive query sharing denotes a family of techniques that reuse a common computational substrate while conditioning computation on individual queries, inputs, labels, tasks, or workload states. In the supplied literature, the shared object may be a prompt pool or query-token set in a frozen transformer, a multiversioned indexed trace in a stream processor, a batch-oriented operator network in a relational engine, or a set of materialized cuts injected into a shared analytical plan. The adaptive component is realized through mechanisms such as cosine-similarity retrieval, maximum inner-product selection, logical-time frontiers, heartbeat-driven batching, and benefit-based plan rewriting (Wei et al., 2024, Zhu et al., 2024, McSherry et al., 2018, Giannikis et al., 2012, Sioulas et al., 2023).

1. Scope and conceptual variants

The literature does not present a single unified formalism for adaptive query sharing. Instead, it contains at least two technically distinct lineages. In model-centric work, the “query” is a learned representation that conditions inference. Adaptive Query Prompting (AQP) turns a frozen vision-transformer backbone into a universal landmark detector by retrieving task- and input-conditioned prompts from a prompt pool, while Query-Based Knowledge Sharing (QKS) trains label-agnostic query tokens that are shared across candidate labels in open-vocabulary multi-label classification (Wei et al., 2024, Zhu et al., 2024).

In system-centric work, the “query” is an execution request in a data-processing engine. SharedDB replaces the query-at-a-time model with batch-oriented shared execution over a global operator network. Shared Arrangements exposes indexed state as a multiversioned shared trace that multiple queries can attach to in O(1)O(1) time. ParCuR starts from a baseline shared plan and selectively injects materialized subexpressions only when reuse offsets filtering overhead (Giannikis et al., 2012, McSherry et al., 2018, Sioulas et al., 2023).

This suggests that “adaptive query sharing” is best understood as an umbrella description for techniques that separate a large shared substrate from a smaller query-conditioned control path. The substrate may be a backbone encoder, an arrangement, a shared operator DAG, or a materialized cut; the control path may be prompt retrieval, token selection, frontier management, or benefit-guided rewriting.

2. Query-conditioned sharing in neural architectures

In AQP, the large pre-trained encoder f=frfef=f_r\circ f_e is kept fixed, while adaptation is moved into a learnable prompt pool P={Pj}j=1N\mathcal P=\{P_j\}_{j=1}^N with keys K={kj}j=1N\mathcal K=\{k_j\}_{j=1}^N. Each prompt PjRLp×DP_j\in\mathbb{R}^{L_p\times D}, and each key kjRDkk_j\in\mathbb{R}^{D_k}. For an input image II, a deterministic frozen query extractor q(I)q(I) is obtained from a fixed backbone layer, similarities are measured by cosine distance,

γ(q(I),kj)=1q(I),kjq(I)kj,\gamma\bigl(q(I),k_j\bigr)=1-\frac{\langle q(I),k_j\rangle}{\|q(I)\|\|k_j\|},

and the top-MM prompts with the smallest distances are retrieved. The selected prompts are concatenated, passed through lightweight Adaptors, and injected into each transformer layer. Landmark prediction is then produced by Light-MLD, a lightweight decoder that reshapes and upsamples the final transformer feature map into heatmaps. Training optimizes only the prompt pool, the Adaptors, and the lightweight decoder under

f=frfef=f_r\circ f_e0

where f=frfef=f_r\circ f_e1 is mean-squared heatmap error and f=frfef=f_r\circ f_e2 pulls selected keys toward the input query (Wei et al., 2024).

QKS uses a related but not identical design. A frozen vision-language pre-training model, specifically CLIP ViT-B/16, produces image features and text embeddings. A trainable label-agnostic query matrix f=frfef=f_r\circ f_e3 is refined through f=frfef=f_r\circ f_e4 Transformer-decoder layers with self-attention, cross-attention to image features, and feed-forward blocks. Label embeddings are not derived from a single template; instead, a prompt pool of f=frfef=f_r\circ f_e5 hand-crafted natural-language templates is filled with each label and averaged: f=frfef=f_r\circ f_e6 After decoding, the score of label f=frfef=f_r\circ f_e7 is

f=frfef=f_r\circ f_e8

The method replaces pairwise ranking with a binary-classification loss over the raw inner products, thereby allowing vector magnitude to contribute to matching (Zhu et al., 2024).

The two systems share a structural pattern. Both freeze a large pretrained model, introduce a small query-side adaptive module, and let a compact learned set of tokens or prompts mediate transfer across heterogeneous targets. In AQP, the mediation occurs across anatomical domains and landmark tasks; in QKS, across seen and unseen labels. A plausible implication is that query sharing in neural systems is primarily a parameter-allocation strategy: high-capacity representation learning remains global, while low-dimensional query-conditioned objects capture specialization.

3. Inter-query sharing in data systems

SharedDB implements sharing by converting incoming SQL requests into batches that traverse a static, directed acyclic graph of always-on relational operators. A Query-Batcher, also described as a “Heartbeat” or “Generator,” receives incoming requests, cuts off new arrivals on each tick, harvests pending queries, and injects them as subqueries into the global plan. Operators process tuples that carry an extra attribute, f=frfef=f_r\circ f_e9 or a small set of P={Pj}j=1N\mathcal P=\{P_j\}_{j=1}^N0 values, enabling shared scans, shared joins, shared aggregation, sorts, and top-P={Pj}j=1N\mathcal P=\{P_j\}_{j=1}^N1 operations. The optimizer frames the benefit of merging operator work as a “sharing gain” P={Pj}j=1N\mathcal P=\{P_j\}_{j=1}^N2, the difference between the cost of P={Pj}j=1N\mathcal P=\{P_j\}_{j=1}^N3 independent instances and the cost of a single shared instance over the union of required tuples, under a soft latency bound P={Pj}j=1N\mathcal P=\{P_j\}_{j=1}^N4 in which at most P={Pj}j=1N\mathcal P=\{P_j\}_{j=1}^N5 is spent waiting and at most P={Pj}j=1N\mathcal P=\{P_j\}_{j=1}^N6 processing (Giannikis et al., 2012).

Shared Arrangements realizes a different form of inter-query sharing. The core abstraction is a collection trace, an append-only sequence of updates P={Pj}j=1N\mathcal P=\{P_j\}_{j=1}^N7, materialized as immutable in-memory batches P={Pj}j=1N\mathcal P=\{P_j\}_{j=1}^N8 and stored per worker as a trace

P={Pj}j=1N\mathcal P=\{P_j\}_{j=1}^N9

Because each batch is immutable, readers traverse it without locking. When a new query is installed and requests an arrangement on a given key, the system consults a registry keyed by the same partition-key descriptor. If a matching arrangement already exists, the new query attaches a read handle to the existing trace rather than building a fresh index; this attachment is K={kj}j=1N\mathcal K=\{k_j\}_{j=1}^N0, apart from the cost of reading already-indexed batches. Each handle carries its own logical-time frontier K={kj}j=1N\mathcal K=\{k_j\}_{j=1}^N1, so multiple readers can concurrently observe different versions of the same indexed state (McSherry et al., 2018).

The streaming formulation also makes the complexity of sharing explicit. Per worker, amortized insert cost is K={kj}j=1N\mathcal K=\{k_j\}_{j=1}^N2, because each input record enters one new batch creation and then participates in K={kj}j=1N\mathcal K=\{k_j\}_{j=1}^N3 levels of merges. Point lookup or range scan is K={kj}j=1N\mathcal K=\{k_j\}_{j=1}^N4 in the common case of well-balanced batches. Total space is K={kj}j=1N\mathcal K=\{k_j\}_{j=1}^N5 across all batches, with consolidation keeping constant factors low. This is a more fine-grained notion of query sharing than SharedDB’s global batching: instead of sharing whole operators over synchronous batches, it shares incrementally maintained, multiversioned indices across asynchronously attached readers (McSherry et al., 2018).

4. Adaptivity mechanisms and optimization criteria

AQP adapts by retrieval. Given K={kj}j=1N\mathcal K=\{k_j\}_{j=1}^N6, it selects the top-K={kj}j=1N\mathcal K=\{k_j\}_{j=1}^N7 prompts whose keys minimize cosine distance and regularizes those selected keys toward the query through K={kj}j=1N\mathcal K=\{k_j\}_{j=1}^N8. No extra gating is needed beyond the cosine-similarity retrieval step, and the prompt pool can therefore encode both shared and domain-specific knowledge while the backbone remains frozen. Shared prompts are retrieved across domains; specialized queries retrieve domain-specific prompts (Wei et al., 2024).

QKS adapts by competition among shared tokens. The query tokens are label-agnostic during training, but each label embedding chooses evidence at inference time by taking the maximum inner product over the learned query-token set. The system therefore shares a common visual token vocabulary across labels while retaining per-label selection. Its prompt pool also serves an adaptive role: averaging across multiple natural-language templates makes label embeddings more robust to phrasing variation than a single fixed template (Zhu et al., 2024).

Shared Arrangements adapts at runtime through frontier-aware compaction and lazy merging. Each reader’s frontier is registered with the trace, and when the minimum frontier advances, the arrangement can coalesce or drop batches whose time ranges lie entirely below that frontier. Merging is amortized: if K={kj}j=1N\mathcal K=\{k_j\}_{j=1}^N9 is the amortization parameter and a new batch of size PjRLp×DP_j\in\mathbb{R}^{L_p\times D}0 is created, the arrange operator spends PjRLp×DP_j\in\mathbb{R}^{L_p\times D}1 work advancing outstanding merges. Empirically, PjRLp×DP_j\in\mathbb{R}^{L_p\times D}2 is the default, trading throughput against tail latency (McSherry et al., 2018).

SharedDB adapts by batch sizing and scheduling. The batch interval PjRLp×DP_j\in\mathbb{R}^{L_p\times D}3 can be adjusted dynamically to maintain PjRLp×DP_j\in\mathbb{R}^{L_p\times D}4. If waiting time grows, PjRLp×DP_j\in\mathbb{R}^{L_p\times D}5 is shrunk; if processing time is well below PjRLp×DP_j\in\mathbb{R}^{L_p\times D}6, PjRLp×DP_j\in\mathbb{R}^{L_p\times D}7 may be increased to obtain more sharing. The system description also includes operator-level reordering, work-stealing or load balancing, and SLA-aware prioritization using PjRLp×DP_j\in\mathbb{R}^{L_p\times D}8 tags (Giannikis et al., 2012).

ParCuR gives the most explicit cost model for adaptive sharing. For a candidate cut PjRLp×DP_j\in\mathbb{R}^{L_p\times D}9 at anchor kjRDkk_j\in\mathbb{R}^{D_k}0, it computes eliminated shared-execution cost,

kjRDkk_j\in\mathbb{R}^{D_k}1

filtering overhead,

kjRDkk_j\in\mathbb{R}^{D_k}2

and reuses the materialized result exactly when

kjRDkk_j\in\mathbb{R}^{D_k}3

Offline, ParCuR solves the Multi-Partition Subexpression Selection for Sharing problem under a storage budget kjRDkk_j\in\mathbb{R}^{D_k}4, reducing it to a Submodular Cover & Submodular Knapsack problem and using either Greedy, with kjRDkk_j\in\mathbb{R}^{D_k}5, or ISK, with kjRDkk_j\in\mathbb{R}^{D_k}6. Online, reuse optimization is kjRDkk_j\in\mathbb{R}^{D_k}7 per partition per episode (Sioulas et al., 2023).

Taken together, these works show that adaptivity is not a single operation. It may be similarity-based, score-based, time-based, latency-based, or cost-based. The shared object remains stable; the selection policy varies with the domain.

5. Empirical performance and scaling

The reported empirical results indicate that adaptive query sharing can improve accuracy, latency, throughput, and memory consumption, but the evidence is domain-specific rather than directly comparable across all settings.

Setting Reported result Source
AQP + Light-MLD on X-ray landmark detection Head: MRE kjRDkk_j\in\mathbb{R}^{D_k}8 mm, SDR@3 mm kjRDkk_j\in\mathbb{R}^{D_k}9; Hand: MRE II0 mm, SDR@2 mm II1; Chest: MRE II2 px, SDR@6 px II3; tuning only II4 of parameters (Wei et al., 2024)
QKS on zero-shot multi-label benchmarks NUS-WIDE: mAP II5 vs II6; Open Images: mAP II7 vs II8 (Zhu et al., 2024)
Shared Arrangements on streams and graphs Query installation II9–q(I)q(I)0 ms instead of q(I)q(I)1–q(I)q(I)2 s; graph-query latency q(I)q(I)3 ms q(I)q(I)4 ms; memory q(I)q(I)5 GB q(I)q(I)6 GB in one graph setting (McSherry et al., 2018)
SharedDB on TPC-W Browsing mix: q(I)q(I)7 SystemX throughput, q(I)q(I)8 MySQL; Shopping mix: q(I)q(I)9 SystemX; nearly linear scalability up to γ(q(I),kj)=1q(I),kjq(I)kj,\gamma\bigl(q(I),k_j\bigr)=1-\frac{\langle q(I),k_j\rangle}{\|q(I)\|\|k_j\|},0 cores (Giannikis et al., 2012)
ParCuR on analytical workloads γ(q(I),kj)=1q(I),kjq(I)kj,\gamma\bigl(q(I),k_j\bigr)=1-\frac{\langle q(I),k_j\rangle}{\|q(I)\|\|k_j\|},1 lower latency on SSB, γ(q(I),kj)=1q(I),kjq(I)kj,\gamma\bigl(q(I),k_j\bigr)=1-\frac{\langle q(I),k_j\rangle}{\|q(I)\|\|k_j\|},2 faster on TPC-H, with interactive γ(q(I),kj)=1q(I),kjq(I)kj,\gamma\bigl(q(I),k_j\bigr)=1-\frac{\langle q(I),k_j\rangle}{\|q(I)\|\|k_j\|},3 latencies on large recurring workloads (Sioulas et al., 2023)

Within the neural papers, the gains are tied to the sharing mechanism rather than wholesale fine-tuning. AQP reports consistent MRE improvements of γ(q(I),kj)=1q(I),kjq(I)kj,\gamma\bigl(q(I),k_j\bigr)=1-\frac{\langle q(I),k_j\rangle}{\|q(I)\|\|k_j\|},4–γ(q(I),kj)=1q(I),kjq(I)kj,\gamma\bigl(q(I),k_j\bigr)=1-\frac{\langle q(I),k_j\rangle}{\|q(I)\|\|k_j\|},5 mm across ViTPose-S/B/L backbones when AQP is added, and QKS reports that the prompt pool contributes γ(q(I),kj)=1q(I),kjq(I)kj,\gamma\bigl(q(I),k_j\bigr)=1-\frac{\langle q(I),k_j\rangle}{\|q(I)\|\|k_j\|},6 pp mAP on NUS-WIDE while the classification-style loss contributes γ(q(I),kj)=1q(I),kjq(I)kj,\gamma\bigl(q(I),k_j\bigr)=1-\frac{\langle q(I),k_j\rangle}{\|q(I)\|\|k_j\|},7 pp mAP and γ(q(I),kj)=1q(I),kjq(I)kj,\gamma\bigl(q(I),k_j\bigr)=1-\frac{\langle q(I),k_j\rangle}{\|q(I)\|\|k_j\|},8 pp F1@3 (Wei et al., 2024, Zhu et al., 2024).

Within the systems papers, the improvements are tied to eliminating redundant state construction or redundant shared recomputation. Shared Arrangements emphasizes order-of-magnitude improvements in query response time and resource consumption for interactive queries against high-throughput streams, while ParCuR shows that combining reuse and sharing is beneficial only after access methods, sharing-aware materialization, and partition-aware execution have been introduced (McSherry et al., 2018, Sioulas et al., 2023).

6. Limitations, misconceptions, and open directions

A common misconception is that more sharing is always better. The database literature explicitly rejects this. Shared Arrangements does not share across entirely disjoint key spaces, key transformations, or operators that fundamentally reshape the key; highly bespoke windowing or custom state layouts may be incompatible; and the mechanism is single-writer only, not a generalization to multi-writer transactional updates. Because multiple queries depend on the same writer thread, a heavy query can temporarily stall the arrangement’s merges and raise the tail latency of others, even though amortized merging and co-scheduling minimize this effect (McSherry et al., 2018).

A second misconception is that reuse and work sharing are automatically complementary. ParCuR states that naively combining the two approaches is ineffective and can deteriorate performance because of increased filtering costs, reduced marginal benefits, and lower reusability. Its design is therefore built around access methods on materialized results, a sharing-aware materialization policy, a two-phase optimization strategy, and partial reuse based on historical clustering (Sioulas et al., 2023).

A third misconception is that adaptive query sharing in neural systems is equivalent to full-model adaptation. Both AQP and QKS keep the high-capacity backbone frozen and move learning into compact query-side components. In QKS, unfreezing both VLP encoders hurts unseen generalization, too few query tokens under-extract, and too many layers over-fit. In AQP, the framework is described as having the potential to be extended to more landmark detection tasks, which suggests extensibility but not an unconditional guarantee of domain universality (Zhu et al., 2024, Wei et al., 2024).

The term itself is also heterogeneous. In some works, “query” denotes a learned embedding or token used to steer inference; in others, it denotes a user request or subplan in a database engine. The shared object may be semantic evidence, prompt memory, indexed state, or physical operator work. A plausible implication is that adaptive query sharing is not a single algorithmic family but a recurring design principle: isolate an expensive reusable substrate, expose a lightweight query-conditioned interface to it, and activate sharing only when the coordination mechanism costs less than the redundancy it removes.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Adaptive Query Sharing.