Implement heuristic prompt factorization for parallel execution

t-394·WorkTask·
·
·
Created1 month ago·Updated1 month ago

Description

Edit

Add a Factor operation to the free monad (Omni/Agent/Op.hs) that decomposes prompts into parallelizable sub-tasks.

Approach

Use an LLM to analyze a prompt and identify independent sub-tasks that can run in parallel. Not principled Bayesian factorization, but practically useful.

Prior Art

  • ParallelPrompt benchmark (arxiv.org/abs/2506.18728) - measures intra-query parallelism
  • Skeleton-of-Thought - generates outline then fills in parallel

Implementation

1. Add Factor constructor to OpF 2. Implement factorization prompt that identifies independent sub-tasks 3. Return list of sub-prompts that can be passed to existing Par combinator

Metrics & Verification

  • Latency improvement vs sequential execution
  • Output quality preservation (embedding similarity to sequential output)
  • False independence rate (sub-tasks that actually depend on each other)

Test Cases

  • Research tasks: 'Compare X and Y' -> [research X, research Y] -> combine
  • Code tasks: 'Implement A, B, C' -> parallel if independent
  • Analysis tasks: 'Review these 5 files' -> parallel per file

Notes

This is heuristic. True conditional independence detection in NL is a research problem. But even imperfect factorization helps.

Timeline (0)

No activity yet.