RLM Realignment Strategy
Date: 2026-02-05 Owner: Aleph maintainers Status: Proposed execution plan
1) Goal
Realign Aleph with Recursive Language Model (RLM) research on two axes:
- Presentation: clearly distinguish canonical RLM behavior from Aleph-specific platform features.
- Ability: strengthen measurable RLM behavior (decompose, recurse, aggregate, verify) with explicit evaluation and regression checks.
2) Research Baseline (What "RLM-aligned" Means)
Using the RLM paper and official implementation as source of truth, canonical RLM behavior is:
- Treat prompt/context as an external environment object, not as raw prompt tokens.
- Use a REPL-style symbolic loop: inspect, decompose, execute, observe.
- Recursively call sub-LMs for decomposition/aggregation when useful.
- Iterate until a final answer is produced.
Important nuance from research:
- RLM is an inference framework, not a product surface by itself.
- RLM can outperform long-context baselines on information-dense tasks, but performance is workload-dependent.
- Paper limitations explicitly call out open areas: optimal execution strategy, async sub-calls, and recursion-depth policy.
3) Current Repo Audit
3.1 What is already strongly aligned
- Core closed-loop RLM runtime exists:
aleph/core.pyimplements iterative root loop + REPL +FINAL(...)protocol.aleph/core.pysupportssub_queryand recursivesub_aleph.
- Externalized context + symbolic interaction exists:
- Context is loaded into
ctxand explored via helpers/search/code execution.
- Context is loaded into
- Recursion budget controls exist:
- Depth, iterations, wall time, and sub-query budgets are enforced.
- Recursion behavior has test coverage:
- Nested recursion and sub-query backends are tested in
tests/test_double_recursion.pyandtests/test_sub_query.py.
- Nested recursion and sub-query backends are tested in
3.2 Where presentation currently drifts
- Mode boundary is under-explicit:
- Docs position Aleph broadly as RLM-based, but do not consistently separate:
- canonical "Aleph core loop mode" (
aleph run) - MCP tool-server orchestration mode (RLM-inspired, host-model-driven).
- canonical "Aleph core loop mode" (
- Docs position Aleph broadly as RLM-based, but do not consistently separate:
- Documentation inconsistency reduces credibility:
DEVELOPMENT.mdhas stale backend priority and stale budget schema examples.docs/CONFIGURATION.mdtimeout defaults are outdated versus runtime defaults.
- Some guidance is phrased as universal when it is backend-dependent:
- Prompt/docs imply fixed sub-query capacity heuristics while runtime enforces configurable truncation limits.
3.3 Where ability currently drifts from research rigor
- No first-class benchmark harness reproducing paper-style task families in CI.
- No published "research profile" config that reproduces paper-like control settings for fair comparison.
- No recurring regression report tracking RLM-specific quality dimensions over time (decomposition quality, recursion efficiency, cost variance).
4) Strategy
Run two workstreams in parallel, then unify with an evaluation gate.
Workstream A: Presentation Realignment
A1. Introduce explicit product taxonomy
Add one canonical section to top-level docs:
- Core RLM Mode (paper-aligned loop):
aleph run,alef,Aleph.complete(...). - RLM Infrastructure Mode (MCP external memory server): tool-driven orchestration from host assistants.
- Platform Extensions (not in canonical RLM): swarm workflows, remote MCP orchestration, workspace/action tooling.
A2. Establish a "Claims Ledger"
Create docs/RLM_CLAIMS_LEDGER.md mapping every major claim to one of:
- Research-backed (with citation)
- Code-backed (with repo file reference)
- Aspirational (roadmap only)
No claim should remain unclassified.
A3. Remove doc drift and ambiguity
Synchronize:
README.mddocs/CONFIGURATION.mdDEVELOPMENT.mddocs/prompts/aleph.md
Rules:
- Defaults must match runtime constants.
- Backend priority must match
aleph/sub_query/__init__.py. - Capacity guidance must mention truncation/config dependence.
- "RLM" label should be used precisely: canonical loop vs inspired tooling.
Workstream B: Ability Realignment
B1. Add an RLM benchmark harness
Create a lightweight benchmark module with deterministic synthetic tasks mirroring paper structure:
- Constant-information retrieval task (S-NIAH-style)
- Linear aggregation task (OOLONG-style)
- Pairwise aggregation task (OOLONG-Pairs-style)
- Code context reasoning task (CodeQA-style)
Output JSON report fields:
- accuracy
- total tokens
- wall time
- recursion depth used
- sub-query count
- cost estimate (if provider supports it)
B2. Add "research profile" runtime preset
Add a named config profile (example: --profile rlm-paper-like) that pins:
- recursion depth
- iteration cap
- sub-query cap
- prompt template variant
- model split policy (root vs sub-model)
Purpose: make "paper-like mode" reproducible and auditable.
B3. Add regression gates for RLM behavior
Extend tests with behavior-level checks:
- decomposition quality (does model/toolchain split input and aggregate correctly on fixed fixtures)
- recursion efficiency (budget use stays within expected bounds for fixtures)
- stability (result variance under repeated runs with controlled temperature)
Workstream C: Evidence and Reporting
C1. Publish periodic evaluation snapshots
Add docs/reports/rlm-eval-YYYY-MM-DD.md containing:
- benchmark outcomes
- deltas versus previous run
- regression explanations
- confidence and known blind spots
C2. Tie docs to evidence
Any top-level performance statement in README must point to:
- paper citation, or
- local benchmark report,
and include run date.
5) Execution Plan (Phased)
Phase 0 (1-2 days): Correctness of messaging
- Publish taxonomy section in
README.md. - Fix stale defaults/priority mismatches in
DEVELOPMENT.mdanddocs/CONFIGURATION.md. - Add
docs/RLM_CLAIMS_LEDGER.mdscaffold.
Exit criteria:
- No contradictory defaults between docs and runtime for sub-query/backend/timeouts.
- Every major README claim tagged as research-backed, code-backed, or aspirational.
Phase 1 (3-5 days): Measurement baseline
- Implement benchmark harness and fixture set.
- Add CI job that runs a reduced benchmark subset nightly.
- Commit first
docs/reports/rlm-eval-*.md.
Exit criteria:
- Reproducible benchmark report exists.
- README claims reference concrete report or paper.
Phase 2 (1-2 weeks): Capability hardening
- Add research profile preset.
- Add regression tests for decomposition/aggregation and recursion-budget behavior.
- Improve sub-query policy controls (parallelism policy, truncation observability, retry behavior) behind explicit config.
Exit criteria:
- RLM-specific regression gates exist in CI.
- Profile-based reproducibility for paper-like runs is documented.
6) Success Metrics
Presentation metrics:
- Zero stale-default mismatches between docs and runtime constants.
- 100% of top-level claims linked to paper or local reports.
- Clear user understanding of mode boundaries in docs review (qualitative check).
Ability metrics:
- Benchmark suite committed and reproducible.
- Stable pass/fail thresholds for synthetic RLM task families.
- Trendline report shows non-regressing decomposition/aggregation quality.
7) Risks and Mitigations
- Risk: Overfitting to synthetic benchmarks.
- Mitigation: include both synthetic structure tests and real-world corpus fixtures.
- Risk: Benchmark cost/runtime explosion.
- Mitigation: tiered benchmark modes (smoke/nightly/full).
- Risk: Docs become stale again.
- Mitigation: add CI check that validates documented defaults against code constants.
8) Immediate Next Actions
- Approve this plan as the execution baseline.
- Start Phase 0 with doc corrections and claims ledger.
- Open tracking issues for Phase 1 benchmark harness and Phase 2 regression gates.
9) Sources
- Recursive Language Models paper (arXiv): https://arxiv.org/abs/2512.24601
- Official RLM codebase: https://github.com/alexzhang13/rlm
- Author article on RLM framing and limitations: https://towardsdatascience.com/recursive-language-models-new-rules-for-agentic-ai/