Niels van Galen Last - When Context Breaks_ Recursive Language Models with DSPy @PyDataTV
Niels van Galen Last - When Context Breaks_ Recursive Language Models with DSPy  @PyDataTV
Uploaded November 2026 | Updated December 2026, 1 day ago
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

pydata.org

PyData is an educational program of NumFOCUS, a 501(c)3 non-profit organization in the United States. PyData provides a forum for the international community of users and developers of data analysis tools to share ideas and learn from each other. The global PyData network promotes discussion of best practices, new approaches, and emerging technologies for data management, processing, analytics, and visualization. PyData communities approach data science using many languages, including (but not limited to) Python, Julia, and R.

PyData conferences aim to be accessible and community-driven, with novice to advanced level presentations. PyData tutorials and talks bring attendees the latest project features along with cutting-edge use cases.

00:00 Welcome!
00:10 Help us add time stamps or captions to this video! See the description for details.

Want to help add timestamps to our YouTube videos to help with discoverability? Find out more here: github.com/numfocus/YouTubeVideoTimestamps
Niels van Galen Last - When Context Breaks_ Recursive Language Models with DSPyDemystifying Agentic AI Using Small Language Models [PyCon DE & PyData 2026]Beyond CLIP: Implementing CoMM - A Multimodal Contrastive Learning Paper from ICLR 2025Quick-fire round with Dan Katz from Give Me 5 S3E6 (Coming tomorrow)Preet Mehta - Data Design Practices for EHR Data - PyData Boston MeetupCsanád Bakos - Real-time vs Batch Features for Fraud Detection at VintedGive Me 5 S2E3: How to support PyData LisbonRalf Gommers path to NumPy and SciPy | Give Me 5, Season 3, Episode 3J. Nelen - A/B Testing Plenary Debates in the Dutch Parliament with Multi-Agent AI using LangGraphAlexander Kern & Guus van der Ham - Fix the Data, Not the ModelQuick Fire Questions with Peter Wang | GM5 S3E5 PreviewOn Interventional Generalisation [PyCon DE & PyData 2026]
PyData |

Niels van Galen Last - When Context Breaks_ Recursive Language Models with DSPy

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER