query fan-out

Google’s Query Fan-Out System – A Technical Overview

This article describes Google’s system for automatically generating multiple intelligent variations of search queries using a trained generative neural network model. Unlike traditional systems that rely on pre-defined rules or historical query pairs, this system can actively produce new query variants for any input, even for queries it has never seen before.

Primary Inputs

  1. Original Query Tokens – The words/terms from the user’s original search query
  2. Type Values – Indicators that specify what kind of variant to generate
  3. Attributes – Additional contextual information about the user and environment

List of Query Variant Types

The system can generate eight distinct types of query variants:

  1. Equivalent Query – Alternative ways to ask the same question
    • Example: “did roger moore drive an aston martin in the persuaders” → “what car did roger moore drive in the persuaders”
  2. Follow-up Query – Logical next questions that build on the original
    • Example: “did leonardo da vinci paint mona lisa” → “who commissioned leonardo da vinci to paint the mona lisa”
  3. Generalization Query – Broader versions of the specific question
    • Example: “best Italian restaurants in Manhattan” → “best restaurants in New York City”
  4. Canonicalization Query – Standardized or normalized versions of the query
    • Example: Converting colloquial phrases to standard search terms
  5. Language Translation Query – Same query translated into different languages
    • Example: Useful for finding content in multiple languages or for multilingual users
  6. Entailment Query – Queries that logically follow from or are implied by the original
    • Example: Questions about consequences or related facts
  7. Specification Query – More detailed or specific versions of broad queries
    • Example: “climate change” → “climate change effects on coastal cities 2025”
  8. Clarification Query – Questions presented back to the user to clarify intent
    • Example: System might ask “Did you mean the movie or the book?” and use the response as input

List of Attributes

User Attributes:

  • Location (multiple granularities):
    • Specific city (e.g., “Louisville, KY”)
    • Location type (e.g., “in a restaurant”)
    • Region (e.g., “Southeast US”)
  • Current Task being performed:
    • Cooking
    • Repairing a car
    • Planning for travel
    • Online shopping
    • Research
    • Meeting preparation
  • Weather at the user’s location
  • User Demographics/Group Attributes:
    • Professional background (e.g., scientific researcher vs. freelance writer)
    • Past search behavior patterns
    • Language preferences

Temporal Attributes:

  • Current time of day
  • Day of the week
  • Current date
  • Season
  • Proximity to holidays or events
  • Time zone

Task Prediction Signals:

  • Stored calendar entries
  • Recent electronic communications (chat messages, emails)
  • Past queries in the current session
  • Recently viewed content
  • Transaction history
  • Currently open applications

System State Features (for iterative generation):

  • Search system responses to the original query
  • Search system responses to previously generated variants
  • Quality scores of previous responses
  • Previously generated variants themselves
  • User responses to clarification prompts
  • Number of iterations already performed

The Multi-Model Architecture

Generative Models Ecosystem

The system maintains multiple specialized generative models:

  1. User-Group Specific Models – Different models trained on query patterns from specific user groups
    • Model A: Trained on users with attributes A and B
    • Model B: Trained on users with attributes B and C
    • Selection based on matching user attributes
  2. Task-Specific Models – Models optimized for particular activities
    • Shopping-focused model (trained on e-commerce queries)
    • Travel planning model (trained on location/navigation queries)
    • Research model (trained on academic/factual queries)
    • Each trained on relevant historical query patterns
  3. Multitask Models – Single models capable of generating all variant types
    • Trained on mixed datasets with type labels
    • Type value input controls which variant type is generated
    • Benefits from information sharing across variant types during training

The Control Model (Critic)

A separate neural network that acts as a decision-maker:

Functions:

  • Determines whether to generate additional variants
  • Decides when to stop variant generation
  • Provides reward signals to the generative model
  • Generates context vectors for the next iteration
  • Evaluates quality of accumulated responses

Inputs to Control Model:

  • Current state features
  • All generated variants so far
  • All search responses received
  • Original query
  • Iteration count
  • User attributes

Outputs from Control Model:

  • Continue/stop decision
  • Reward signal (Q-function value)
  • Context vector for next generation
  • Quality assessment of current results

The Generation Process

Initial Phase

  1. User submits original query
  2. System optionally fetches initial search results for the original query
  3. Control model evaluates whether variants are needed
  4. If yes, determines initial context and reward signal

Iterative Generation Loop

At each time step t:

  1. Variant Generation
    • Apply to generative model:
      • Original query tokens
      • Type value (for desired variant type)
      • User attributes
      • Temporal attributes
      • Context from previous iterations
      • Reward signal from control model
    • Generate variant over the model’s architecture:
      • Encoder layers process the input
      • Decoder layers generate the variant
      • Softmax layers produce final output
  2. Response Collection
    • Submit variant to search system(s)
    • Receive responses (answers, search results, or “null” for no answer)
    • Store responses with quality scores
  3. Control Decision
    • Control model evaluates accumulated evidence
    • Determines if sufficient quality responses obtained
    • Decides whether to continue or emit final answer
  4. State Update (if continuing)
    • Update context with new variant and responses
    • Adjust reward signal based on response quality
    • Select next type value (potentially different variant type)
    • Return to step 1

Termination Conditions

  • High-quality answer found (score exceeds threshold)
  • Maximum iterations reached
  • Diminishing returns detected
  • User explicitly satisfied (through clarification response)

Training Methodology

Supervised Pre-training

Training Data Sources:

  1. Query Pairs from Search Logs
    • Consecutive queries from same user session
    • Queries leading to clicks on same documents
    • Query reformulations
  2. Labeled Examples
    • Human-annotated query variant pairs
    • Type labels assigned by human reviewers
    • Quality ratings for variant relationships

Training Instance Structure:

Input:
- Original query: "funny cat pictures"
- Attributes: {location: "Seattle", time: "evening", task: "entertainment"}
- Type: "equivalent"

Output:
- Variant: "funny cat pictures with captions"

Reinforcement Learning Fine-tuning

Actor-Critic Architecture:

  • Actor (Generative Model): Generates variants
  • Critic (Control Model): Evaluates state-action values

Reward Structure:

  • Positive reward for answer responses (proportional to quality score)
  • No reward for “no answer” responses
  • Final reward based on best accumulated answer
  • Intermediate rewards guide exploration

Learning Process:

  • Monte-Carlo Q-learning for control model
  • Policy gradient updates for generative model
  • Experience replay from interaction logs

Advanced Features

Cross-Variant Verification

The system can detect potentially incorrect information by cross-checking responses:

Example Process:

  1. Original query: “did michelangelo paint the mona lisa”
  2. Initial response: “Yes” (potentially incorrect)
  3. Generate follow-ups:
    • “when did michelangelo paint the mona lisa” → No answer
    • “where did michelangelo paint the mona lisa” → No answer
    • “why did michelangelo paint the mona lisa” → No answer
  4. Conclusion: Original “Yes” is likely wrong, return “No”

Dynamic Personalization

Location-Based Adaptation:

  • Query: “weather today”
  • System uses location attribute: “Brisbane, Queensland, AU”
  • Generates variants specific to that location

Task-Based Adaptation:

  • Detects user is cooking (from calendar: “Dinner party 7pm”)
  • Query: “thyme”
  • Generates cooking-specific variants rather than botanical information

Temporal Adaptation:

  • Query submitted at 11:45 AM on weekday
  • Query: “food near me”
  • Generates lunch-specific restaurant variants

Multi-Path Exploration

For complex queries, the system explores multiple interpretation paths simultaneously:

Query: “python threading”

  1. Programming path: “python threading tutorial”, “python GIL threading”
  2. General path: “python snake threading behavior”
  3. Comparison path: “python vs java threading”

System evaluates all paths and returns most relevant based on user attributes (e.g., software developer profile).

Output Generation Strategies

Single Best Answer

  • Evaluate all variant responses
  • Select highest quality score
  • Optionally verify through cross-checking
  • Return single authoritative answer

Multiple Perspectives

  • Return top N diverse responses
  • Show different interpretations
  • Present as “multiple viewpoints” to user

Variant Suggestions

  • Present generated variants as “Related searches”
  • Allow user to explicitly choose path
  • Similar to “People also ask” but dynamically generated

Composite Answer

  • Synthesize information from multiple variant responses
  • Build comprehensive answer covering multiple aspects
  • Include confidence indicators based on cross-verification

Privacy and Efficiency Considerations

Privacy Protection

  • User attributes can be processed locally on device
  • Federated learning for model updates without sending queries
  • Option to use generic models without personalization

Computational Efficiency

  • Caching of common variant patterns
  • Early stopping when confidence threshold met
  • Batch processing of multiple variants
  • Selective variant generation based on query complexity

Scale Limitations

  • Maximum 20 iterations per query (configurable)
  • Timeout limits for real-time responses
  • Fallback to simple search if system overloaded

Real-World Implementation Examples

E-commerce Scenario

Original Query: “waterproof boots” User Attributes:

  • Location: Seattle (rainy climate)
  • Recent searches: hiking gear
  • Time: October (pre-winter)

Generated Variants:

  • “waterproof hiking boots for rain” (specification + task)
  • “best waterproof boots for Seattle weather” (location-specific)
  • “waterproof boots for winter hiking” (temporal + task)
  • “gore-tex hiking boots” (technical equivalent)

Academic Research Scenario

Original Query: “CRISPR applications” User Attributes:

  • Profile: Biology researcher
  • Recent papers viewed: gene therapy
  • Institution: Medical school

Generated Variants:

  • “CRISPR-Cas9 therapeutic applications 2025” (current + specific)
  • “CRISPR gene therapy clinical trials” (follow-up)
  • “CRISPR versus zinc finger nucleases” (comparison)
  • “CRISPR patent landscape” (related aspect)

Travel Planning Scenario

Original Query: “Tokyo hotels” User Attributes:

  • Calendar: “Tokyo trip March 15-22”
  • Previous searches: “cherry blossom forecast”
  • Budget indicators: Premium selections

Generated Variants:

  • “Tokyo hotels near cherry blossom spots” (event-aware)
  • “luxury hotels Shinjuku Tokyo” (budget-aware + specification)
  • “Tokyo hotels with English speaking staff” (user need prediction)
  • “Tokyo hotel availability March 15-22” (temporal-specific)

This system represents a fundamental shift from keyword matching to intelligent query understanding and exploration, enabling more effective information retrieval especially for complex, novel, or poorly-articulated user needs.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *