Task Generation

March 31, 2026 ยท View on GitHub

Generate high-quality deep-research evaluation queries through a 6-step pipeline combining real user query patterns, real-time web trends, LLM generation, and multi-stage filtering.

Pipeline Overview

StepWhat it doesHow
1. Fetch trendsReal-time Google search per subtopicSerper API, parallel
2. GenerateLLM creates queries with trend + seed contextLLM, 6 per topic x 12 topics
3. Search validateVerify each query has real search resultsSerper: >=3 results, >=2 unique domains
4. DR filterLLM judges if deep research is truly neededConfidence >= 0.7
5. Quality filterGenerate baseline answer, keep only hard onesquality in {low, medium} AND requires_search AND score <= 0.75
6. ExportNormalize domains, format output11 canonical domain labels

Seeds are loaded from input/seed_patterns.json before Step 1.

Each step caches its output as intermediate_N_*.json -- rerunning skips completed steps. Use --clean to reset.

Quick Start

pip install openai requests python-dotenv

# Copy and fill in API keys
cp .env.example .env

# Run the pipeline (seed_patterns.json must exist)
python pipeline.py

# Force clean rerun
python pipeline.py --clean

Output Format

{
  "id": 1,
  "chat_id": "uuid",
  "query": "Full research query text...",        // renamed to "rewritten_query" in final benchmark data
  "files": [],
  "annotation": {
    "category": "text-auto",
    "language": "en",
    "domain": "finance",
    "topic": "Finance & Macro",
    "persona": "hedge fund PM",
    "anchored_event": "structural trend grounding this query",
    "time_sensitive": false,
    "dr_confidence": 0.92,
    "quality_score": 0.35,
    "search_complexity": "High",
    "search_validation": {
      "result_count": 8,
      "source_diversity": 5,
      "has_recent_results": true
    }
  }
}

Configuration

FlagDefaultDescription
--modelopenai/gpt-5.2LLM model
--num-topics12Topics from the pool
--num-per-topic6Queries generated per topic
--max-workers10Thread pool concurrency
--dr-threshold0.7Min DR confidence to pass
--quality-threshold0.75Max baseline quality score (lower = harder)
--outputoutputs/generated.jsonOutput file path
--cleanfalseClear caches and rerun

Design Decisions

  • Search grounding: Trend injection (step 1) + search validation (step 3) ensure queries are answerable with real web content, not LLM hallucinations.
  • Dual filtering: DR filter removes trivially answerable queries; quality filter removes queries the LLM can answer well without search. Together they select genuinely challenging evaluation items.
  • 11 canonical domains: finance, policy, tech, cybersecurity, health, science, education, legal, energy, trade, crypto -- consistent labels for downstream analysis.
  • Time sensitivity: Queries target structural trends (3-6 month relevance), not fleeting news.