UTSKRIFT 🔗
Ravid Shwartz-Ziv: Hey everyone and welcome back to the Information Buttoneck podcast. And today we have Alex Zhang, a PhD student from MAT, and we are going to talk about recursive language models, RLMs. Hey Alex, thank you for joining us.
Alex Zhang: Hey. Yeah, thanks for thanks for having me on.
Ravid Shwartz-Ziv: So I think w we can start maybe from the beginning. Like what what does it actually mean, LMs and like or why you wanted to bring this idea?
Alex Zhang: Yeah. Yeah. So I can give a a little bit of context here for both why we were interested in the idea in the first place, and why it's even named that way. Because I think you know, some some people expected it to be a regular language model or a neural language model, but so so the the general idea behind the recursive language model is we were interested in this idea of in the future, if you sort of believe that the language models that we interact with will look something like the language models we have right now, but just that these language models like invoke each other in some way. so you have some system Where there's language models calling other language models under the hood, but this whole thing is kind of packaged up to the user as a language model. kind of the questions here are in this you know sub agent calling, maybe recursive sub agent calling system, what are the minimal design abstractions that you want that you think you should kind of carry forward? and iterate on because I I think generally as as we've seen in the field many many different let's say harnesses or coding agents are some small variations of each other with very specific and kind of opinionated API designs and and and and tool tool designs and things of this nature. But generally the the the base design or or principle that all these coding agents run on is basically the same. So for this new type of system, like a system that relies on language models calling other language models, et cetera, et cetera, we sort of came up with a few what we think are very, very important design principles here. And this kind of encompasses what an RLM is. So an RLM is this abstraction for how you want a this abstracted language model to do these like recursive language model calling things. so the first one is we we think that information and context which has traditionally just been fed directly to the language model in some way, or ingested maybe with some tools if in the case of a code base, Most of this information should be offloaded or not directly given to the language model. and this is somewhat maybe at odds with the design that we're used to with general like React style agents, which is something that that I have been recently calling like trajectory as a prompt, which basically just means like all of the information and and the in the entire like state that you are giving to your agent is provided as part of the prompt into the model. and this is there's a lot of reasons why you want to do this. you can
Load full transcript
inherently model this very easily kind of as an MDP of sorts. it's it's simple and it's easy to train in the in the sense that like you are training on everything that you see. So there's no like partial observability or or like kind of weird effects here when you're training your language model. but that's number one. and and and number two is is
Ravid Shwartz-Ziv: Right, so why why to do it? Like you you said it why not to do it, but why actually we want to do to use it.
Alex Zhang: yes. So the reason we we
Allen Roush: And and why now?
Alex Zhang: might yeah, the reason why we we might want to do this is language models have this very annoying problem, which is like I guess now everybody knows is the context problem of like you cannot just arbitrarily feed in as much information as you want into a model. there are both systems level limitations to this, and and actually probably the the the bigger issue is the the data issue of suppose and I guess t this is to answer the why now. Suppose we want to do some kind of like continual learning style problem or a very, very long horizon problem. we we very quickly run into the issue of as the context grows. And as we reach states that the model has never seen before, and and likely not only the model has never seen before, but the model is not able to generalize off of what it this this state actually is, we we risk the the output distribution of the model conditioned on this long, very, very long state. we risk this being something that we don't know or or or something that is not very well defined. which which is bad because what will end up happening and and we used to observe this a lot more, I think, even in coding agents, but we observe this effect where the model just produces an action that just doesn't really make any sense. Or it's not really what we would expect conditioned on the information that we've provided it. And so we're we're now reaching this very interesting regime in the space of language agents and and language models where we want to be solving very difficult and very long tasks. and I I think like code is a is a natural place where we've already seen this before. like we do not usually provide the entire codebase to a coding agent. Or at least the coding agent does not see the entire codebase at once. and we have ways of solving this specifically for coding, but Our hypothesis here is that this kind of style of of working on a problem extends to any problem. it's not exclusive to dealing with coding repositories.
Ravid Shwartz-Ziv: why you think it's it's a good framework?
Alex Zhang: context offloading to to begin with was very useful for or was was was doable by coding agents specifically because a lot of the tools that we use to probe around code bases ourselves. Like as a as a human programmer maybe back then before coding agents even existed, we typically wrote code in a way where it was easy for us to access important information and also like locate different pieces of information that we wanted to very quickly. So I think code bases in general are not they're designed to not be like multi-hop problems. like if I want to search for something in my codebase, I usually can search for it pretty easily. with some kind of grep tool or or even with my my terminal or with an IDE or something like this. I think for general context though, this actually isn't true. you know, there there are problems where yes it's easy to retrieve information from context. There are also problems where it's it's very difficult to retrieve the relevant information. you can imagine these problems tend to be of the form You don't actually know what you're looking for. and so you have to scan through or sift through the code base to or sorry, the context to see more and more information. but generally I think that like code we we we we cite code or coding agents as the motivation because i there are still a lot of problems out there and and generally even just with with general context, you might be able to transform this problem into the standard kind of code retrieval or code base understanding problem. Like you you you you can think of them as as almost the same thing. and so in this sense, like this is why we we we considered the idea of when you give a general prompt or like some general task to a language model, you can actually just think of this as a code base that you are trying to understand and answer. and and and that that I guess motivates the the first part. Yeah. but the second part is
Ravid Shwartz-Ziv: So
Alex Zhang: sorry. Yeah.
Ravid Shwartz-Ziv: No, no, continue like to the second part. what is the second design principle that you actually
Alex Zhang: Yeah. Yeah. The the the second principle is that tool calling and and the traditional way of tool calling is somewhat wasteful. and is is also the the reason we had done tool calling like this like JSON-based like API type tool call is specifically because this is what was easy to or easiest to ask the model to do, like back in twenty twenty three. and also this was the easiest thing to train. because you just treat it directly as a discrete action. but we sort of believed that this codact style of of solving problems, which is using code as the primary tool that a language model has, and and putting all other tools as functions or modules inside of this kind of code tool. We thought that this was maybe the more important or or more like future-proof design. and it also this is also very important for the whole context offloading thing, because when you offload context, the question is sort of how do you interact with this context? in in the case of coding agents, the way that this is done is you have greppers, you have the ability to write to your terminal or your file system and We figured that the best way to interact with context is to interact with it programmatically. and and the reason is you can manipulate it with code. and and this code should also have the
ability to invoke language models over it because this is kind of the natural action space. if code is the natural action space, then everything you do inside of it should also be in code. and and kind of the if the the kind of second and a half sort of Detail here is you need to have subagents or recursively calling subagents as another tool or or function inside of this whole environment. And this very minimally gives
Ravid Shwartz-Ziv: But well
Alex Zhang: you the RLM.
Ravid Shwartz-Ziv: this is but but the recursive part is not I don't know it's not it doesn't look like it's essential to this framework, right? you can have this yeah we want to interact through code, we want to do everything through code and this nice programmatic framework, but the recursive part like is not essential to it, right? Like you basically can do everything without it also.
Alex Zhang: So I would say Technically, yes, but in practice, actually the recursion is very important. So I'll explain why. So I the the reason why you need to have subcalls though, like sub agents, is there is this natural question of let's say we have this really long context, right? Like we we we have this context and it's offloaded. And I have my main I have my main like RLM agent that is now calling these code actions. it's it it it produces a a piece of code and it executes this piece of code. and now this agent probably acts kind of like a React agent almost in that like that's its trajectory. Like it's just repeatedly invoking code over this context. Now one of the things that you might have to do, and I I I mentioned I the code base analogy before because in most cases with the code base, the language model Does not need to read the whole code base, like with your coding agents, right? it probably will retrieve certain parts of it at once and then deal with that. and then like it then it's done. but for arbitrary context, we actually don't know how much needs to be read by the language model. So you can have a task where you the language model actually needs to read all, let's say it's like a hundred million tokens. It needs to read all a hundred million tokens. and and the question here is how do you do this? how how how do you do this with your with only a coding environment and the context offloaded? Because the the the proposal here is that like a language model needs to read it. You need to do some kind of semantic mapping over this context, but obviously your root language model cannot afford to do this. It has the context issues that it already had before. So the way that you you're forced to deal with this in some sense is your RLM or whatever your harness is, it needs to invoke subagents over this context in in somewhat of a meaningful way. And so you technically don't have to do this recursively, right? So the one way to do this is
Ravid Shwartz-Ziv: Yeah.
Alex Zhang: you ask your your language model to just do a map reduce like one layer down with with what the language mod
or this the sub agents are are doing over this context. but you can imagine actually that like not all problems either are this clean. So there might also be problems where actually like once you look at that context, you now want to independently solve whatever this context is asking, which can also be like an equally difficult or maybe also long horizon problem. and so in this sense the benefit of recursion is that you can very neatly decompose problems down. So the the the the assumption I made before was that like if you have a very long context problem, the best way to decompose it is just to go one level down and just ask your subagents to kind of act over like many, many, many different chunks of this context. but you might also run into a strategy or a task where you want to decompose it even further. You would prefer actually if the subagents that were called over some chunk were like dealing with it with their own subagents to to do some kind of subtask there. so I I I I guess the the way I would put this is like require
Ravid Shwartz-Ziv: Yeah, because l at at the end you you you need to ask the question, okay, so what is the difference between that and and multi-agent system, right? That okay I have multi-agent system, it maybe it's like each agent will work like on a different piece or like they share the information or like whatever, but like this is something that everyone are doing, right? Without recursion.
Alex Zhang: yeah. Yeah, yeah, yeah. so I think like at least for well for for for multi-agent systems, I think one of the the minor differences here are in a multi-agent system, j I mean they're they're all very different. So it's it's hard to generalize exactly like, you know, the the behavior of one. But usually the design is each of the agents is just solving something independently. and and and when it's finished, like when when this this this system or when this particular individual agent is is doing is finished doing something, you might get rid of it and spawn a new one to do to do something else. and usually like these multi-agent systems are somewhat unstructured in the sense that. it's not like a single orchestrator. so usually it will be some ex this is I guess this is popular now, like these swarms of agents that act over some shared memory or like some shared piece of information and update it and and like kind of slowly progress towards some like final answer. in in the case of RLM type like harnesses where you have some central orchestrator, I I I I think like in the first place, right? Anything that you can implement with recursion in in this setting, recursion over language model calls, you can also technically implement in code without recursion. But there is a benefit of recursion is just the natural way that when you're decomposing a task, each agent can focus on a very local problem. So the agent doesn't have to think globally over you know, I like Any any recursion program can be written iteratively, but
you might not actually want to think this way. you might actually only want each individual agent to be solving some local task that might also require launching sub-agents over this task. And so in this sense, I think it's it is actually useful to do this, especially because it changes the context of each of the individual language models that are solving this task or like that are attempting to solve a task, the way that they are invoked matters in in in this sense because it also train it it changes how you train the model and how you train the individual language models inside of the system to act a particular way.
Ravid Shwartz-Ziv: How you train these models?
Alex Zhang: Yeah, so we have sort of this or sorry, I should say this. The naive way to train these models is the same way that you train any agent system, which is you just do the rollout and you can do some kind of fancier forms of credit assignment over each of the sub agents, but generally like for example, the easiest thing you could do is just train the the orchestrator behavior. Or at at every step you you you don't train the subagents, you only train the main agent, or you train them all equally based on some final reward. But one of the things that we are sort of excited about with this whole kind of RLM style thing, or just generally sub-agent calling systems, is this idea of kind of can you get These systems to learn how to solve tasks compositionally. And what I mean by this is if you can train a model or a a harness such that you have a very difficult task that you know the model just cannot solve, or the harness is just incapable of solving. But you know that at the very least there is a certain part along this let's say recursion stack of one of the agents is like not able to do its job well. Maybe it actually usually is the orchestrator or like the top level agent. but you know that the way that it's invoking its its sub agents, and this is why like recursion is is beneficial in this case, you know that this agent is solving a task that's very similar to something that exists, or you just have a prior on how you want this agent to solve. like this particular agent within this RLM system, like you you kind of know how you want it to solve this particular task. and you can actually just do this by training because the context is offloaded and it's only dealing with a local problem, you can train out this behavior specifically. with the knowledge that maybe the the subagents that are being invoked are solving simple enough tasks that you don't actually need to train out this behavior. and so you can be a little bit clever here in terms of how what you pick out to train. If you have a very, very difficult task, you can either generate synthetic environments or you can choose tasks that are similar in decomposition structure but simpler. And you can train specifically on these tasks to improve performance on the larger task. And so this is like taking advantage of composition through let's say recursion.
Ravid Shwartz-Ziv: So how much I don't know, advantage you have from training, compared to s just taking regular models and use them in this framework?
Alex Zhang: do you mean like just just just to clarify, do you mean like compared to if you just didn't use the harness at all and you just trained like a language model to
Ravid Shwartz-Ziv: Yeah, just take like
Alex Zhang: solve?
Ravid Shwartz-Ziv: Yeah, just take regular I mean like take regular like models like any model that you want and just put it in the RLM framework that it will act in this framework compared to training specifically to to use it.
Allen Roush: And and and related is it's it are are are there other methods involving like for example forcing models to act recursively at inference time with like structured or constrained generation or sampling? Like have you ever looked at s strategies like that and compared them to training methods?
Alex Zhang: Yeah, yeah. So I'll I'll answer the first question, which is So so basically like the the the issue that that we are running into nowadays with if you want to use a harness to solve something or if you want to use a model to solve something and if you train either one of them, like what is what what do you get out of it? The the reason why we want to use harnesses in the first place, usually, is that training or even getting rollouts for a single model is very, very getting successful rollouts is very difficult for some of these tasks. So you can imagine, for example, let's take like the Navier Stokes problem. it I guess they they say that it most of the reason that they got this result in the first place was the model capability, which I do believe. but I also think it's it's reasonable to say that like if you just prompted one of the models, like whatever internal model they were using to solve this task by itself, it it would not yield the solution. th they they they admit that this is not how they came up with the solution. and generally it it it is some pseudo-harness swarm like thing that eventually got to a final solution. Whether you call that a harness or not is is is a separate thing. But w what I'm getting at here is that the reason why you can't just train a model to do something or like to solve a a particular task is There's many settings where you just actually don't even know what the trajectory is. You don't know what the rollout is. You don't even know what the answer is to the question. you're trying to get a model to do a very hard task, but you like actually this is a a a a good thought experiment. If you had a task where it was unsolved, you don't know how long the trajectory is, and you're trying to train a model to do it, how would you do it? And and and and I think like it's unreasonable to expect that you would just be able to train a model to one-shot this problem or even come up with a trajectory that mimics the correct trajectory here because you you don't actually
know what it is. And so the reason why we want to use harnesses or or an RLM style thing or or something else and try to train out this behavior either compositionally or I mean I guess just with the harness itself Is it gives you an avenue to potentially solve this task by only training on tasks where you know there is some training signal. So there's either you can generate positive rollouts for this task, or you just have the answer for these like local subtasks. And you kind of have to assume that like tasks themselves are inherently compositional in this sense, to believe that like you actually want to do this, but I think it's reasonable to expect that this is the case. so that's I guess for the first thing. For the second thing, I think yes, there are many inference time methods you could do to bootstrap the behavior of your model or even your harness to get stronger results. I guess this is like basically the entire field of inference time compute and test time compute and now even test time training. but I think one of the things that we sort of know in the field now is that a lot of these methods don't actually really work unless you have a verifier. like test time compute, for example, generally is i i if you look at some of the older papers on test time compute, back in like 2024, and and even like training out test time compute behavior. We've generally observed that if you have access to a verifier, most of the gain comes from best of n type sampling. and and and it's if you look at a lot of evolutionary algorithms papers, one of the things that you will find is that if you try a best of n or some kind of like pass at k type thing, this is usually going to be competitive with any test time compute method. again, assuming you have access to some kind of verifier. Because if you don't have access to a verifier, oftentimes what you'll find is that your model cannot choose the right answer. Or it just cannot choose between among the set of solutions that it generates. it's it's actually very, very difficult to get good answers just from raw like inference time stuff. and so I I I I do think in general, and the other thing I should mention is that. inference time compute methods and RLMs themselves, like any any harness type method, generally just does not work well without training. like it at the end of the day you you you need to train out a lot of this behavior. And and this is actually even true for I'll point again back to the Navier Stokes thing. it's sort of obvious, I think especially after the hugging face incident that they explicitly trained these models to act in swarms. this is not some kind of behavior that just emerged magically out of the model. and so i in in this sense, like it's very important actually that I think at least that that we focus on how we train any new
Allen Roush: Yeah.
Alex Zhang: ideas or harnesses or systems that that that we're interested in.
Allen Roush: So so you mentioned the idea that swarms are
an intentional choice and trained. I am curious because I think it was quite quite a question for a lot of people in the field on if AI agents could without training learn to communicate with each other in a way that you would see useful. and so I'm wondering, do you think that such a thing is still possible, or is it pretty much conclusively shown now that you have to train explicitly to create the swarm behavior?
Alex Zhang: so I think it's It's possible to get swarm-like behavior without training. you can you can just test this with some of these, for example, I I I wouldn't use a closed model because I'm not actually sure what they're trained on. But you can use like an open source let's say like one of the either either like reflections new model or or even one of the Chinese models. and you can observe that like swarms work or they work to the extent that you are burning a lot of tokens and you maybe can get the
Ravid Shwartz-Ziv: Yeah.
Alex Zhang: model to come out with some kind of solution. but not at least at the level of of what OpenAI is is producing. And I think the other the other important thing to note here is that like a lot of the behavior that you want to happen out of agent to agent communication probably is already there, from what it's been trained on. but I think if you actually want meaningful, efficient swarms, or swarms that solve like very difficult potentially new problems, it's not that clear what exactly you should be doing. And I I think the only evidence that we have of something that actually works is a thing a system that was trained. so I I I also think that generally like Nothing that these models do is is magical in that sense. like and I I think this is just generally true of of model capabilities. like yes, these models definitely generalize. I'm not saying that they're stochastic parrots in in in any sense, but I do also believe that like if you want a model to be good at some kind of capability, even if it's something that you think is just a general intelligence capability. agent to agent communication. I I fundamentally believe that you will find gains from just training on this particular style of task. there's there's no reason to expect that you would not see some kind of benefit for explicitly training out this behavior. And I think this is this is just generally true for for any kind of any kind of harness.
Ravid Shwartz-Ziv: But do you think we still have a strong verifiers all the time or do you think we can find ways to overcome this problem?
Alex Zhang: yeah. so I think that In domains where we do not have access to a verifier, we probably will have to come up with very creative ways to form like pseudo-verifiers. I don't really think there's a solution here where you just don't use a verifier at all and you rely on let's say some kind of like self-learning-esque loop. without any external verification. I I I I and I I don't have any evidence to point to why I believe this, but I I I guess the evidence is that traditionally this has never worked. and you know we we would hope that maybe maybe it it would, but I I I really doubt it. I think there there's a lot of reasons to believe that the the the actual effect of doing this kind of learning is that it there's some mode collapse here. and I I I think that I'm you know, my priors could change on on on this, but for now I think it's it's sort of clear that we need verifiers in some form. Like they they don't have to be perfect verifiers. They can be noisy. so for example, like for measuring performance. Like now we have models that can optimize code and can optimize even let's say like GPU code or accelerated code. And these verifiers are very noisy. And and actually usually A, they're they're noisy, B, they're they're prone to reward hacking. and C, sometimes they're even wrong. But still, I think like in this setting, we've found that we can improve performance on these tasks. And I think this will even be true for like I think alignment, for example, is a problem where you can come up with a pseudo-verifier. yes, you have to be very careful because they're often very hackable, but I think this is like just generally where you see some some type of signal that the model can learn off of.
Allen Roush: Do you do you then
Ravid Shwartz-Ziv: But okay, so the
Allen Roush: do you think that alignment and safety are solve solvable problems then ultimately? Like do you think that humans maintain control of AI systems twenty years from now? Or are you more pessimistic?
Alex Zhang: Hmm. I do think that alignment and safety esque problems are solvable. I I guess I mean I don't know. My my my my concern with with AI itself has always been more about how we end up using it and and less so how these like very automated systems end up kind of potentially pervasively entering like the world or the internet or something. I think there are there are probably like bigger to me at least like bigger immediate threats in in terms of how AI is actually used, both by these companies and and also just by people in general. but I I I do think the general alignment problem is is solvable. I I I fear though that the way that we have been going about the problem currently is a little bit backwards. in in the sense that like we because there's so much of a race for capabilities, like we have focused a lot on on getting the model first and then fixing it later. But I do think that like all a lot of these problems like kind of come in as you are building the model, which I'm I'm hoping, you know, I maybe that they are already working on these kinds of things, which which would be great. But yeah, my my my view at least is that we probably have other issues before before this becomes like kind of the the the big problem.
Ravid Shwartz-Ziv: D do you believe that this statement that like every like I don't know, every benchmark knowledge we can actually measure and like models have some percent of success, like you can
just train on it and models will be very good in like short amount of time? Or do you think that like yeah, we actually seen like I don't know the big jump in the capabilities in like the last like year or or so and now we are kind of we we over the top or at least for in second derivative of the or the acceleration.
Alex Zhang: Yeah, yeah. So I used to believe that there were certain problems that these models would struggle with. And the reason I I I used to believe this is that I used to think that many problems did not have enough relevant data, if that makes sense, for the model to ultimately come up with a conclusion To the more difficult task. I have since changed my prior, and and the reason is not, I still believe this is true. I still believe there probably are some problems out there, currently, at least, that all of the data because I I think the way that I think of models at least, or like language models, is like they are a cumulative sum of all human knowledge in some sense. Like that is that is like what they capture. and because of this fact. It's like if you took a human that just knew everything and you tasked them with solving a bunch of different problems, I think it turns out that a lot of problems that we as a society find very difficult, at least these like information based problems, the model is able to solve them. I like given in enough test time compute, or like given enough time, they're they're able to come up with solutions. And I think the reason why humans struggle is just generally we naturally have a suboptimal allocation of of like our intellect or research. Which is fine by the way. I think I think this is like it's not I'm not saying this is a this is not a criticism of of of how human society operates. I think this is this is normal. but I I think that like there are a lot of problems out there that we think are very difficult. And that they probably are difficult, but I'm not so sure that for a model that knows all human knowledge, it it is that difficult. And I think generally when we train a model to solve like a more targeted task, for example, like we are at least i the the way I view it is like we are encoding a very particular or like we're steering the model in a very particular way to prime it to solve these problems. Because I I I do think that the base models already, these GPT six type models, probably with enough tests and compute can solve most problems. Or maybe whatever OpenA has in internally, for example. but there are still a lot of problems out there where I guess th there's a few ways that this goes. One, there are many problems that we have not even tapped into or like we're not even aware of like exist. and when they exist, maybe either models are good at them or models are just unable to do them. and then there's also the I guess the class of problems right now or the class of tasks that are like embodied or are not necessarily like information style, math oriented esque problems. In
those cases, I'm actually not sure. robotics, for example, I'm not entirely sure what's what's going to happen. I I suspect that like we will also see like a you know a a big jump in capabilities pretty soon as well on a lot of these domains, but it might take some time for for a variety of reasons that that that are outside of the scope of like what a language model is is capable of doing.
Ravid Shwartz-Ziv: But w what what what even I don't know, slides, right? in principle or some I don't know some essay or whatever, right? in principle it should be a simple task, right? That I want to
Alex Zhang: Yeah.
Ravid Shwartz-Ziv: have slides on my research project or like whatever, something like that. and and and and like basically models should or like supposed to do something that like will be good enough, but Correct me if I'm wrong, but now I I don't think anyone can take just tell the model make me these slides and there will be perfect slides that you will be happy with them, right? It will be like a lot of AI slop. and they will sometimes they will look like really nice, like really beautiful, but like It's how to believe that the the content will be good to go as like without human intervention. first do you agree
Alex Zhang: Yeah, yeah.
Ravid Shwartz-Ziv: with that? And second like why you think this is the case? Is it because like the companies don't care about human writing, like writing in general?
Alex Zhang: Yeah. I think it's two things. I think one, that's one of the biggest ones. I th I think companies it it's clear that they focused so much on math, or at least OpenAI, and a actually Ananthropic. They focused so much on math in the past year or two. and and they clearly reap the benefits of it. and I I think that like, you know, if there was as much of a an effort or a push into some of these other creative domains. I do think we actually would be able not even creative, let's just say slides. Because I think slides, so I I guess I agree with you that they're not good at making slides and they're not good at writing essays. and they're not good at a lot of these like types, this class of tasks. But I I also think that there is somewhat of an inherent difficulty for these more For these creative style tasks as well as tasks where they heavily depend on human preference for like like your preference for slides might be very different than my preference for slides. and I I I I I think this is also true of writing, although to an extent like we both can agree that there probably is some notion of like maybe you like reading classics and I don't like reading classics, but we both agree that they're they're pretty well written, at least compared to like what a fourth grader would write. but I I I think that this is something where it's it's kind of difficult to to imagine like how the base language model would be able to do this this type of task well. Specifically because there's many different things it could generate, some of which you
might like and some of which I might like. but the model is not sampled in this way. At least like for now. This this might change. And maybe like maybe the solution that these companies come up with in the future is like these models are in some way steered or personalized for you. like whatever GPT-6 or GPT-7 that you are sampling is mostly the same backbone as the one that I'm sampling, but it's steered in some way that it's favorable for some of these tasks that like that you like. So it makes slides the way that you like them, it makes slides the way that I like them. But I think this again becomes a data problem, just a a bit more of an annoying data problem. and I think I still think it's solvable. Like I I think it's not something I don't I'm not sure about essay writing. I don't know that I guess that much about how well like good essays are written. but at the very least for for slides, yeah, I think this is this is totally doable. And and even the deslopification of writing, I think the reason that this even exists in the first place is not necessarily because AI-written things are bad. I I I do think there are some kind of quirks of it that that are not great. But at the very least, like If all AI written things were personalized to each person, for example, I don't actually think people would complain as much about AI slop. It's it's specifically because all AI writing has kind of converged to this very particular style that we see everywhere. And that's the thing that like makes us notice that it's slop in the first place. so this is solvable. I I do think this is something that that that like Once the companies see some kind of value in in pursuing this, they probably will figure it out. but yeah.
Allen Roush: So I I actually want to push back a little bit on some of your analysis. I think that
Alex Zhang: Yep, yeah.
Allen Roush: that the the the thing that that decides on if a a task will be you know done well by the AI or not is more the generalness of the task. So for example, every person going through school has to write essays. and so we we in general have a quite good understanding of, you know, even what 10 or 20 essays look like. But that is not the case with 10 or 20 solutions to a particular subproblem in a coding task. But I also want to observe that in all types of coding, it's craft work, not full engineering. There is a r massive amount of artisanal subjectivity involved with every decision in in the creation of software. And so I I actually would explain the the poor writing as being entirely due to overusage of reinforcement learning with human feedback or and and on too small of a group of annotators who have let their own linguistic verbal ticks get so o you know, post trained into the model that begging in the system prompt and doing everything you can to kind of get its behavior is impossible. there's at least some people that claim that base models when prompted really well actually write really effectively and don't have the slot
Alex Zhang: Mm-hmm.
Allen Roush: problems of of of of standard instruction fine tune models. Do you think then that there might that we could avoid or remove slot by actually doing less RLHF or something like that and like more pr pre training?
Alex Zhang: So, okay, I I sort of agree, I think, with with with what you're saying. I so I guess with the base model thing, I actually don't know if this is true. I I've I've never seen like I I mean when when I've I play around with a lot of models just for research purposes. Generally like I've never observed any of these models giving me meaningful writing or like writing that I would consider to be good. But then again I it's probably a very scattered and and and and not rigorous experimentation on on on this problem. so I I could believe that this is true. I do agree with you as well that like RL and RLHF are they have caused the type of writing that we currently observe with like like that is AI slopified. I think though that I I I wouldn't I'm not sure that the answer though is that it is the fault of a small set of annotators slash what they prefer. In the sense that at least for open models, yes, this is definitely the case. This is definitely what causes open models to be bad. and and and the idea that like we actually don't have a lot of this A we don't have a lot of this type of data, this type of like alignment data for general writing or just the behavior of the model. And B, I think a lot of open weight models are not incentivized to optimize for this anyways, because their goal has always been to compete on all of the different benchmarks that most people care about and use them for coding use cases, which I think now is like the most popular use of even like locally running models people typically use for maybe maybe like very small chatbot things and then just coding uses. but I I think that for if the if the problem was as simple as getting a better set of annotation data, I feel like the companies would have just solved this by now. Like this this this is the type of problem that is not or this is the the type of thing that's not an issue for an open AI or an anthrop or even like a Google.
Allen Roush: Well well well I get conspiratorial here. I actually think slop is good for these companies because it does a few things. One, it acts as another type of watermark. But two, the the that the creative tasks are by far the most controversial for them to solve. And so the idea is, well, we're not totally destroying teachers and education because you can still,
Alex Zhang: Ha.
Allen Roush: you know, tell through usage of phrases like load bearing and stuff that that somebody used clots. I actually am very conspiratorial that they have zero reason to solve slop.
Alex Zhang: interesting. well, so okay, I mean it if you put it that way, that's that is also entirely possible. I don't know if that's true. I I I I I I have no idea. and in that case, like under that
assumption, yes, maybe actually this is something that's that's somewhat easily solvable. But I I still I still think that like even if
Ravid Shwartz-Ziv: Mm-hmm.
Alex Zhang: the language models produced quote unquote good writing, like they they were trained Better. you had better annotators or better data. I still believe that we would perceive AI writing as slop. It would just change the style that we see it as. When I see somebody else send me something, or I see something online where someone writes something, I can immediately tell that it that it's AI. and I think this is also true with like coding as well. I mean I to to go back to your point about some of it being artisanal, like I think when you let a model just slop code an entire repo. I think you can very easily tell that it's written by a model, especially not only the choice of comments and variables and all these things, but even the structure of the code is oftentimes like just I I I I wouldn't necessarily say it's bad, but I think it's like very obviously AI generated, and there's a part of that that like is just not at least for me, like you just naturally don't respond to it very well when you see it. and I I'm not actually sure how for these companies, maybe they're just not even incentivized to do it. But I think even if ev even if they were, I think it's still very difficult to to solve these purely just from like data on a a a single fixed model. but yeah.
Allen Roush: Then and and then why is it that slop keeps changing in your opinion then? So for example, some of the earliest slop tells were the dash and overuse of semicolons, but with more recent versions of Clot, it's it's like o overuse of the word rather, and then load bearing is I I think that was specifically due to the system prompt, was load bearing in particular, but stuff like that. So I guess what I'm curious is like what what do you think about the shift in slop? Also, one other thing I've noticed is that a lot of the Chinese open source models seem to have similar slot profiles to closed models. Is that simply just because the internet's overran by ChatGPT and clawed outputs and that they're you're everybody's distilling on that anyway, even if they're not trying to or
Alex Zhang: Yeah. so the the first the the first thing is is is kind of I guess related to what I was talking about before of I think the reason slot changes is I mean A the companies change their any part of their their their their their trading stack. I w I I'm I would expect them to try to solve the slot problem with better data, like better RLHF data, like whatever. maybe they don't, maybe they purposefully like tank these things. but in general these these models change over time and and this also includes the data that is provided to these models. I I I I at least do know that based on at least based on open training recipes, they're the with each generation of new model, they're not like a superset of like the previous training recipes. they they generally involve different mixes. Like it's not I guess when when you train big models it's it's not a matter of just like in force feeding as much data as possible. There is some science to the quality of the data that you actually feed in. and so I'm assuming like with at least we we know that some of these newer frontier models are new models. and they're like they're new pre-trained models as well. And so presumably like a lot of how they're trained at every level of the stack has changed. it's no longer just training changing post-training details or or like data. and so that's one. and then I I guess the second thing with with why a lot of models have converged to similar styles of slop over time. the simple answer is yes, one, probably a lot of data on the internet is or like a lot of language data is is now AI generated. but that would sort of imply that a lot of the open weight models would look more like previous generations of slop rather than like the most recent generations. I do think that well, there was the whole Anthropic Kimmy report about like rerouting to distill data. I I I I think like it's not unreasonable to expect that a lot of these open weight models distill from frontier models. And so that's also probably another explanation for why this is happening. and maybe also there is this thing of the sort the data sources that they're getting this from. ha have also somehow like gone to multiple different labs. This is also another possibility. but the distillation one is probably the most the most like reasonable answer to this.
Ravid Shwartz-Ziv: Okay, let's talk a bit about about shape, language models shapes. do you want to tell us about it?
Alex Zhang: Yes. So I I I wrote this blog recently about this was after Jev came out. so for context, Jev is this new type of language model where they basically take a language model backbone. and what I mean by that is that they just take a language model and they change like what the prediction head is over. So instead of doing auto regressive generation they now predict structured outputs, like fixed structured outputs for they call it like new values, but they're they're basically just values between zero and one. so it's like it's kind of like a a single logit over over some problem. or a single sorry I probability value. now the reason why Jev is really interesting is It is a classifier of sorts, but it is a classifier that uses a language model backbone. And what this means is you can solve a lot of interesting tasks by querying it like a language model, but by getting kind of the performance benefits of it being sort of cheap and also it being pre-fill only. so you can use Jeb to solve these kind of conditional tasks extremely quickly. and I I think They also th it's not as trivial as taking a model and adding a head. they do an extra kind of layer of training on top, which they don't share. But I think what's really interesting about this to me is Jev is
a new type of language model shape. and and what I mean by this is it's not a language model architecture change in in the traditional way of do we use sliding window attention? do we use GQA? Do we like it's not like this type of thing. It's more like if I took the language model backbone and I changed it, or I changed what the language model is doing, can I get different trade-offs here for the efficiency slash performance or slash like system level performance of the model versus like what it's capable of doing? I a and the reason why I think this is so cool or like so interesting to me is If you really think about it, most language models are extremely overkill for the tasks that you that you like deploy them on. and and this is this has been fine for a while because we've been very interested in improving the capabilities of these models. because at least a few years ago, like these models were just not very good at anything, for the most part. Like they couldn't even do my my like probability homework. But now, they can solve all sorts of of very, very difficult and and interesting tasks. And we often still use them to solve like very menial things. And what I'm sort of proposing in this blog is that there is a whole design space here of new model shapes where you can you can start with an existing language model or you can distill behavior from a very powerful model. down to new shapes where you can get very, very interesting efficiency trade-offs. So the example I give in the blog is like for agents. So you might consider building an agent that deals with its context somewhat unequally, or where it doesn't have context problems anymore. So instead of doing like manual compaction steps, the the history of the model is an SSM or an RNN of sorts. and it auto-compacts basically in in in this way, where the model can still like act on its history by using like retrieval tools or something, but this actual like React style agent no longer has context issues. there's also there's many variants of this. There's there's like ideas where you can avoid breaking the KB cache with like certain designs, et cetera, et cetera. And so this is generally a direction that I've been very interested in. There's I guess I'm working on this in the context of RLMs, but
Ravid Shwartz-Ziv: but but
Alex Zhang: yeah.
Ravid Shwartz-Ziv: But Do you do you think d do you mean in the context of yeah, we want to change the architecture, right? it's not that like this claim that yeah, we we have like kind of like we need to take like small models and to apply them to specific set of specific data set or specific type of problems is here for for a long time, right? Like a lot of companies this is what they are trying to do. Here you you basically say, Okay, we actually need to change a bit the the architect. like choose some like different components from from these large models and the only these parts or like these components will apply to our problem because our problem
is like narrow right
Alex Zhang: Exactly, yes. So if for let's say actually you're a company that's interested in training small models, for the for the sake of efficiency or like to solve a very targeted task, I think you are inherently limited by the fact that like we have worked under the assumption in the field for a long time that every language model is this decoder only auto-regressive model. this is basically the form that that we take. Or if we don't do this, we try to do something completely different, like a diffusion language model, which is just like it's the training dynamics of this thing is completely different. I think Jev is I really, really like this release because I think they're they're very clever in that they're still taking the general language model form. Like th this model was probably trained, or at least the backbone of it was trained in the auto-regressive language model way. But they use it and they they post-train it to do something else, which I I think if you especially if you're interested in small models, this is exactly the kind of thing that you want to do. Because you you actually can get a lot more gains out of this over just doing like small model versus big model. and and you can even actually be more creative about this. You can take a big model and you can make it be a small model like 80% of the time. and and and the way that you serve this thing might also be special in this sense. and and and what I mean by this is you can imagine taking a big model where you only use if you design it well, you can you can make it so that you only use 20% of the parameters, in not like MOE style, but like specifically some module that is that is doing something specific, and you can use the rest of the 80% if you need to for like a very difficult task. but it's served in a way where you you focus on the twenty percent. but th these are just examples. I think I can't say too much about exactly what we're doing for for RLMs yet, but we'll we'll we'll release something about this pretty soon.
Allen Roush: So
Alex Zhang: But but yeah.
Allen Roush: So so J Jev, Jev was I I I'm I agree with a lot of this analysis about how awesome it is to have decision models and I've seen them, playing video games on very small parameter count models. But my understanding with Jev and its descendants is that they are effectively language models that have had their decode blocks, the the final generate the next token part removed, and with that additional post training you mentioned. But the problem I've had is that in and revealed on Rave knows that I am obsessed with structured and constrained generation, use it everywhere I can and and but I claim that I do the same thing and absolutely used standard LLMs in a JE-like way with aggressive amounts of structure constrained generation. And most of the critique, you know, the whole thing about JE, it's faster, right? Well, the vast majority of what I'm doing in the context of structure generation is pre-fill, right? Which is very fast anyway. And often I'm decoding a very small number of tokens relative to that pre-fill. So I'm not saying there's no speed gains, but I guess and certainly there's massive memory, you know, storage, all of these kind of gains. But like I was not as excited because I'm just sitting here being like, why did it take so long for people to realize models could make decisions and be classifiers? Because that seemed profoundly obvious to me or anybody else that used any of the structured generation tools.
Alex Zhang: Yeah, so I I I guess specifically for Jev, because I I I I think this language model shape argument g extends much further beyond Jev. and like I myself am not that interested in decision models. So like when I saw it it was like I didn't actually care that much for using it, but it was more like, this is actually a very clever like route to take. But on on on Jev specifically, I do think that one of like where I would push back a little bit here and and and you've tried it more so feel feel free to to to tell me if I'm wrong but I think with constrained decoding stuff and and and and relying on like you know the auto regressive language model with constrained decoding and and and etc the the issue is that like you like what the model is producing here in in in this setting is maybe not exactly what you want. Or the the the the output probabilities that you're getting from constrained decoding is is not really good always. At least this has been my experience with with using it before. I don't know for for decision models whether this is true. But my my understanding at least with Jev was that like they are proposing and I think this is true for any new language model shape that you're interested in. After you have the pre-trained base, you now need to propose some kind of new learning objective over this new shape that you're doing. In their case, it's this RLCD thing, which they don't release, so I I have no details about what it actually is. But I think for like in in other settings, this is something that you will have to do. And I think this is this is what is interesting to me. and I guess for decision models, my assumption was that RLCD made it so that the decisions it produces are more reliable than what you would get from constrained decoding. But maybe that's wrong. I I'm not I'm not sure.
Ravid Shwartz-Ziv: But at the end we have these w we are going back to yeah, you have data, so now let's train a classifier on it and try to solve like your specific task, right? This is something that like it's not new in this sense.
Alex Zhang: I I guess it's it's it's not new, but it's unique in that I wouldn't say it's the same thing as like I have some da I have a lot of data and I want to do decision tasks, so I'm gonna train a classifier on these decision tasks. Because I think the unique thing here is that it has the the the language model backbone piece I think is very important because
We are trying to form fit the capabilities of a language model to a task that like a data-driven task because we want the priors in the language model for this task. And I I I think because of that, like you need to consider like what the what you are considering here is basically what is the trade-off between using the language model backbone versus using a standard like like decoder only language model. And also what are the trade-offs of doing this thing versus using a standard classifier, just training a a large classifier model. And I I think like there's the like this ends up becoming a spectrum of sorts of like you have the raw classifier, you just have a decoder-only transformer, and you have something kind of in the middle. and I think you will find this in like I think at least you will find this in in other settings. Where like I'll give you another example. You can take a a standard agent, like in the RL sense, like a lot of like the Atari agents, like things like this. You can take a VLM with a harness, and then there's something in the middle of like some kind of agent that is like more designed for like these these these Atari style agents are specifically just designed for solving these tasks. They're very small models. but they don't generalize very well. and then you have the VLM style things which do generalize very well and they can actually do things beyond just games. but there's a lot of inefficiencies in the d in the design of this thing. And so you might want something in the middle. And and I think how you design that is is interesting. Like there's there's a lot of research questions here for what you what you might want to do. Jev is probably the simplest example of this, but I think it does it from my point of view, they were one of the first people to successfully show that this is a direction worth pursuing.
Ravid Shwartz-Ziv: Okay. I think we're out of time. do you have anything else that you want to add?
Alex Zhang: yeah, I guess I guess maybe the the the last thing I will say is that I think right now there's a lot of discourse about the role of academia and and the role of industry. So I'll I'll maybe give like a one or two minute spiel. basically my my view on this i as a PhD student, obviously, which I think is is is There there are fewer and fewer of us these days, at least in in our field. I think like industry is great. I I'm not I'm not gonna be one of those people that says like, you know, industry has problems, like come to academia, like no industry is great. I I have a lot of friends that work in industry, they're having a great time, they get to work on these big models and and they have a lot of details that I don't have access to. I think with
Ravid Shwartz-Ziv: And earn much more money.
Alex Zhang: much more money, yeah, exactly. That too, right? and I I think being in academia like is it's it's tough. Like there's I I think academia has had a lot of problems recently, especially with like the problems that academia has focused on. They've been kind of constrained, often they're not that useful or they're not used in industry. but I I I the the one thing I will push back on is I I think that Being in the PhD specifically, I can't speak for being a professor. maybe, maybe you would be able to, but I think being in the PhD is actually a really fun and unique time to work on literally whatever you want, which I think is something that people take for granted almost in that like I mean, I guess up to the constraint of maybe like problems that that you can reasonably afford. but I think an industry the the trends of industry have been somewhat fixed for a while now. whether or not you you choose to believe this is true, yes, you can work on e if you go to a Neo lab, you can work on some more interesting bets. But in general the goal has always been produce this language model that is good at XYZ tasks. and I think in like as a student you can kind of work on whatever, even if that bet might seem really stupid to a lot of people. and I think there's there's something very fun about that. And and also a lot of the skills that you can learn to if you want to go into industry, you can pivot almost whenever you want. Like I think a lot of companies still like PhD students for for whatever reason. I actually don't know why. but they do. And so I think like it's it's a route that like is not it's not useless is I guess maybe what what I want to say. I think there's there's a lot of value in doing it. A lot of the value is something that you need to believe you want, but and it's definitely not for everyone, but I think that in general like if you're unsure about it, like there's there there are a lot of benefits to to being a Ph student, in this day and age, especially with agents and all these things to accelerate your research.
Ravid Shwartz-Ziv: yeah, great final words. Alex, thank you so much for joining us. It was a great a real pleasure to have you.
Alex Zhang: Thank you so much. Yeah, it was great to be on.
Allen Roush: Yeah, you were you were amazing.