Skip to main content

RLM: Recursive Language Model

The RLM architecture is designed for “thinking” at scale. It uses a recursive loop structure to handle inputs that exceed standard context windows or require multiple rounds of deliberation.

Using RLM Zero-Shot

You can use the RLM architecture immediately by targeting the zero_shot_rlm_single graph ID. This allows you to provide a massive context and a complex system prompt without any prior optimization.

RLM for Standalone Reasoning (Policy)

Use RLM when you have a high-complexity task that requires deep reasoning but you don’t need a verifier score.
curl -X POST https://api.synth-ai.com/graphs/completions \
  -H "Authorization: Bearer $SYNTH_API_KEY" \
  -d '{
    "job_id": "zero_shot_rlm_single",
    "input": {
      "query": "Analyze this 500k token log for security anomalies.",
      "context": "...(massive log file)...",
      "system_prompt": "You are a senior security researcher..."
    }
  }'

RLM as a Verifier

RLM can also be used as a high-fidelity judge for verification tasks. It is the default architecture used when traces exceed 500k tokens or 100+ events. However, RLMs aren’t only for verification—they’re a general-purpose architecture for handling massive context and complex recursive reasoning.
curl -X POST https://api.synth-ai.com/graphs/completions \
  -H "Authorization: Bearer $SYNTH_API_KEY" \
  -d '{
    "job_id": "zero_shot_verifier_rubric_rlm",
    "session_trace": { ... },
    "rubric": { ... }
  }'

Why use RLM?

  1. Unlimited Context: Automatically handles massive inputs that would crash a standard single-prompt LLM.
  2. Recursive Auditing: RLM nodes can check each other’s work, significantly reducing hallucinations in long-context tasks.
  3. Optimizable: While zero_shot_rlm works out of the box, you can use Graph Gen to optimize the RLM recursive prompts for your specific domain.