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

Captures the second defining property: the root model can delegate focused work to another language model, including itself.
Captures the second defining property: the root model can delegate focused work to another language model, including itself.

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.

How it fits togetherThe recursive language model loop

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.

0:12 · section reference included

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.

Illustrates Madura’s deterministic-shell model: developers define intent and interfaces while the model supplies the implementation.
Illustrates Madura’s deterministic-shell model: developers define intent and interfaces while the model supplies the implementation.

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.

2:13 · section reference included

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

Useful comparison frame distinguishing RAG, agents, tool calls, CodeAct, and RLMs.
Useful comparison frame distinguishing RAG, agents, tool calls, CodeAct, and RLMs.

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.

5:12 · section reference included

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

Illustrates the concrete example of summing 12 numbers buried across 30,000 tokens.
Illustrates the concrete example of summing 12 numbers buried across 30,000 tokens.

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.

7:53 · section reference included

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

Shows the final submit step, typed outputs, and the model-controlled stopping point.
Shows the final submit step, typed outputs, and the model-controlled stopping point.

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.

12:38 · section reference included

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.
Captures Halo’s use of long agent traces to recommend changes to the surrounding harness.
Captures Halo’s use of long agent traces to recommend changes to the surrounding harness.

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.

15:39 · section reference included

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

Closing frame supporting the forward-looking bet that post-trained, RLM-aware models could use the method natively.
Closing frame supporting the forward-looking bet that post-trained, RLM-aware models could use the method natively.

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.

20:08 · section reference included

Resources

From the talk

Read the complete timestamped transcript
  1. 0:12

    Yep. Awesome. Thanks everyone for being

  2. 0:15

    here. My name is Kevin Madura. I'm from

  3. 0:17

    a company called Alex Partners. We're

  4. 0:19

    we're a consulting firm. Um I'm here to

  5. 0:21

    talk to you today about RLMs. Just

  6. 0:23

    curious, show of hands, who here is

  7. 0:26

    familiar with RLMs? So we know how much

  8. 0:29

    time to spend on it. Okay. So not many.

  9. 0:31

    All right. Well, that's good. So we'll

  10. 0:33

    start with what an RLM is and and why

  11. 0:35

    it's different. So RLM is recursive

  12. 0:38

    language model. And really the the key

  13. 0:40

    difference here is that it treats the

  14. 0:43

    context as an object that it can

  15. 0:46

    interact with symbolically in its

  16. 0:47

    environment. So it differs from a tool

  17. 0:50

    call in the sense that typically when

  18. 0:52

    you do a tool call it's JSON or some

  19. 0:55

    type of string that's being sent being

  20. 0:58

    interpreted elsewhere maybe by some

  21. 1:00

    other program and that's that's

  22. 1:02

    returning effectively as a string. The

  23. 1:04

    key difference here is that it's

  24. 1:06

    interacting with a symbolic environment.

  25. 1:08

    So typically that's a ripple Python

  26. 1:10

    ripple. Um so that's key difference

  27. 1:13

    number one. Key difference number two is

  28. 1:15

    that it's it has the ability to delegate

  29. 1:18

    to another LM often to itself. You can

  30. 1:20

    specify whether it's the same model or a

  31. 1:23

    different model, but fundamentally

  32. 1:24

    because it lives in this environment,

  33. 1:26

    you can offload or or make a sub call to

  34. 1:29

    another LM with particular parameters

  35. 1:31

    that also lives in that ripple

  36. 1:33

    environment. And so you get this ability

  37. 1:36

    to recursively decompose problems and

  38. 1:40

    apply and have the LLM basically decide

  39. 1:42

    how to apply certain logic or certain

  40. 1:45

    interpretations or write its own code to

  41. 1:48

    solve those problems and then that

  42. 1:50

    recurses down. So the subLM can do the

  43. 1:52

    same sort of thing in terms of

  44. 1:53

    understanding and interpreting what it

  45. 1:55

    thinks it needs to do. And I added this

  46. 1:58

    last one here. It's largely bitter

  47. 2:00

    lesson pilled in my opinion, right? is

  48. 2:03

    and and shared by Alex and the rest of

  49. 2:05

    the the creators of it. But as models

  50. 2:08

    get better, you should be able to defer

  51. 2:10

    more and more to the model for it to

  52. 2:13

    kind of figure out on its own what it

  53. 2:15

    needs to do.

  54. 2:17

    So the I don't know if this is the

  55. 2:19

    actual kind of starting point for RLMs.

  56. 2:22

    This is one that that I consider to be

  57. 2:24

    one of the the first kind of inklings of

  58. 2:26

    it. This is a tweet from Omar who is

  59. 2:28

    Alex's adviser um for for RLMs. And this

  60. 2:32

    was a concept that he had come up with

  61. 2:34

    where it was basically an ability to use

  62. 2:37

    DSPI and some other techniques to take

  63. 2:39

    in arbitrary

  64. 2:41

    um arbitrary length inputs. And

  65. 2:43

    basically the use case here would be

  66. 2:45

    summarizing an arbitrarily long document

  67. 2:47

    and coming up with a table of contents

  68. 2:49

    and some summary of of that content. But

  69. 2:53

    at least to me, this is kind of the

  70. 2:54

    first inkling of okay, context windows

  71. 2:56

    might not be something you need to

  72. 2:59

    deliberately manage. Although there's of

  73. 3:00

    course benefits to doing so, uh there

  74. 3:02

    there could be ways to um to exceed the

  75. 3:05

    the the context windows using some of

  76. 3:07

    these clever techniques.

  77. 3:10

    Uh and so if you read the paper and some

  78. 3:12

    of the blog posts that are out there

  79. 3:13

    from Alex and Omar, I mean it it it has

  80. 3:16

    demonstrabably better performance on

  81. 3:18

    some of these long context tasks. So,

  82. 3:21

    ulong is one benchmark where um the the

  83. 3:25

    intent of the benchmark it's is to

  84. 3:26

    measure model performance on answering

  85. 3:28

    questions about excessively long

  86. 3:29

    context. This another one browse comp

  87. 3:32

    where it needs to iterate through a

  88. 3:34

    large a large body and corpus of text

  89. 3:36

    and answer particular questions about

  90. 3:38

    it. You can see the blue line at the top

  91. 3:40

    there is the RLM. It's very good

  92. 3:42

    performance as compared to some of these

  93. 3:44

    other models. And even on on the price

  94. 3:46

    curve, the the purple is actually just

  95. 3:49

    using tool calling um with GBT5 calling

  96. 3:52

    a BM25

  97. 3:54

    tool. And that's actually even more

  98. 3:56

    expensive for worse performance than

  99. 3:58

    than an RLM. So it's worth reading into

  100. 4:01

    if you're interested in in some of the

  101. 4:02

    benchmarks and how RLMs perform. Um but

  102. 4:05

    fundamentally uh an RLM again takes in

  103. 4:09

    your input and you're kind of deferring

  104. 4:10

    to the model about how to decompose the

  105. 4:13

    process what code it needs to write and

  106. 4:16

    it is very tightly integrated with the

  107. 4:18

    ripple itself. So it it by itself

  108. 4:20

    defines what it needs to do. And so I

  109. 4:22

    kind of had this mental model in terms

  110. 4:24

    of and I'm very DSP pipel if if you

  111. 4:27

    couldn't tell by now basically a student

  112. 4:29

    of of Omar and the rest of the group

  113. 4:31

    there where you have this relatively

  114. 4:33

    deterministic shell of what you want to

  115. 4:36

    do like what what is your intent what is

  116. 4:38

    your actual task that you're trying to

  117. 4:40

    accomplish. You define that in terms of

  118. 4:42

    your inputs and your outputs and some

  119. 4:44

    type of guidance or prompt or what have

  120. 4:47

    you to the model to say this is

  121. 4:49

    generally what I want to achieve. go off

  122. 4:51

    and do it. Here's the things that you

  123. 4:53

    can expect as your input. Here's what I

  124. 4:54

    want out of it. Go figure out the rest.

  125. 4:57

    And so this applies for using something

  126. 4:59

    like DSPI, but I think it applies to

  127. 5:00

    RLMs as well because you don't have to

  128. 5:03

    worry as much now about how the actual

  129. 5:07

    implementation works in the middle. You

  130. 5:10

    can just have some guarantees about the

  131. 5:11

    inputs and the outputs and you can let

  132. 5:12

    the model figure out the rest of of that

  133. 5:15

    part of it.

  134. 5:17

    So, a lot of this comes down to if if

  135. 5:18

    you were at um I think it was code in

  136. 5:21

    November in uh in New York City, Dex had

  137. 5:24

    this great talk about just broader

  138. 5:25

    context engineering and he he coined

  139. 5:27

    something like the dumb zone which it's

  140. 5:30

    kind of grayed out at the bottom there.

  141. 5:31

    But the point is that we all know that

  142. 5:33

    there's context rot, right? Once you

  143. 5:35

    fill up the context window to a certain

  144. 5:37

    degree, performance starts to degrade.

  145. 5:39

    And so RLMs somewhat get around this

  146. 5:42

    problem because the context itself

  147. 5:46

    doesn't fill up as quickly because

  148. 5:47

    you're deferring a lot of the subtasks

  149. 5:49

    to the subm models and it's the full

  150. 5:53

    kind of context and the inputs aren't

  151. 5:55

    exposed to the context window itself. It

  152. 5:58

    lives as a variable in the ripple and so

  153. 6:00

    the main LM can choose how to um how to

  154. 6:04

    access that. It can offload some of

  155. 6:06

    these subtasks to to sublim. And really

  156. 6:09

    the only context that it gets back are

  157. 6:11

    the things that actually matter. So in

  158. 6:13

    terms of how it's meaningfully

  159. 6:15

    different, rag of course you kind of

  160. 6:16

    just stuff the context window. You want

  161. 6:18

    it to limit there. Agents are largely

  162. 6:21

    just bringing strings back and you don't

  163. 6:24

    have this tight coupling between the

  164. 6:26

    logic, the execution and the results.

  165. 6:29

    And so you still run into the same sort

  166. 6:31

    of problem there. Same thing with tool

  167. 6:33

    calling and and codec. And then RLMs as

  168. 6:37

    I mentioned you're act the the LLM is

  169. 6:40

    actually just interacting with the

  170. 6:42

    context the results as variables in the

  171. 6:44

    ripple so that it can do additional

  172. 6:46

    computation on versus it trying to

  173. 6:49

    attend to all these different tokens in

  174. 6:50

    this in its context window. It's it's a

  175. 6:52

    meaningfully different way of of the LLM

  176. 6:54

    interacting with the uh the actual

  177. 6:57

    content itself.

  178. 6:59

    And so people always say, okay, what's

  179. 7:00

    the difference between that and and

  180. 7:02

    encoding agents? Um,

  181. 7:05

    in my mind, the largest difference is

  182. 7:07

    that the way that tool calls are tool

  183. 7:09

    calls calls are done is passing strings

  184. 7:12

    back and forth. Um but you can see with

  185. 7:14

    the release recently of workflows that

  186. 7:18

    uh Anthropic is doing something fairly

  187. 7:20

    similar and they um at the CIS

  188. 7:23

    conference I think it was Tar or someone

  189. 7:25

    similar um mentioned the RLM paper as a

  190. 7:30

    key driver of workflows and how they're

  191. 7:33

    how they've implemented it. And you can

  192. 7:35

    see here the intermediate results for

  193. 7:38

    workflows live in script variables i.e.

  194. 7:42

    a variable in the context. So, it's

  195. 7:44

    driving some of these these

  196. 7:46

    breakthroughs and some of these

  197. 7:47

    techniques from the from the labs as

  198. 7:48

    well.

  199. 7:53

    I'll skip through this a bit just

  200. 7:54

    because I have about 10 minutes left,

  201. 7:56

    but generally speaking, when you want to

  202. 7:58

    use it, it's obviously for large or

  203. 8:00

    dense input context.

  204. 8:02

    An underexplored area is outputs as

  205. 8:05

    well. So if you have a some type of task

  206. 8:09

    where you need to generate hundreds of

  207. 8:11

    thousands of lines or whatever it might

  208. 8:12

    be, RLMs I think would be a good

  209. 8:14

    candidate for that as well. Obviously

  210. 8:17

    tasks that are imunable to some type of

  211. 8:18

    decomposition. So if you want to look

  212. 8:21

    through the entire I don't know the

  213. 8:23

    whole tax code as an example and try and

  214. 8:25

    find loopholes or something. You can't

  215. 8:27

    obviously put all of that into context

  216. 8:29

    at once. You could use an LLM to crunch

  217. 8:32

    through all of that and iteratively

  218. 8:34

    explore and use sub agents to explore

  219. 8:36

    interesting areas of this of the tax

  220. 8:38

    code. Bring back those sections and then

  221. 8:40

    reason over that and then just generally

  222. 8:42

    for for longer horizon sessions. And

  223. 8:45

    when you want to skip it, of course, it'

  224. 8:46

    be something that fits in context. You

  225. 8:48

    want something that's low latency or the

  226. 8:50

    the model itself is as strong of a

  227. 8:52

    coder.

  228. 8:54

    And uh our friend Raymond here did some

  229. 8:56

    great perfor performance testing on the

  230. 8:58

    long chain of thought benchmark. Um I'll

  231. 9:01

    leave this link as a as a leave behind

  232. 9:03

    after, but just to give you a sense of

  233. 9:04

    how well it performs on some of these

  234. 9:06

    tasks. It's a meaningful jump overall

  235. 9:09

    from from 2.6 to 45.4%

  236. 9:12

    um accuracy on many of these tasks. And

  237. 9:14

    you can see it performs really well on

  238. 9:16

    things that are amanable to code. So

  239. 9:18

    logic puzzles and and chess and

  240. 9:20

    chemistry and things like that where it

  241. 9:23

    can dynamically write code bring in only

  242. 9:26

    the relevant part of the context compute

  243. 9:29

    that and then return the result where

  244. 9:31

    the main model is really just harvesting

  245. 9:32

    the results from from the subLM and try

  246. 9:34

    instead of trying to do that by itself.

  247. 9:38

    Um I put together a few just super

  248. 9:40

    simple examples. I mean, these are kind

  249. 9:42

    of they're somewhat unfair, I suppose,

  250. 9:44

    to to the base model, but it it makes

  251. 9:46

    the point that there are certain tasks

  252. 9:48

    that base models just aren't really fit

  253. 9:51

    to do themselves because they because

  254. 9:53

    they have to attend all these to

  255. 9:54

    different tokens at once in the context

  256. 9:56

    window where you need or want to use

  257. 9:59

    some type of coding approach to that. So

  258. 10:02

    in this random example, summing 12

  259. 10:04

    numbers that are buried across 30,000

  260. 10:05

    tokens, the LLM trying to figure all

  261. 10:09

    that out by itself and give you the

  262. 10:10

    answer isn't always going to work as

  263. 10:12

    well as something that you can write reg

  264. 10:14

    x4 or something similar. And then the

  265. 10:17

    same same sort of thing particularly for

  266. 10:19

    data frames and we'll walk through a

  267. 10:20

    brief example here where because the LLM

  268. 10:23

    can

  269. 10:25

    interact with the data frame within the

  270. 10:27

    ripple. It just has a much better

  271. 10:29

    understanding of the content and can

  272. 10:31

    iterate through that much more quickly

  273. 10:32

    than having to pass tool calls back and

  274. 10:35

    forth in terms of like JSON strings and

  275. 10:37

    and that sort of thing.

  276. 10:39

    Um, and then I threw this in there in

  277. 10:41

    terms of running the same experiments

  278. 10:43

    with a coding agent. Now, I didn't look

  279. 10:45

    into this too deeply. There's probably

  280. 10:47

    some unfair math going on here, but you

  281. 10:49

    can see that it was totally bloated in

  282. 10:51

    terms of the way that cloud code tried

  283. 10:53

    to um tried to solve these tasks. So,

  284. 10:57

    there's more work to be done there, of

  285. 10:59

    course, in terms of like running

  286. 11:01

    experiments to compare base models

  287. 11:03

    versus RLMs versus something like a

  288. 11:06

    coding agent. But there's just for

  289. 11:07

    certain tasks for like production

  290. 11:09

    workloads. My sense is you probably

  291. 11:11

    don't want to just do cloud-p

  292. 11:14

    your prompt and like hope for a good

  293. 11:16

    result. Like you want more of a

  294. 11:17

    structured approach to your inputs, your

  295. 11:20

    outputs and you want a defined pipeline

  296. 11:21

    for doing so which reduces your cost, it

  297. 11:24

    reduces your complexity, reduces your

  298. 11:25

    bloat, all that sort of thing. Um where

  299. 11:28

    RLMs can can shine.

  300. 11:32

    So in the real world there are a bunch

  301. 11:34

    of different open source libraries that

  302. 11:36

    implement RLMs at some level. Some of

  303. 11:38

    them are more RLM focused uh like a

  304. 11:42

    predict RLM would be a good example of

  305. 11:44

    that versus others are kind of just

  306. 11:46

    integrating it into the broader approach

  307. 11:48

    or the broader framework. DSPI obviously

  308. 11:51

    uh there's axe which is really

  309. 11:53

    interesting work uh that's being done

  310. 11:55

    there. Predict RLM is more focused on

  311. 11:57

    like knowledge work. So it works with

  312. 11:59

    spreadsheets and PDFs and that sort of

  313. 12:01

    thing and then fast RLM. And then

  314. 12:04

    there's a tweet yesterday from this guy

  315. 12:06

    Sam Hogan

  316. 12:07

    um where who runs inference.net. He's

  317. 12:09

    using an RLM to basically run and

  318. 12:13

    extract um insights from your particular

  319. 12:16

    um production workload traces so that

  320. 12:19

    they can see what makes sense to defer

  321. 12:22

    off to something like a GLM 5.2 too and

  322. 12:25

    do that iteratively and automatically as

  323. 12:26

    your traffic goes through. So point

  324. 12:29

    being, you don't have to worry about

  325. 12:32

    context engineering. You can kind of

  326. 12:33

    just throw the RLM at it and have it

  327. 12:35

    figure it out. Um, I only have five

  328. 12:38

    minutes left, so we won't go through

  329. 12:39

    this whole example and I'll I'll skip to

  330. 12:41

    some of the traces because that's

  331. 12:42

    probably the most interesting. Um, but

  332. 12:44

    this is all you would really need to do

  333. 12:46

    in terms of a simple, in this case it's

  334. 12:49

    like a a cohort retention analysis,

  335. 12:51

    something that you might give to a data

  336. 12:53

    scientist. But this concept of applying

  337. 12:56

    an RLM to a complex data structure like

  338. 12:59

    a data frame becomes very easy to do.

  339. 13:02

    This is all the code you need to do it

  340. 13:04

    where I'm feeding in three different

  341. 13:06

    data frames. I'm saying these are the

  342. 13:08

    sorts of things you need to look for.

  343. 13:09

    These are the output types that I want.

  344. 13:11

    and then just let the RLM go on it. And

  345. 13:15

    I'll I'll show you some of the traces.

  346. 13:18

    Um, and so it has its own ripple where

  347. 13:21

    it can interact with those data frames.

  348. 13:23

    And you can see it reasoning through.

  349. 13:25

    Okay, first I need to do this. It's

  350. 13:26

    writing the code. And because it's li

  351. 13:28

    it's living in the ripple with the dataf

  352. 13:30

    frame, you don't have this additional

  353. 13:32

    bloat of the tool calls back and forth.

  354. 13:34

    It's actually interacting directly with

  355. 13:36

    the dataf frame as if it was typing in

  356. 13:38

    its own Jupyter notebook. And there

  357. 13:40

    there's significant advantages for for

  358. 13:43

    doing so. And so you can see the sorts

  359. 13:45

    of outputs that it gets as a result. And

  360. 13:48

    it by itself will iterate. And in this

  361. 13:51

    case it didn't, but it has the option to

  362. 13:53

    defer to subLM to do okay. And now I

  363. 13:56

    have this big whatever this big subset

  364. 13:58

    of the data sublm go off and do this

  365. 14:00

    analysis give me the result and it can

  366. 14:02

    do that iteratively over time. Uh but

  367. 14:05

    the point is that the LM is directly

  368. 14:09

    interacting with the data frame in its

  369. 14:10

    ripple

  370. 14:12

    um and kind of iterating through the

  371. 14:14

    results. And so this u this platform

  372. 14:17

    compound is RLM and DSPI native. So it

  373. 14:21

    gives you this really nice breakdown of

  374. 14:23

    the reasoning. It separates out the code

  375. 14:25

    that's being generated and ultimately

  376. 14:27

    you can see

  377. 14:29

    uh the final output which is here where

  378. 14:33

    it's formatting. Okay, here are the key

  379. 14:35

    findings that I have. Here are the

  380. 14:36

    recommendations. And then you have this

  381. 14:38

    final submit which is the final answer

  382. 14:41

    that gives you the the typed um outputs

  383. 14:43

    that you had defined up front. And the

  384. 14:46

    key thing here is that the LLM itself is

  385. 14:48

    deciding when to stop. So you have this

  386. 14:51

    you have a variable of max iteration. So

  387. 14:53

    you can just you can decide whether you

  388. 14:55

    want it to have a maximum of 10 or 100

  389. 14:57

    or whatever it is. But it will by itself

  390. 15:00

    explore the data, understand what needs

  391. 15:02

    to happen and then when it it itself is

  392. 15:05

    comfortable, it can run submit and give

  393. 15:07

    you the final output. Again, being

  394. 15:10

    bitter or less impilled, this will get

  395. 15:11

    better over time. You can kind of just

  396. 15:13

    defer everything and it will figure out

  397. 15:15

    what to do. And so the hope would be you

  398. 15:18

    don't have to I mean we're already you

  399. 15:20

    know whatever this is 20 lines of code

  400. 15:22

    or something. Um, but you can you can

  401. 15:25

    see a world where you can continue to go

  402. 15:27

    up levels of abstraction. As long as you

  403. 15:29

    can define what your objective is and

  404. 15:31

    what you want it to do, the the model

  405. 15:33

    will kind of figure out the rest. Uh, so

  406. 15:36

    we just walk through a bunch of this,

  407. 15:37

    but um these are the different steps

  408. 15:39

    that it took in this example in the code

  409. 15:42

    that it wrote. Um, and then I'll just

  410. 15:45

    breeze through a few real world case

  411. 15:47

    studies and where it's actually being

  412. 15:48

    used. So I mentioned predict rm before.

  413. 15:51

    So the company trampoline AI I think it

  414. 15:54

    is they're doing really interesting work

  415. 15:56

    in applying RLMs u like I mentioned

  416. 15:58

    before for different pieces of knowledge

  417. 16:01

    work. So natively interacting with PDFs

  418. 16:04

    and and spreadsheets and that sort of

  419. 16:06

    thing. So in this relatively simple

  420. 16:08

    example okay I have a bunch of I have a

  421. 16:11

    directory of invoices that I need to

  422. 16:13

    create one consolidated inventory out

  423. 16:15

    of.

  424. 16:17

    As we all know invoices can be

  425. 16:19

    complicated. that can be very long, that

  426. 16:21

    can kind of be all over the place. To do

  427. 16:24

    that today without RLMs or this sort of

  428. 16:27

    like framework gets very complicated

  429. 16:30

    very quickly. I have a lot of battle

  430. 16:32

    scars to to prove it. Um, but with

  431. 16:34

    something like an RLM, you you don't

  432. 16:35

    need to worry as much about, okay, if I

  433. 16:37

    have a 200page invoice or contract or

  434. 16:40

    whatever it is, you can let the RLM just

  435. 16:43

    churn through all of that and give you

  436. 16:44

    the result instead of having to worry

  437. 16:46

    about chunking and embedding maybe and

  438. 16:49

    doing all these different strategies to

  439. 16:51

    try and get around the context window

  440. 16:53

    management that we've all had to to do

  441. 16:55

    previously.

  442. 16:57

    Um, so it allows you, the point there is

  443. 16:59

    that you can focus on the abstractions

  444. 17:02

    and what you actually want to do instead

  445. 17:03

    of the context engineering itself, which

  446. 17:05

    I think is a really helpful um, helpful

  447. 17:08

    output of all of this. And an

  448. 17:10

    interesting tidbit for all the DSPI fans

  449. 17:12

    in the room, predict RLM uses DSPI to

  450. 17:16

    determine the schemas between the main

  451. 17:19

    LM and the subLM calls, which I

  452. 17:22

    personally think is is a nice feature

  453. 17:24

    because you have a lot more readability

  454. 17:26

    and maintainability. So you understand

  455. 17:29

    exactly what the model is trying to

  456. 17:31

    achieve and the model can be much more

  457. 17:32

    precise and prescriptive about the types

  458. 17:35

    of data that it's looking for from the

  459. 17:37

    subLM. And I would want to do some

  460. 17:40

    experiments to test this out, but I

  461. 17:42

    would think that this would improve

  462. 17:43

    performance for cheaper models like a a

  463. 17:46

    Quinn or some of the other ones because

  464. 17:48

    you're specifying the inputs and outputs

  465. 17:49

    and you're enforcing those types coming

  466. 17:51

    back. And so you get all the benefits of

  467. 17:54

    the RLM being able to churn through all

  468. 17:56

    this information, but you have a lot

  469. 17:58

    more of the structure in between where

  470. 18:01

    when it's handing off to a sublm, it it

  471. 18:03

    enforces some of the uh some of those

  472. 18:05

    schemas.

  473. 18:07

    This is an example from um an AWS

  474. 18:10

    engineer from a couple days ago. We were

  475. 18:13

    just kind of playing around with it, but

  476. 18:14

    I just thought it was a nice example of

  477. 18:17

    you can kind of just throw arbitrary

  478. 18:20

    data at RLM. In this case, it was a

  479. 18:23

    bunch of log data um to surface some

  480. 18:26

    interesting uh results and he he found

  481. 18:28

    it useful. Um there's a a project called

  482. 18:32

    Halo which uses an RLM to look at traces

  483. 18:36

    of um of different t uh agent tasks.

  484. 18:41

    And basically the promise of Halo is

  485. 18:43

    that instead of optimizing a particular

  486. 18:45

    like workflow or DSPI uh or or other

  487. 18:49

    framework

  488. 18:51

    uh like structure itself, it's it's

  489. 18:53

    actually iterating on the harness. So

  490. 18:56

    it's like a meta abstraction almost or

  491. 18:58

    meta optimization of the harness itself

  492. 19:01

    and it uses an RLM because as we all

  493. 19:03

    know tracing can get very long and and

  494. 19:05

    complicated.

  495. 19:07

    So the RLM can not only take in all that

  496. 19:09

    context but also leverage the um the

  497. 19:13

    structure of those traces to to

  498. 19:15

    recommend a better um a better harness.

  499. 19:18

    And then this last one uh this is all

  500. 19:21

    the code you need. I ran this little

  501. 19:23

    experiment. There's a an intentionally

  502. 19:25

    vulnerable application called uh it's

  503. 19:27

    from OASP, but basically there's a it's

  504. 19:30

    a web app with a bunch of

  505. 19:31

    vulnerabilities in it. This is all the

  506. 19:33

    code you need on the right hand side to

  507. 19:35

    run basically an agent to run through

  508. 19:38

    whatever it is 500,000 lines of code to

  509. 19:41

    generate some type of security report.

  510. 19:42

    That's just an arbitrary example, but

  511. 19:44

    the point is you don't need a lot of

  512. 19:47

    context engineering. You don't need a

  513. 19:48

    lot of structure around it to achieve

  514. 19:51

    what you want to do. And so you can feed

  515. 19:53

    in an arbitrary uh size codebase into

  516. 19:56

    this and get some type of insights out.

  517. 19:58

    So you can imagine that being applied to

  518. 20:00

    other areas as well. Um so I know I I

  519. 20:04

    rushed through everything a little bit

  520. 20:05

    but I'm happy to answer questions

  521. 20:06

    afterwards. Uh the I'll leave you leave

  522. 20:09

    you with this. The biggest promise I see

  523. 20:11

    here is just imagine a world where the

  524. 20:13

    models are actually post-trained and

  525. 20:16

    actually like RLM aware. I think things

  526. 20:18

    will get pretty crazy pretty quick when

  527. 20:21

    they actually know how to use and kind

  528. 20:24

    of take advantage of the RLM methodology

  529. 20:27

    natively. So, thank you so much for your

  530. 20:29

    time.