Context Rot Is Real. DSPy’s New RLM Module Fixes It — Here’s the Actual Code DSPy shipped dspy.RLM, a Recursive Language Model module in version 3.1.2, to address context rot — the tendency of models to lose performance on long inputs before reaching their advertised context window size, as identified by MIT researchers. The module lets models programmatically explore oversized prompts rather than reading them in one pass, offering a production-ready fix for reasoning across full inputs. Member-only story Context Rot Is Real. DSPy’s New RLM Module Fixes It — Here’s the Actual Code A factual walkthrough of dspy.RLM, the official Recursive Language Model module DSPy shipped in version 3.1.2. Every code sample below uses the real, documented API — no simulated or illustrative approximations. Every frontier lab spent 2025 and early 2026 competing on context window size — 200K tokens, then a million. The pitch was always the same: bigger window, handles bigger problems. MIT researchers gave that pitch a name this year that isn’t flattering: context rot — the well-documented tendency of every current model, regardless of its advertised window size, to lose reliable performance well before it hits that advertised limit, specifically on tasks that require reasoning across the full input rather than just finding one needle in a haystack. The fix that’s actually shipping in production tooling right now isn’t a bigger window. It’s Recursive Language Models RLMs — letting a model treat an oversized prompt as something it can programmatically explore, rather than something it has to read in one pass. DSPy, the widely used framework for programming not just prompting language models, shipped this as a first-class module — dspy.RLM —…