Speculative Execution of Similarity Queries: Real-Time Parameter Optimization through Visual Exploration

Thilo Spinner, Udo Schlegel, Martin Schall, Fabian Sperrle, Rita Sevastjanova, Beatrice Gobbo, Julius Rauscher, Mennatallah El-Assady, Daniel A. Keim

Introduction

Similarity search—the process of finding "items like this one"—is a fundamental task in modern data science. However, tuning these searches remains a significant challenge for users. The process is often hindered by non-intuitive parameters where small weight adjustments lead to radical result changes, the difficulty of comparing mathematically disparate attributes (e.g., geographic distance vs. revenue), and high query latency that disrupts the analytical flow. Users are frequently forced into a "guess and wait" cycle that prevents effective exploration.

System Design and Visual Interface

To address these hurdles, the researchers developed SimSearch, a visual analytics workspace designed to bridge the gap between complex backend algorithms and the need for immediate, intuitive feedback. The interface is divided into three primary components that allow users to interactively refine their search intent.

The SimSearch interface components: (a) Parameter Design, (b) Central Projection View, and (c) Tabular Results View.
  1. Parameter Design: Users adjust weights for various attributes using sliders.
  2. Central Projection View: High-dimensional data is projected into a 2D space (using UMAP, MDS, or PCA), allowing users to see "communities" of similar results and identify which attributes are dominating the search.
  3. Tabular Results View: A ranked list of results that includes speculative indicators to show how potential parameter changes would affect the current ranking.

Speculative Execution and Architecture

The core innovation of SimSearch is its use of speculative execution, a concept borrowed from CPU design. By treating a mouse-hover over a UI element as a signal of intent, the system "looks ahead" and pre-calculates results for nearby parameter values.

SimSearch system architecture illustrating the flow of speculative execution between the backend and the workspace.

As shown in the architecture diagram, a dedicated VA Backend sits between the database and the workspace. This backend handles the heavy lifting of dimensionality reduction and result caching using Redis. When a user hovers over a slider, the system speculatively executes queries; these results are cached so that when the user eventually moves the slider, the visual update is instantaneous, effectively hiding backend latencies of 1–30 seconds.

Visualizing Change and Stability

SimSearch employs specific visual encodings to help users diagnose parameter sensitivity:

  • Speculative Change Indicators: In the projection view, red outlines indicate items that would move into the top-k results if a weight is increased, while green outlines indicate items moving out.
  • Stability Mapping: The system tracks how often an item appears in results across multiple parameter variations. "Stable" results—those that remain in the top-k regardless of minor tuning—are rendered as larger nodes, signaling high confidence to the user.

Evaluation and Key Insights

The system was validated through two real-world scenarios: analyzing the Italian business landscape (a 120 GB dataset) for expansion locations and automating mail forwarding by matching OCR-scanned documents to customer databases.

Key results from these studies include:

  • Fluid Interaction: Speculative caching successfully maintained a responsive user experience despite significant underlying search engine latency.
  • Parameter Diagnosis: The visual projection allowed users to immediately see when certain attributes (like geolocation) had marginal influence compared to others, a discovery that would be impossible in a standard ranked list.
  • Efficient Filtering: The speculative "red/green" highlights enabled users to quickly identify which parameters were "sensitive" (causing high turnover) and which were "robust."

Conclusion and Future Work

SimSearch demonstrates that speculative execution can transform similarity search from a black-box process into an interactive dialogue. While the system effectively hides latency, future work aims to address scalability for even slower search engines and implement automated guidance. The authors propose a "Matrix View" to visualize all possible weight combinations simultaneously, highlighting regions of the parameter space with the highest potential interest for the user.

Summary updated

BibTeX
@inproceedings{spinner2021speculative,
  author = {Thilo Spinner and Udo Schlegel and Martin Schall and Fabian Sperrle and Rita Sevastjanova and Beatrice Gobbo and Julius Rauscher and Mennatallah El-Assady and Daniel A. Keim},
  title = {{Speculative Execution of Similarity Queries: Real-Time Parameter Optimization through Visual Exploration}},
  booktitle = {EDBT/ICDT Workshops},
  year = {2021},
}
Figure