It’s Tokens All The Way Down: How RLMs are Different — Kevin Madura, AlixPartners
Read the talk
It’s Tokens All the Way Down: How RLMs Are Different
Kevin Madura explains how recursive language models move large inputs into a programmable REPL, where a model can inspect variables, write code, delegate focused work, and return only the results that matter.
From a talk by Kevin Madura
At a glance
Ideas worth remembering
An RLM keeps large inputs as symbolic objects in a persistent REPL, allowing generated code to inspect and transform them without placing the entire working set in the root model’s context.
Recursion means code can invoke another language model on a selected subset and return a compact result; every step does not need a submodel.
The best candidates have large or dense inputs, natural decomposition, or useful deterministic computation. Small, latency-sensitive tasks may not justify the extra execution and model calls.
The 12-numbers-in-30,000-tokens example captures the core transformation: let the model select regex and Python, then let deterministic code perform extraction and arithmetic.
Typed inputs, outputs, iteration limits, traces, and schemas create a controlled shell, but they do not prove analytical correctness or guarantee good stopping behavior.
The longer-term bet is that post-training models for RLM-style execution will improve decomposition, code generation, delegation, and context selection.
Context becomes programmable state
Kevin Madura of AlixPartners starts with the two properties that define a recursive language model, or RLM. First, its input exists as a symbolic object—typically a variable in a Python REPL—rather than only as tokens placed directly in the transformer’s context window. The model can inspect, slice, search, transform, and compute over that object by writing code. 0:43
Second, code inside that environment can invoke another language model, including the same model with different parameters. The root model can isolate part of the input, delegate a focused question, receive a compact result, and repeat. A submodel can use the same method again, turning one large problem into a recursive tree of smaller computations. 1:13
The distinction from ordinary tool calling lies in where the working state lives. A conventional tool call commonly serializes arguments as JSON, invokes another program, and returns a string. An RLM keeps the source input, generated code, intermediate values, and model-call results inside one persistent computational environment. The model manipulates program state instead of repeatedly translating all state into messages.
What does that execution loop make visible? The diagram follows a large symbolic input through code execution, optional delegation, and final submission. The full input stays in the REPL while selected observations and submodel results enter the root model’s active context.
A document, string, DataFrame, or other object lives as a variable in the REPL.
The root model explores symbolic state, executes code, optionally delegates focused work, and stops when it can submit the requested output.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
A deterministic shell around an adaptive middle
Madura traces an early precursor to work on arbitrarily long inputs with DSPy: a model could recursively summarize a long document and construct a table of contents without loading the whole source into one prompt. The lesson was not that context management had disappeared. A program could exceed one context window by deciding what to inspect and summarize at each step.
He points to long-context benchmarks including OOLONG and BrowseComp as evidence that the method can outperform other approaches on some tasks. One displayed comparison also placed an RLM above a system combining tool calls with BM25 on both performance and price. The recording does not provide the benchmark configurations or numerical values needed to generalize that chart beyond the experiments shown. 3:12
The programming model is a “relatively deterministic shell.” Developers declare the task, expected inputs, requested output types, and broad guidance. The model chooses the middle: which code to write, which evidence to inspect, whether to delegate, and how to proceed from each result. That preserves a stable interface while allowing execution to adapt to the input. 4:13
This is Madura’s “bitter lesson pilled” bet: improving models should receive more responsibility instead of having every decomposition strategy hard-coded around them. The tradeoff is direct. Less prescribed control flow can make a program concise and adaptable, but model quality—especially coding, planning, and stopping behavior—becomes part of the program’s reliability.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Why the root context stays smaller
The motivation is context rot: performance can degrade as a context window fills, even before it reaches its advertised maximum. An RLM reduces pressure on the root model because the complete input remains a variable in the REPL. The model reads selected portions, delegates bounded analyses, and brings back only useful observations. 5:12
Madura separates the mechanisms this way:
- RAG: retrieves material and places it into the prompt, so the retrieved passages still consume context.
- Agents and tool calls: commonly exchange serialized strings, spreading logic, execution, and results across message boundaries.
- Code-oriented tool use: can run computations, but often still moves tool arguments and observations through serialized calls.
- RLMs: retain source objects and intermediate results as native REPL variables on which generated code can continue operating.
These categories can overlap. Madura notes that newer workflow systems also keep intermediate results in script variables, resembling part of the RLM approach. The useful distinction is therefore not a product label. It is whether large state remains available as programmable data and whether model calls can happen from within that persistent environment. 6:43
Recursion does not remove the cost of reading a source. It changes where the source lives and lets the root model decide which pieces deserve tokens. Storage, code execution, and submodel calls replace some direct attention over one giant prompt.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Where RLMs fit—and where they do not
RLMs fit large or dense inputs, naturally decomposable tasks, and longer-running sessions. Madura also suggests large-output generation as an underexplored use case: a model could assemble an output incrementally in its environment instead of emitting hundreds of thousands of lines through one response. His tax-code example follows the same pattern for input: submodels explore selected regions, return promising sections, and let the root model reason across reduced evidence. 7:53
They are a poor fit when the task already fits comfortably in context, low latency matters, or the chosen model is a weak coder. Recursive model calls and code execution add runtime, cost, and more possible failure points. The method earns that overhead only when symbolic computation or decomposition addresses a real bottleneck.
A cited long-chain-of-thought evaluation increased overall accuracy from 2.6% to 45.4%, with strong gains on tasks that could be translated into code, including logic puzzles, chess, and chemistry. That result belongs to the referenced test setup; the recording does not supply enough methodological detail to treat it as an expected improvement for arbitrary workloads. 8:54
The simplest concrete example is deliberately unglamorous: sum 12 numbers scattered across 30,000 tokens. A base model must notice every number, preserve the values through attention, and perform the arithmetic correctly. An RLM can instead search the input variable with a regular expression, parse the matches, and let Python calculate the sum. A fragile language task becomes a deterministic computation selected by the model. 9:38
The causal sequence is locate candidate number strings in the external input, parse them into numeric values, compute the sum in code, and return the result. The model still chooses the extraction logic, so a bad regular expression can produce a bad answer. It no longer has to perform retrieval and arithmetic by attending to all 30,000 tokens at once.
A quick comparison with a coding agent produced a much more bloated solution, but Madura calls the comparison insufficiently investigated and potentially unfair. His production preference is narrower: use declared inputs, outputs, and a defined pipeline instead of handing a free-form prompt to a general agent and hoping its process is economical.
Implementations mentioned in the talk include DSPy, PredictRLM, Ax, and FastRLM. Their emphasis differs: some focus directly on RLM execution, while others incorporate it into a wider programming framework or knowledge-work product. Madura also points to production-trace analysis as another application—a long trace can become the symbolic object from which an RLM extracts decisions about model delegation or workload structure.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
A data scientist inside the program
The cohort-retention walkthrough turns the mechanism into a pipeline. Three DataFrames—users, events, and subscriptions—enter the RLM. The surrounding declaration identifies what to investigate and specifies the requested output types. It does not prescribe every join, aggregation, or comparison. 12:38
The DataFrames live inside the REPL, so the model can inspect their columns, write analysis code, execute it, and use the resulting values in the next iteration. There is no need to serialize every table operation and result through repeated JSON tool calls. The interaction resembles a data scientist working in a Jupyter Notebook with persistent variables.
A large subset could be handed to a submodel for focused analysis, although the demonstrated run did not need that delegation. Recursion is a capability, not a requirement for every step. When direct code execution resolves the task efficiently, another model call would only add cost and latency.
The trace separates generated code from the model’s evolving analysis. After exploring the tables, the model formats key findings and recommendations and invokes a final submission step that returns the typed fields declared at the start. The system can impose a maximum iteration count—10, 100, or another limit—but within that budget the model decides when it has enough evidence to stop. 14:08
That stopping decision is both a benefit and a limitation. It avoids requiring developers to predict every analysis step, yet a model can stop too early, waste iterations, or mistake a suggestive relationship for a sufficient explanation. Typed outputs constrain the answer’s shape; they do not prove that the analysis is correct.
The design goal is to move upward in abstraction: define the objective and output contract, then let the model supply more of the implementation. Madura expects that balance to improve with model capability, but objectives alone do not remove the need for evaluation, execution limits, and application-specific validation.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
From invoices to whole codebases
The closing examples apply the same loop to several kinds of long input:
- Invoices and contracts: consolidate a directory of irregular documents, including a 200-page item, without manually designing every chunking and embedding strategy.
- Logs: inspect raw operational data and surface patterns through generated analysis.
- Agent traces: use Halo to study long task traces and recommend changes to the surrounding harness.
- Source code: scan an intentionally vulnerable OWASP application—described as roughly 500,000 lines—and generate a security report.
Invoice consolidation shows the practical shift most clearly. A conventional pipeline may parse files, choose chunks, create embeddings, retrieve candidate passages, and reconcile fields across documents. An RLM can inspect the document collection iteratively and build the consolidated inventory as program state. This reduces upfront context-engineering code, although correctness still depends on document parsing, model decisions, and validation of the inventory. 16:09
PredictRLM adds schemas between the root model and submodel calls. Those schemas make handoffs readable and state exactly what type of result should return. Madura expects this structure might help cheaper models, but explicitly leaves that as an experiment to run. The grounded benefit is narrower: schemas make recursive handoffs easier to inspect and maintain.
Halo moves recursion up one level. Instead of optimizing only a prompt or fixed workflow, an RLM reads the long traces produced by an agent harness and recommends how that harness should change. The traces are both the object being analyzed and evidence about where orchestration failed, making this a form of meta-optimization. 18:09
The code-security experiment pushes the idea across a whole repository. A small declaration launches analysis over approximately 500,000 lines and asks for a report. The experiment demonstrates how little calling code may be required; it does not establish exhaustive vulnerability detection. Madura’s own phrasing—getting “some type of insights out”—sets the appropriate scope. 19:08
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
When models learn the method natively
Madura closes with the prospect that future models could be post-trained specifically to use the RLM method: inspect symbolic inputs, write effective analysis code, delegate at useful boundaries, manage budgets, and stop at the right time. Today, a framework teaches a general model how to behave this way. Native RLM awareness could make the loop more effective, but that remains the talk’s forward-looking bet. 20:08
The immediate lesson is already concrete. Tokens remain the model’s communication medium, but they no longer need to contain the entire working set at once. A REPL lets the model decide which data becomes tokens, which operations become code, and which subtasks deserve another model call. An RLM trades one enormous attention problem for a sequence of inspectable computations.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Resources
From the talk
The paper defining RLMs and reporting their long-context evaluations.
The companion walkthrough for passing native DataFrames into an RLM, declaring typed cohort-analysis outputs, and inspecting iterative execution traces.
Further reading
The paper authors’ implementation, with multiple REPL environments, recursive calls, logging, and examples for experimenting with the architecture.
A compact Python implementation showing the root model, sandbox, recursive query function, execution limits, and long-document examples.
Examples of typed signatures, recursive summarization, document processing, and optimization that provide useful background for the deterministic-shell programming style.
Related talks
- Recursive Coding Agents
Extends externalized context and recursive delegation into coding-agent orchestration, memory, and long-context work.
- RLM: Recursive Language Models for Large Codebases
Applies RLM execution directly to repository-scale code analysis with inspectable steps and explicit budgets.
- The Unreasonable Effectiveness of Separating the Task from the Model
Develops the complementary DSPy idea of keeping typed task contracts stable while changing models, prompts, reasoning strategies, and RLM implementations underneath.
Read the complete timestamped transcript
- 0:12
Yep. Awesome. Thanks everyone for being
- 0:15
here. My name is Kevin Madura. I'm from
- 0:17
a company called Alex Partners. We're
- 0:19
we're a consulting firm. Um I'm here to
- 0:21
talk to you today about RLMs. Just
- 0:23
curious, show of hands, who here is
- 0:26
familiar with RLMs? So we know how much
- 0:29
time to spend on it. Okay. So not many.
- 0:31
All right. Well, that's good. So we'll
- 0:33
start with what an RLM is and and why
- 0:35
it's different. So RLM is recursive
- 0:38
language model. And really the the key
- 0:40
difference here is that it treats the
- 0:43
context as an object that it can
- 0:46
interact with symbolically in its
- 0:47
environment. So it differs from a tool
- 0:50
call in the sense that typically when
- 0:52
you do a tool call it's JSON or some
- 0:55
type of string that's being sent being
- 0:58
interpreted elsewhere maybe by some
- 1:00
other program and that's that's
- 1:02
returning effectively as a string. The
- 1:04
key difference here is that it's
- 1:06
interacting with a symbolic environment.
- 1:08
So typically that's a ripple Python
- 1:10
ripple. Um so that's key difference
- 1:13
number one. Key difference number two is
- 1:15
that it's it has the ability to delegate
- 1:18
to another LM often to itself. You can
- 1:20
specify whether it's the same model or a
- 1:23
different model, but fundamentally
- 1:24
because it lives in this environment,
- 1:26
you can offload or or make a sub call to
- 1:29
another LM with particular parameters
- 1:31
that also lives in that ripple
- 1:33
environment. And so you get this ability
- 1:36
to recursively decompose problems and
- 1:40
apply and have the LLM basically decide
- 1:42
how to apply certain logic or certain
- 1:45
interpretations or write its own code to
- 1:48
solve those problems and then that
- 1:50
recurses down. So the subLM can do the
- 1:52
same sort of thing in terms of
- 1:53
understanding and interpreting what it
- 1:55
thinks it needs to do. And I added this
- 1:58
last one here. It's largely bitter
- 2:00
lesson pilled in my opinion, right? is
- 2:03
and and shared by Alex and the rest of
- 2:05
the the creators of it. But as models
- 2:08
get better, you should be able to defer
- 2:10
more and more to the model for it to
- 2:13
kind of figure out on its own what it
- 2:15
needs to do.
- 2:17
So the I don't know if this is the
- 2:19
actual kind of starting point for RLMs.
- 2:22
This is one that that I consider to be
- 2:24
one of the the first kind of inklings of
- 2:26
it. This is a tweet from Omar who is
- 2:28
Alex's adviser um for for RLMs. And this
- 2:32
was a concept that he had come up with
- 2:34
where it was basically an ability to use
- 2:37
DSPI and some other techniques to take
- 2:39
in arbitrary
- 2:41
um arbitrary length inputs. And
- 2:43
basically the use case here would be
- 2:45
summarizing an arbitrarily long document
- 2:47
and coming up with a table of contents
- 2:49
and some summary of of that content. But
- 2:53
at least to me, this is kind of the
- 2:54
first inkling of okay, context windows
- 2:56
might not be something you need to
- 2:59
deliberately manage. Although there's of
- 3:00
course benefits to doing so, uh there
- 3:02
there could be ways to um to exceed the
- 3:05
the the context windows using some of
- 3:07
these clever techniques.
- 3:10
Uh and so if you read the paper and some
- 3:12
of the blog posts that are out there
- 3:13
from Alex and Omar, I mean it it it has
- 3:16
demonstrabably better performance on
- 3:18
some of these long context tasks. So,
- 3:21
ulong is one benchmark where um the the
- 3:25
intent of the benchmark it's is to
- 3:26
measure model performance on answering
- 3:28
questions about excessively long
- 3:29
context. This another one browse comp
- 3:32
where it needs to iterate through a
- 3:34
large a large body and corpus of text
- 3:36
and answer particular questions about
- 3:38
it. You can see the blue line at the top
- 3:40
there is the RLM. It's very good
- 3:42
performance as compared to some of these
- 3:44
other models. And even on on the price
- 3:46
curve, the the purple is actually just
- 3:49
using tool calling um with GBT5 calling
- 3:52
a BM25
- 3:54
tool. And that's actually even more
- 3:56
expensive for worse performance than
- 3:58
than an RLM. So it's worth reading into
- 4:01
if you're interested in in some of the
- 4:02
benchmarks and how RLMs perform. Um but
- 4:05
fundamentally uh an RLM again takes in
- 4:09
your input and you're kind of deferring
- 4:10
to the model about how to decompose the
- 4:13
process what code it needs to write and
- 4:16
it is very tightly integrated with the
- 4:18
ripple itself. So it it by itself
- 4:20
defines what it needs to do. And so I
- 4:22
kind of had this mental model in terms
- 4:24
of and I'm very DSP pipel if if you
- 4:27
couldn't tell by now basically a student
- 4:29
of of Omar and the rest of the group
- 4:31
there where you have this relatively
- 4:33
deterministic shell of what you want to
- 4:36
do like what what is your intent what is
- 4:38
your actual task that you're trying to
- 4:40
accomplish. You define that in terms of
- 4:42
your inputs and your outputs and some
- 4:44
type of guidance or prompt or what have
- 4:47
you to the model to say this is
- 4:49
generally what I want to achieve. go off
- 4:51
and do it. Here's the things that you
- 4:53
can expect as your input. Here's what I
- 4:54
want out of it. Go figure out the rest.
- 4:57
And so this applies for using something
- 4:59
like DSPI, but I think it applies to
- 5:00
RLMs as well because you don't have to
- 5:03
worry as much now about how the actual
- 5:07
implementation works in the middle. You
- 5:10
can just have some guarantees about the
- 5:11
inputs and the outputs and you can let
- 5:12
the model figure out the rest of of that
- 5:15
part of it.
- 5:17
So, a lot of this comes down to if if
- 5:18
you were at um I think it was code in
- 5:21
November in uh in New York City, Dex had
- 5:24
this great talk about just broader
- 5:25
context engineering and he he coined
- 5:27
something like the dumb zone which it's
- 5:30
kind of grayed out at the bottom there.
- 5:31
But the point is that we all know that
- 5:33
there's context rot, right? Once you
- 5:35
fill up the context window to a certain
- 5:37
degree, performance starts to degrade.
- 5:39
And so RLMs somewhat get around this
- 5:42
problem because the context itself
- 5:46
doesn't fill up as quickly because
- 5:47
you're deferring a lot of the subtasks
- 5:49
to the subm models and it's the full
- 5:53
kind of context and the inputs aren't
- 5:55
exposed to the context window itself. It
- 5:58
lives as a variable in the ripple and so
- 6:00
the main LM can choose how to um how to
- 6:04
access that. It can offload some of
- 6:06
these subtasks to to sublim. And really
- 6:09
the only context that it gets back are
- 6:11
the things that actually matter. So in
- 6:13
terms of how it's meaningfully
- 6:15
different, rag of course you kind of
- 6:16
just stuff the context window. You want
- 6:18
it to limit there. Agents are largely
- 6:21
just bringing strings back and you don't
- 6:24
have this tight coupling between the
- 6:26
logic, the execution and the results.
- 6:29
And so you still run into the same sort
- 6:31
of problem there. Same thing with tool
- 6:33
calling and and codec. And then RLMs as
- 6:37
I mentioned you're act the the LLM is
- 6:40
actually just interacting with the
- 6:42
context the results as variables in the
- 6:44
ripple so that it can do additional
- 6:46
computation on versus it trying to
- 6:49
attend to all these different tokens in
- 6:50
this in its context window. It's it's a
- 6:52
meaningfully different way of of the LLM
- 6:54
interacting with the uh the actual
- 6:57
content itself.
- 6:59
And so people always say, okay, what's
- 7:00
the difference between that and and
- 7:02
encoding agents? Um,
- 7:05
in my mind, the largest difference is
- 7:07
that the way that tool calls are tool
- 7:09
calls calls are done is passing strings
- 7:12
back and forth. Um but you can see with
- 7:14
the release recently of workflows that
- 7:18
uh Anthropic is doing something fairly
- 7:20
similar and they um at the CIS
- 7:23
conference I think it was Tar or someone
- 7:25
similar um mentioned the RLM paper as a
- 7:30
key driver of workflows and how they're
- 7:33
how they've implemented it. And you can
- 7:35
see here the intermediate results for
- 7:38
workflows live in script variables i.e.
- 7:42
a variable in the context. So, it's
- 7:44
driving some of these these
- 7:46
breakthroughs and some of these
- 7:47
techniques from the from the labs as
- 7:48
well.
- 7:53
I'll skip through this a bit just
- 7:54
because I have about 10 minutes left,
- 7:56
but generally speaking, when you want to
- 7:58
use it, it's obviously for large or
- 8:00
dense input context.
- 8:02
An underexplored area is outputs as
- 8:05
well. So if you have a some type of task
- 8:09
where you need to generate hundreds of
- 8:11
thousands of lines or whatever it might
- 8:12
be, RLMs I think would be a good
- 8:14
candidate for that as well. Obviously
- 8:17
tasks that are imunable to some type of
- 8:18
decomposition. So if you want to look
- 8:21
through the entire I don't know the
- 8:23
whole tax code as an example and try and
- 8:25
find loopholes or something. You can't
- 8:27
obviously put all of that into context
- 8:29
at once. You could use an LLM to crunch
- 8:32
through all of that and iteratively
- 8:34
explore and use sub agents to explore
- 8:36
interesting areas of this of the tax
- 8:38
code. Bring back those sections and then
- 8:40
reason over that and then just generally
- 8:42
for for longer horizon sessions. And
- 8:45
when you want to skip it, of course, it'
- 8:46
be something that fits in context. You
- 8:48
want something that's low latency or the
- 8:50
the model itself is as strong of a
- 8:52
coder.
- 8:54
And uh our friend Raymond here did some
- 8:56
great perfor performance testing on the
- 8:58
long chain of thought benchmark. Um I'll
- 9:01
leave this link as a as a leave behind
- 9:03
after, but just to give you a sense of
- 9:04
how well it performs on some of these
- 9:06
tasks. It's a meaningful jump overall
- 9:09
from from 2.6 to 45.4%
- 9:12
um accuracy on many of these tasks. And
- 9:14
you can see it performs really well on
- 9:16
things that are amanable to code. So
- 9:18
logic puzzles and and chess and
- 9:20
chemistry and things like that where it
- 9:23
can dynamically write code bring in only
- 9:26
the relevant part of the context compute
- 9:29
that and then return the result where
- 9:31
the main model is really just harvesting
- 9:32
the results from from the subLM and try
- 9:34
instead of trying to do that by itself.
- 9:38
Um I put together a few just super
- 9:40
simple examples. I mean, these are kind
- 9:42
of they're somewhat unfair, I suppose,
- 9:44
to to the base model, but it it makes
- 9:46
the point that there are certain tasks
- 9:48
that base models just aren't really fit
- 9:51
to do themselves because they because
- 9:53
they have to attend all these to
- 9:54
different tokens at once in the context
- 9:56
window where you need or want to use
- 9:59
some type of coding approach to that. So
- 10:02
in this random example, summing 12
- 10:04
numbers that are buried across 30,000
- 10:05
tokens, the LLM trying to figure all
- 10:09
that out by itself and give you the
- 10:10
answer isn't always going to work as
- 10:12
well as something that you can write reg
- 10:14
x4 or something similar. And then the
- 10:17
same same sort of thing particularly for
- 10:19
data frames and we'll walk through a
- 10:20
brief example here where because the LLM
- 10:23
can
- 10:25
interact with the data frame within the
- 10:27
ripple. It just has a much better
- 10:29
understanding of the content and can
- 10:31
iterate through that much more quickly
- 10:32
than having to pass tool calls back and
- 10:35
forth in terms of like JSON strings and
- 10:37
and that sort of thing.
- 10:39
Um, and then I threw this in there in
- 10:41
terms of running the same experiments
- 10:43
with a coding agent. Now, I didn't look
- 10:45
into this too deeply. There's probably
- 10:47
some unfair math going on here, but you
- 10:49
can see that it was totally bloated in
- 10:51
terms of the way that cloud code tried
- 10:53
to um tried to solve these tasks. So,
- 10:57
there's more work to be done there, of
- 10:59
course, in terms of like running
- 11:01
experiments to compare base models
- 11:03
versus RLMs versus something like a
- 11:06
coding agent. But there's just for
- 11:07
certain tasks for like production
- 11:09
workloads. My sense is you probably
- 11:11
don't want to just do cloud-p
- 11:14
your prompt and like hope for a good
- 11:16
result. Like you want more of a
- 11:17
structured approach to your inputs, your
- 11:20
outputs and you want a defined pipeline
- 11:21
for doing so which reduces your cost, it
- 11:24
reduces your complexity, reduces your
- 11:25
bloat, all that sort of thing. Um where
- 11:28
RLMs can can shine.
- 11:32
So in the real world there are a bunch
- 11:34
of different open source libraries that
- 11:36
implement RLMs at some level. Some of
- 11:38
them are more RLM focused uh like a
- 11:42
predict RLM would be a good example of
- 11:44
that versus others are kind of just
- 11:46
integrating it into the broader approach
- 11:48
or the broader framework. DSPI obviously
- 11:51
uh there's axe which is really
- 11:53
interesting work uh that's being done
- 11:55
there. Predict RLM is more focused on
- 11:57
like knowledge work. So it works with
- 11:59
spreadsheets and PDFs and that sort of
- 12:01
thing and then fast RLM. And then
- 12:04
there's a tweet yesterday from this guy
- 12:06
Sam Hogan
- 12:07
um where who runs inference.net. He's
- 12:09
using an RLM to basically run and
- 12:13
extract um insights from your particular
- 12:16
um production workload traces so that
- 12:19
they can see what makes sense to defer
- 12:22
off to something like a GLM 5.2 too and
- 12:25
do that iteratively and automatically as
- 12:26
your traffic goes through. So point
- 12:29
being, you don't have to worry about
- 12:32
context engineering. You can kind of
- 12:33
just throw the RLM at it and have it
- 12:35
figure it out. Um, I only have five
- 12:38
minutes left, so we won't go through
- 12:39
this whole example and I'll I'll skip to
- 12:41
some of the traces because that's
- 12:42
probably the most interesting. Um, but
- 12:44
this is all you would really need to do
- 12:46
in terms of a simple, in this case it's
- 12:49
like a a cohort retention analysis,
- 12:51
something that you might give to a data
- 12:53
scientist. But this concept of applying
- 12:56
an RLM to a complex data structure like
- 12:59
a data frame becomes very easy to do.
- 13:02
This is all the code you need to do it
- 13:04
where I'm feeding in three different
- 13:06
data frames. I'm saying these are the
- 13:08
sorts of things you need to look for.
- 13:09
These are the output types that I want.
- 13:11
and then just let the RLM go on it. And
- 13:15
I'll I'll show you some of the traces.
- 13:18
Um, and so it has its own ripple where
- 13:21
it can interact with those data frames.
- 13:23
And you can see it reasoning through.
- 13:25
Okay, first I need to do this. It's
- 13:26
writing the code. And because it's li
- 13:28
it's living in the ripple with the dataf
- 13:30
frame, you don't have this additional
- 13:32
bloat of the tool calls back and forth.
- 13:34
It's actually interacting directly with
- 13:36
the dataf frame as if it was typing in
- 13:38
its own Jupyter notebook. And there
- 13:40
there's significant advantages for for
- 13:43
doing so. And so you can see the sorts
- 13:45
of outputs that it gets as a result. And
- 13:48
it by itself will iterate. And in this
- 13:51
case it didn't, but it has the option to
- 13:53
defer to subLM to do okay. And now I
- 13:56
have this big whatever this big subset
- 13:58
of the data sublm go off and do this
- 14:00
analysis give me the result and it can
- 14:02
do that iteratively over time. Uh but
- 14:05
the point is that the LM is directly
- 14:09
interacting with the data frame in its
- 14:10
ripple
- 14:12
um and kind of iterating through the
- 14:14
results. And so this u this platform
- 14:17
compound is RLM and DSPI native. So it
- 14:21
gives you this really nice breakdown of
- 14:23
the reasoning. It separates out the code
- 14:25
that's being generated and ultimately
- 14:27
you can see
- 14:29
uh the final output which is here where
- 14:33
it's formatting. Okay, here are the key
- 14:35
findings that I have. Here are the
- 14:36
recommendations. And then you have this
- 14:38
final submit which is the final answer
- 14:41
that gives you the the typed um outputs
- 14:43
that you had defined up front. And the
- 14:46
key thing here is that the LLM itself is
- 14:48
deciding when to stop. So you have this
- 14:51
you have a variable of max iteration. So
- 14:53
you can just you can decide whether you
- 14:55
want it to have a maximum of 10 or 100
- 14:57
or whatever it is. But it will by itself
- 15:00
explore the data, understand what needs
- 15:02
to happen and then when it it itself is
- 15:05
comfortable, it can run submit and give
- 15:07
you the final output. Again, being
- 15:10
bitter or less impilled, this will get
- 15:11
better over time. You can kind of just
- 15:13
defer everything and it will figure out
- 15:15
what to do. And so the hope would be you
- 15:18
don't have to I mean we're already you
- 15:20
know whatever this is 20 lines of code
- 15:22
or something. Um, but you can you can
- 15:25
see a world where you can continue to go
- 15:27
up levels of abstraction. As long as you
- 15:29
can define what your objective is and
- 15:31
what you want it to do, the the model
- 15:33
will kind of figure out the rest. Uh, so
- 15:36
we just walk through a bunch of this,
- 15:37
but um these are the different steps
- 15:39
that it took in this example in the code
- 15:42
that it wrote. Um, and then I'll just
- 15:45
breeze through a few real world case
- 15:47
studies and where it's actually being
- 15:48
used. So I mentioned predict rm before.
- 15:51
So the company trampoline AI I think it
- 15:54
is they're doing really interesting work
- 15:56
in applying RLMs u like I mentioned
- 15:58
before for different pieces of knowledge
- 16:01
work. So natively interacting with PDFs
- 16:04
and and spreadsheets and that sort of
- 16:06
thing. So in this relatively simple
- 16:08
example okay I have a bunch of I have a
- 16:11
directory of invoices that I need to
- 16:13
create one consolidated inventory out
- 16:15
of.
- 16:17
As we all know invoices can be
- 16:19
complicated. that can be very long, that
- 16:21
can kind of be all over the place. To do
- 16:24
that today without RLMs or this sort of
- 16:27
like framework gets very complicated
- 16:30
very quickly. I have a lot of battle
- 16:32
scars to to prove it. Um, but with
- 16:34
something like an RLM, you you don't
- 16:35
need to worry as much about, okay, if I
- 16:37
have a 200page invoice or contract or
- 16:40
whatever it is, you can let the RLM just
- 16:43
churn through all of that and give you
- 16:44
the result instead of having to worry
- 16:46
about chunking and embedding maybe and
- 16:49
doing all these different strategies to
- 16:51
try and get around the context window
- 16:53
management that we've all had to to do
- 16:55
previously.
- 16:57
Um, so it allows you, the point there is
- 16:59
that you can focus on the abstractions
- 17:02
and what you actually want to do instead
- 17:03
of the context engineering itself, which
- 17:05
I think is a really helpful um, helpful
- 17:08
output of all of this. And an
- 17:10
interesting tidbit for all the DSPI fans
- 17:12
in the room, predict RLM uses DSPI to
- 17:16
determine the schemas between the main
- 17:19
LM and the subLM calls, which I
- 17:22
personally think is is a nice feature
- 17:24
because you have a lot more readability
- 17:26
and maintainability. So you understand
- 17:29
exactly what the model is trying to
- 17:31
achieve and the model can be much more
- 17:32
precise and prescriptive about the types
- 17:35
of data that it's looking for from the
- 17:37
subLM. And I would want to do some
- 17:40
experiments to test this out, but I
- 17:42
would think that this would improve
- 17:43
performance for cheaper models like a a
- 17:46
Quinn or some of the other ones because
- 17:48
you're specifying the inputs and outputs
- 17:49
and you're enforcing those types coming
- 17:51
back. And so you get all the benefits of
- 17:54
the RLM being able to churn through all
- 17:56
this information, but you have a lot
- 17:58
more of the structure in between where
- 18:01
when it's handing off to a sublm, it it
- 18:03
enforces some of the uh some of those
- 18:05
schemas.
- 18:07
This is an example from um an AWS
- 18:10
engineer from a couple days ago. We were
- 18:13
just kind of playing around with it, but
- 18:14
I just thought it was a nice example of
- 18:17
you can kind of just throw arbitrary
- 18:20
data at RLM. In this case, it was a
- 18:23
bunch of log data um to surface some
- 18:26
interesting uh results and he he found
- 18:28
it useful. Um there's a a project called
- 18:32
Halo which uses an RLM to look at traces
- 18:36
of um of different t uh agent tasks.
- 18:41
And basically the promise of Halo is
- 18:43
that instead of optimizing a particular
- 18:45
like workflow or DSPI uh or or other
- 18:49
framework
- 18:51
uh like structure itself, it's it's
- 18:53
actually iterating on the harness. So
- 18:56
it's like a meta abstraction almost or
- 18:58
meta optimization of the harness itself
- 19:01
and it uses an RLM because as we all
- 19:03
know tracing can get very long and and
- 19:05
complicated.
- 19:07
So the RLM can not only take in all that
- 19:09
context but also leverage the um the
- 19:13
structure of those traces to to
- 19:15
recommend a better um a better harness.
- 19:18
And then this last one uh this is all
- 19:21
the code you need. I ran this little
- 19:23
experiment. There's a an intentionally
- 19:25
vulnerable application called uh it's
- 19:27
from OASP, but basically there's a it's
- 19:30
a web app with a bunch of
- 19:31
vulnerabilities in it. This is all the
- 19:33
code you need on the right hand side to
- 19:35
run basically an agent to run through
- 19:38
whatever it is 500,000 lines of code to
- 19:41
generate some type of security report.
- 19:42
That's just an arbitrary example, but
- 19:44
the point is you don't need a lot of
- 19:47
context engineering. You don't need a
- 19:48
lot of structure around it to achieve
- 19:51
what you want to do. And so you can feed
- 19:53
in an arbitrary uh size codebase into
- 19:56
this and get some type of insights out.
- 19:58
So you can imagine that being applied to
- 20:00
other areas as well. Um so I know I I
- 20:04
rushed through everything a little bit
- 20:05
but I'm happy to answer questions
- 20:06
afterwards. Uh the I'll leave you leave
- 20:09
you with this. The biggest promise I see
- 20:11
here is just imagine a world where the
- 20:13
models are actually post-trained and
- 20:16
actually like RLM aware. I think things
- 20:18
will get pretty crazy pretty quick when
- 20:21
they actually know how to use and kind
- 20:24
of take advantage of the RLM methodology
- 20:27
natively. So, thank you so much for your
- 20:29
time.