Skip to content

Experiment: Generative RecSys + HyDE for hypothesis generation #23

Description

@OnePunchMonk

Summary

Explore using generative recommendation systems + HyDE (Hypothetical Document Embeddings) to propose novel trading hypotheses. Instead of purely literature-based discovery, generate synthetic "ideal strategies" and search for empirical evidence of them.

This could discover hypothesis combinations not yet written about in papers.

Motivation

Current Research Agent (Phase 1-3) is literature-dependent: only finds strategies already published. A generative + retrieval approach could:

  • Generate hypothetical strategies from first principles ("what if we combined X + Y?")
  • Score them by embedding similarity to regime contexts
  • Retrieve supporting evidence from academic + market data
  • Find novel combinations faster than literature search alone

Approach (HyDE-inspired)

  1. Generate hypotheticals: Use Claude to generate 5-10 synthetic strategy descriptions given current regime
    • Example: "Short-lived mean reversion in high-VIX regimes with 2-hour windows"
  2. Embed & retrieve:
    • Embed each hypothesis using strategy semantics
    • Retrieve nearest empirical patterns from historical backtests
    • Retrieve supporting research papers/blogs
  3. Score & validate: Rank by evidence density and backtest Sharpe
  4. Propose parameters: Map winning hypothetical to actionable parameter set

Task

  1. Design hypothesis generation prompt (what makes a good synthetic strategy description?)
  2. Implement embedding-based retrieval of:
    • Similar backtest results from memory (SQLite)
    • Related research findings (from Literature Agent)
  3. Create scoring function: evidence density + backtest quality
  4. Prototype on 1-2 market regimes (e.g., high-vol, low-vol)
  5. Compare results: generated hypotheses vs. literature-only hypotheses

Files to Create/Modify

  • src/agent/hypothesis_generator.py — Generative component (NEW)
  • src/agent/hypothesis_scorer.py — Embedding + retrieval scoring (NEW)
  • src/research/hypothesis_memory.py — SQLite schema for hypothesis archival (NEW)
  • tests/test_hypothesis_generation.py — Evaluation (NEW)
  • docs/HYPOTHESIS_GENERATION.md — Design doc (NEW)

Acceptance Criteria

  • Hypothesis generation prompt is tested on multiple regimes
  • Embedding-based retrieval finds similar historical patterns
  • Scoring function ranks hypotheses by evidence density
  • Prototype on 2+ market regimes shows 1-2 novel hypotheses per regime
  • Backtest results of generated hypotheses vs. literature baselines
  • Design doc written explaining approach and results

Success Metrics

  • Does it find strategies NOT in the literature/grid?
  • Do generated hypotheses have >0.5 Sharpe on validation?
  • How much faster than literature search?
  • False positive rate (hypotheses with <0.4 Sharpe)?

Related

Priority

🔵 EXPERIMENTAL - Novel approach worth prototyping; decide after Phase 1-3 if it adds value

Notes

This is speculative. Start only after Research Agent Phase 1-3 are solid. Could complement or replace literature-only discovery depending on results.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions