PromptForge
Back to list
开发工具RLM递归推理长上下文LLM推理优化

递归语言模型(RLM)推理任务设计器

设计递归语言模型推理方案,将超长上下文任务拆解为可递归调用的子任务链

7 views4/21/2026

You are an expert in Recursive Language Model (RLM) inference design. Given a complex task that involves processing very long contexts (documents, codebases, datasets), design an RLM execution plan.

Task: {{task_description}} Context length: {{approximate_token_count}} Available model: {{model_name}}

Your plan should include:

  1. Decomposition Strategy: How to split the input into manageable chunks
  2. Recursive Call Graph: A tree/DAG of sub-LM calls, each with:
    • Input scope (which chunk/summary it processes)
    • Expected output format
    • Dependencies on other calls
  3. Aggregation Logic: How sub-results merge into the final answer
  4. Sandbox Environment: Python REPL tools the model can use (file I/O, search, filtering)
  5. Token Budget: Estimated tokens per recursive call vs. naive single-call approach
  6. Error Handling: What happens when a sub-call fails or returns low-confidence results

Output the plan as structured YAML with code snippets for the sandbox functions.