PyData Amsterdam 2026

When Context Breaks: Recursive Language Models with DSPy
2026-09-10 , Room 2 (350)

Current LLM workflows work surprisingly well until context becomes the bottleneck. Tasks like multi-file code changes, long-log debugging, or stateful tool use that many teams attempt to solve with prompt engineering or agents often succeed at small scale and then become brittle as the amount of context grows.

This talk introduces Recursive Language Models (RLMs), a different approach in which context is treated as data that can be programmatically explored, decomposed, and revisited - rather than input that must be consumed in a single prompt. This shifts long-context LLM systems from brittle prompt orchestration to programs that explicitly explore, track, and update context over time.

Using DSPy as a concrete Python implementation, I will demonstrate how this approach turns a failing long-context task into a tractable one, and what this shift means for designing LLM systems in practice.

Attendees will leave with a clear mental model for when standard prompting breaks, what RLMs change technically, and how to prototype this pattern in practice.


Current LLM workflows work surprisingly well until context becomes the bottleneck. Tasks like multi-file code changes, long-log debugging, or stateful tool use that many teams attempt to solve with prompt engineering or agents often succeed at small scale and then become brittle as the amount of context grows.

This talk introduces Recursive Language Models (RLMs), a different approach in which context is treated as data that can be programmatically explored, decomposed, and revisited - rather than input that must be consumed in a single prompt. This shifts long-context LLM systems from brittle prompt orchestration to programs that explicitly explore, track, and update context over time.

Using DSPy as a concrete Python implementation, I will demonstrate how this approach turns a failing long-context task into a tractable one, and what this shift means for designing LLM systems in practice.

Attendees will leave with a clear mental model for when standard prompting breaks, what RLMs change technically, and how to prototype this pattern in practice.

Many LLM systems work well on the first version of a task and then degrade as the problem grows. A prompt that succeeds on one file struggles on ten; a workflow that works for a short sequence becomes brittle when it must track more state, revisit earlier decisions, or reason over larger context. In practice, the limitation is often not model capability, but the assumption that all relevant context must fit into a single prompt or prompt loop.

This talk introduces Recursive Language Models (RLMs) through that failure mode first. RLMs treat context not as input to be consumed, but as data that can be programmatically explored, decomposed, and revisited. Instead of relying on a single prompt, the model interacts with context through code, recursively breaking problems into smaller parts and selectively accessing only what is needed.

Using DSPy's dspy.RLM as a concrete Python implementation, I will demonstrate this shift with a compact example. We start with a task that works under a standard approach and then fails as the context grows. I then show how an RLM-style solution changes the structure of the problem: from brittle prompt orchestration to a program that explores context step by step, maintains explicit state, and revisits intermediate results when needed.

While the underlying idea is general, DSPy provides a clean way to prototype this pattern in Python, using a sandboxed REPL and recursive calls to interact with context. For many practitioners still writing prompts by hand, DSPy offers a structured path from prompt engineering to programmatic LLM systems.

Attendees will leave with:

  • a concrete understanding of why prompt-based and agent-style approaches become brittle as context grows
  • a practical mental model for treating context as something to operate on, not just consume
  • a clear starting point for implementing this pattern in Python using DSPy

This is a technical talk for Python practitioners building LLM systems who want a more robust abstraction for long-context reasoning than "add more context" or "add another agent step.

Proposed structure (30 minutes)

  • Introduction: where current LLM workflows break as context grows (5 min)
  • A concrete example: a task that works at small scale and fails with larger context (5 min)
  • Why this happens: limits of prompt-based and agent-style approaches (5 min)
  • The shift: treating context as something to explore rather than consume (5 min)
  • Recursive Language Models (RLMs): core idea and intuition (5 min)
  • DSPy example: implementing the pattern in Python (5 min)

Optional extension (45 minutes)

  • Additional time for a deeper implementation walkthrough and discussion of trade-offs, limitations, and real-world applications

Niels van Galen Last is a Staff ML Engineer and Head of AI Engineering, focused on building production-grade AI and ML systems at scale. He leads the architectural foundation of a shared AI platform serving 35+ organizations, operating across distributed and international environments, with a focus on evaluation-driven development, reproducibility, and long-term system reliability.

His work centers on turning experimental models into robust systems: building evaluation frameworks, standardizing LLM and RAG architectures, and designing infrastructure for reliable deployment across cloud and hybrid environments. He has led high-impact AI systems across domains including document AI, optimization, and large-scale ML platforms.

Niels studied Computational and Mathematical Engineering at Stanford University and has held technical leadership roles across startups, consulting, and enterprise environments.