transcribe

Why Opus Medium Beats X-High at Writing Maintainable Code

Boundary · 38m · transcribed 22d ago
More from Boundary Business
𝕏 Share ▶ YouTube 📥 PDF 🤖 .md

Section Insights

# 0:00

Understanding the Slop Code Bench

What is the significance of the Slop Code Bench in evaluating models?

The Slop Code Bench evaluates how well models inherit and adapt to a codebase over time, emphasizing the importance of understanding requirements and maintaining code quality. It highlights that simply feeding a model features without understanding the end state can lead to poor outcomes.

  • Models need to learn from user interactions to improve accuracy.
  • Over time, accumulating 'slop' in code can degrade performance.
  • The Slop Code Bench measures how models adapt to changing requirements.
# 7:38

The Alignment Problem in AI

How do we ensure AI models align with user needs?

The alignment problem involves ensuring that AI models not only follow instructions but also adapt to correct misunderstandings in requirements. This requires models to sometimes disobey initial commands to improve the overall codebase.

  • AI models must be capable of adapting to evolving requirements.
  • Disobedience in AI can lead to better outcomes when initial instructions are flawed.
  • Understanding user needs is crucial for effective AI alignment.
# 15:17

Code Quality vs. Functionality

What are the implications of code quality in AI-generated code?

While AI-generated code may function correctly, its quality can be poor, leading to increased complexity over time. This complexity can hinder maintainability and usability, emphasizing the need for better metrics in evaluating code quality.

  • Functionality does not equate to quality in AI-generated code.
  • Increased complexity can lead to maintenance challenges.
  • Current benchmarks may not adequately measure code quality.
# 22:56

Evaluating Model Performance

How do different models perform in terms of code generation?

Models like Opus 5.5 have shown superior performance in generating code with fewer issues, but there are concerns about the relevance of the benchmarks used. Continuous updates and qualitative observations are needed to assess evolving patterns in model performance.

  • Opus 5.5 performed best on slop metrics, indicating fewer issues.
  • Benchmarking tools need regular updates to remain relevant.
  • Qualitative insights can enhance understanding of model performance.
# 30:35

Linting and Code Standards

What is the role of linting in maintaining code quality?

Linting helps enforce coding standards and improves code quality by identifying potential issues. The evolution of linting tools, especially with the integration of AI, allows for more sophisticated approaches to maintaining code standards.

  • Linting is essential for enforcing coding standards.
  • AI can enhance traditional linting methods for better results.
  • Maintaining code quality is crucial in software development.

Transcript

0:00 If a model doesn't know this end state, because we humans don't know the end state. We don't know what to ask for yet because we haven't put our thing in user hands and learned about the problem. You're going to solve it in one way and then you're going to have some croft and then you're going to have more cr and then you're going to have more cr. The idea here is if you just do the lights off factory thing and just feed a model features and highle design, you will over time accumulate so much slop that by the time you're here, your odds of actually getting a correct answer here without breaking any of the requirements from here or here go way down. That's what slop code bench is a paper that tries to prove. All right, y'all. on this week's episode of AI that works, a little bit of a short one, but we went through the latest slop code bench results. Slop codebench of course is a benchmark that makes a model inherit a codebase as it goes through and learns more about the requirements and is really maps better to like how we build actual software. I go through the results where Astrax High actually tops the pack even though I think Opus 5.5 for me is my favorite model these days. So we have a bunch of results from recent runs. we talk through not only the performance but how effort affects cost and performance for different model families. the overall spread here. We talk about the like failure cases. some interesting stuff on like the actual code quality metrics and the number of functions written like fable wins on this one weird dimension of like mean cyclomatic complexity.

1:20 and and just talk more about like what it means to maintain a codebase over time. And then right after that, we go deeper, a little bit deeper into exactly what it looks like to write a maintainable codebase over time and how to think about skills, how to think about llinters in a way that helps you go and optimize not really for agent time because agent time and how long it takes to produce a task matters way less. How many tokens it cost to produce the task matters way less than the maintainability of the software over time because that is a compounding impact. So we looked at various metrics.

1:47 We looked at various ways of how we go do this. And then we dig into various actual the actual guidelines that actually reduced the cost along the way and how we got the cyclatic complexity, how we got the depth of the functions to be way cheaper over time in terms of making the system more maintainable. Let's get into it. >> I'm super excited today. This is going to be a quick episode. I'm Dex. I'm the CEO and co-founder of Human Layer. this is the AI that works show. Vibbov, intro yourself and then I'll intro the show and then we'll get into it. I'm Vibbof. I'm one of the co-founders over at Boundary and we make a programming language built for the AI era.

2:21 >> This is the AI that works show where we talk about AI that works. I know AI is getting a lot better these days, but we are always you know the the the title made a lot more sense 18 months ago when AI was really bad at most things. We're talking pre-cloud code here, folks, or like around the advent pre-cloud code being good, but the the theme is always going to be what are the like systems design techniques, pipeline design techniques, context engineering techniques, and just LM intuition that you can use to get the most out of today's models. So that even if the model is really really good and can solve most tasks, how do you get it to do that thing that it still can't do reliably? How do you find the thing that's like right on the boundary of the capability and you get it right all the freaking time? Does that sound accurate?

3:02 Is that a good >> I think that is the perfect way to describe what we chat yap about. >> Amazing. I do really like this meme of the chalkboard. So I'm going to try it for a sec. But today we are talking about something I love called slop code bench. >> Is that in frame? Can we see that? Amazing. >> yeah. Yeah. Slop code bench is good enough. >> Amazing. And the I promise we'll get into normal whiteboards and we'll go look at some cool charts in a sec. But the coolest thing with slop code bench is basically most benchmarks give a model a problem. The model goes in codes, you get a solution, you get a check or you get a fail, right? One problem that you know the entire problem up front. This could be like you know two lines of Ruby or it could be implement all of Yes.

3:58 >> Yeah. and it turns into a very very small benchmark and the problem is the models they kind of end up overengineering for this and you end up in this world where it doesn't model real software development. I don't care if you can solve one problem today. >> I care I don't care if you can fix one little bug or if you can like clone all of Reddus and like get to feature par. I care are you going to in the world of the way slap code bench modeled the way we actually build software is you you build something and then your requirements change and then you build something else and then your requirements change and you build something else your requirements change and the thesis behind slap codebench is like if a model doesn't know this end state because we humans don't know the end state we don't know what to ask for yet because we haven't put our thing in user hands and learned about the problem then like you're going to solve it in one way and then you're going to have some croft and then you're going to have more cr and then you're going to have more cr and that the models are not good at centralizing at redefining abstractions at creating like doing refactoring. Obviously, if you ask a model to do a refactor, then then it will go do it and it will do a good job.

5:00 But the the idea here is if you just let a model if you just do the lights off factory thing and just feed a model features and highle design, >> it doesn't work. accumulate so much slop that by the time you're here the it's your your your odds of actually getting a correct answer here without breaking any of the requirements from here or here go way down. That's what slop code bench is a paper that tries to prove.

5:23 >> I think that's the best way to describe it. And what's really fascinating is if you think about like what is a lights off factory, it's basically to some degree trying to get to a point where you're effectively operating like a VP of engineering at a giant corporation where you have like 2,000 or like 10,000 devs underneath you and somehow the system works. Like the guy in charge of like the iPhone fold did not design every single thing himself. Probably wasn't even involved in like 80 or 90% of the decisions that got made.

5:54 But yet the phone works at the end. And that requires a lot of like re-engineering, a lot of redesign, a lot of rethinking that you rely on engineers to do independently. And models don't stop do that at all. They just do the thing. >> People see that a model can implement Reddus from scratch or can implement Microsoft Excel from scratch. There's benchmarks that show that models can do this more or less like to to 80 or 90% par. and so they say, "Oh, software is solved. Models can code."

6:22 But like the thing that I'm that's this that we're trying to prove is like human engineers have a set of intuitions that have been built up over years and years of mostly getting burned by bad design and having to like wade through messy code and like oh this should have been a 10-minute change but it took me 3 hours because I had to like work around a bunch of like spaghetti and that like humans have built that intuition and like in my my like framing of this is that models do not yet have the intuition. They we haven't figured out because we teach models things through mostly through a little bit through pre-training that's like based like knowledge and behavior but then through RL we make them really good at coding and we haven't figured out how to RL models on like software maintainability.

7:04 >> You know what's interesting about this is like software maintainability is almost a sign of disobedience. Like if you think about what maintenance is, is like to some degree you're gonna disobey the command that like the person telling you what to do said to do in favor of doing something else that's orthogonally different and in the service of doing what you really need to do. And it's >> well it's like it's sacrificing the short term for the medium-term and long term. It's like >> in theory, let's be real, not all refactoring is good. Some of it is like a you know the mental masturbation exercise of just like can I design the most beautiful thing. Obviously everything we do as engineers has to lead to outcomes. I mean there are people who just like writing code for the sake of producing a beautiful algorithm or proving something but at the end of the day most of us are building stuff because we want to create value and we want to create we want to solve problem whether it's free open source or whether we're building an enterprise software platform. We want to solve people's problems make their lives better. make them make it so they can do a thing that used to take 30 minutes and now they can do it in 5 minutes for example.

8:05 >> Yeah. But I think we have to think really carefully about how we get models to be disobedient because fundamentally like it's the alignment problem. It's like if you want alignment you want the model to do what you tell told it to do. But what if effectively what we're saying is the requirements are incorrect. The for for that for that third point to go to the fourth action like third checkpoint to go to the fourth check action where you have the X behind you. Dexer, what we're really trying to say is >> no, we are wrong. These requirements are not correct. There's actually an intermediate requirement that no one has mentioned.

8:37 >> The model has to disobey and do this other thing and make the codebase better so that we can pass this one. >> Exactly. And like >> I love it. >> That's going to be tricky. Like aligning for that is literally aligning the model to not do what you told us to do. That means like making your agent like for example all these like chat bots are going or like >> personal assistant bots are going around where you tell it to do something it does a bunch of stuff for you.

9:00 >> Yeah. >> That means like now you're like going to tell it to like hey I want an apartment that's like for I can you find me apartments for rent that cost like 5,000 a month. SF prices. But like anyway I want an apartment that cost $5,000 a month >> but it's you actually huh? >> Are you getting an apartment in SF? Is that was that a leak on live on stream? >> That's separate. But >> I own an apartment that cost 5,000 a month and then on top of that you're like the model's like no what you really want is a washerd dryer so I'm going to increase that to 6,000 a month.

9:34 >> Right? That's really what the model's going to kind of do. It's like no you're wrong. >> And like >> I mean when it's like it's I'm making the final decision anyway. It's okay. But in a dark factory you're not making the final decision. They're just saying like whatever you want, however you can get to this goal, if I, you know, show up on day one and I'm happy with the apartment, I don't care how you got it.

9:52 >> Yeah. And that's kind of interesting. I think it's terrifying because I actually don't know how alignment and other problems are going to get solved in this way. yeah. And like the chat is right. The model lighting shims is basically it's like the model is going to decide to add abstraction layers for the sake of adding abstraction layers. And now we're back to Java. >> Yep. Yep. So I think I think this is all this is all right. I think you're right about like basically I mean Uncle Bob wrote this book called the clean coder and it was he had clean code which was like what does good software look like and what does maintainable code look like and then he had the clean coder which is like what does it mean to be a professional software engineer and like make accurate commitments and like push back on executives like there will always be in every good org there is like a healthy tension between maybe healthy maybe toxic tension between engineering and product because product wants more features And engineering's job is to make it so that like they don't wake up in six months and like suddenly we can't ship anything because we stopped caring about code quality. We didn't do any of these diversions. And so it's like yes, we have to figure out how to train the models to like push back and to do things that were not asked for because they have this deeper understanding of like okay cool. This project needs to be around in 3 months or 6 months or 2 years. And in order to keep our velocity high, our ability to ship and like not slow down over time because the code is getting more complicated and it's it's harder and harder over time to break something like to fix something over here without breaking two things over here. Like that is what slows us down and that is what like degrades both like the quality of the product and also the speed at which we can make progress.

11:30 >> I have something fun to show you. let me find the artifact that we made. I actually was going if you do you have something you want to show first actually >> I have so I just published this morning I just ran the latest slop code bench on a bunch of mods and then I have some very interesting things to show right along this vector that we're chatting about which is long-term maintainability of software. >> So I'm going to pop over here we have the slop code bench results. I think I just posted it on the live stream as well. so interesting headline here.

12:05 I love Opus 5.5. I think everyone's found it to be like the best model to work with for most tasks. but that actually Astra performed better on this most recent run of the benchmark. So this is kind of like the headline chart. what I care about is the strict pass rate. This is basically like how many how many like challenges did you complete? you know how many checkpoints did you complete where like at the end of checkpoint three all the checkpoint three tests are passing that's the gray line that's like did you solve it for the checkpoint and then the the solid line is basically did you solve it for the checkpoint and not break any of the previous things. So like the strict pass is basically the current checkpoints test and every previous test has to pass in order to get a strict pass. And so a lot of the times we find like, okay, cool. Yes, we shipped the last thing, but they were failing tests in the first one.

13:03 >> Does that make sense? >> Yep. I think I think that makes sense. It's like, yes, we don't care really about shipping the last. We want to you want to run like full CI/CD effectively. >> Yeah. You want everything to pass. and some of these actually like I will I will say like if you ship this one and there are failing tests, you are now unable to get a strict pass at any like further checkpoint. So like this score will be quite low. And the idea of this benchmark is to create something that is very unsaturated with very strict requirements because that is how we build software. Like if if we ship the first two things and there's two bugs that we don't find until later like those are still bugs.

13:38 >> Yeah. Those bugs magically >> those are still failing tests. I mean if you're moving really fast and you're zero to one you're throwing everything out every 3 months. Like obviously this is a little lesson thing to go on about like how tests are freaking pointless now but that's a that's a separate thing. >> Okay. Let me let me go through the charts. And again, like this is gonna be a fairly short episode, but >> basically the yeah, the headline, one of the headlines was like Astra did Astra did the best. I don't have the original results in here, but GPT 5.5 is right between Astra medium and Opus 5.5 medium.

14:11 >> Nice. >> one of the most interesting findings here is like Opus 5.5 median did way better than Opus 5.5x high. Like three percentage points. >> I mean, yeah, I actually that's funny. Intuitively, I actually never use X high and I've just gotten seen way worse code >> and it's cool to see the data on there. But on GBT, >> I use medium almost always. Ever since Ben Davis told me that GPT 5.5 worked best on low for most things and I tried it. I was like, "Oh yeah, actually like some of these bigger like juicier models if you ask them to think more, they will like think themselves out of the right solution." I I guess in Astra, I'm about to change my system to X high because that seems like that's the way here.

14:53 >> If you have if you have a lot of time and money which I mean you don't have time, but you can paralyze. So >> if you're not paying a lot of attention, you get better results. >> The other thing that's really fascinating about this and can you go back to that? >> The only thing that's really counterintuitive here, if I were to be really transparent, is for myself, >> the code Astro I'm gonna show you something. Armen has this great thing. I'm gonna take over really fast for one second. Yeah, >> this's great thing is it's AGI if you don't look >> on one of his blog posts. and like >> Astro 5 whatever the Astro thing is, it's truly just AGI if you don't look because if you actually look at the code that it produces, yes, it works, but it's absolutely freaking disgusting and it just like random. It >> like you literally cannot This code is like disgusting. You cannot use this.

15:47 >> I mean, you can't as a human. Like, this is the thing we always talk about is like, yeah, if you're not look and you're never going to hit a problem that the model can't solve, then it's fine that you can't read it. But like, >> no, it's not about it's not about not being able to read it. It's that the complexity of the codebase increases over time dramatically. >> So, like every compounding feature puts the complexity of the codebase at a super increasing curve point. And like that's where Astra for me has been falling apart a little bit more now because it keeps adding like the code quality is sh and I think this is what slop code bench isn't measuring yet which is code quality.

16:22 >> Yeah. We'll get into that. >> Yeah. Okay. Go ahead. Go I'll take it back over it though. By the way, >> let me put a pin in this. Make a note. I want to talk more about this cuz like I think we may even disagree on this but let me keep going through the results. this is this is a great example though. So again, slop code bench, we go through a challenge over checkpoints and like throughout the checkpoints of a sing. So each challenge has three to eight checkpoints and there's like 30 challenges with 196 checkpoints. So like a checkpoint is a single prompt that you ask it to do a thing. and then at each checkpoint of a single challenge, it's like reinheriting the same codebase. So we force it to build on its own slot.

16:59 >> And then yeah, so that's core versus strict. The other interesting one is this like hey if you use medium it's cheaper and better for opus but if you use medium for astro it's cheaper but not as good and so so like the it's interesting the the openi models seem to actually perform better you know you're paying more but you get better performance from these models when you use x high versus like the cloud models we looked at basically tend to do better on a mediumish and that might just be the the the shape of this benchmark >> but this is really interesting.

17:31 >> Yeah. So, and then yeah, we have a little bit of like cost versus versus versus success rate here. Same data, but just in a graph. So, you see like oh here the actual performance went down for the Opus models, but like overall there's kind of an upwards trend of the more money you spend the the better results you get. The really funny one over here is Fable Fable 5.1x high, which was like way more expensive and not impressive at all in terms of like its actual ability to solve the problems. Fable is great in my opinion just for like double-checking a spec and like confirming whether or not it abides by that spec, but it's not good for coding.

18:04 >> Yeah. Okay, that makes sense. the and then this is like okay, cool. Like this is the number of tests fail. So all of these finished with some number of failing tests across the 36 problems that they did. So we look at the final snapshot, we run the tests and we see the failing tests. so again, none of these is like perfect. and only Astra was like basically like like three out of Yeah. three out of 36 it actually completed like all the problems with with with all the test passing.

18:35 >> Yeah. >> the code quality findings is interesting. So I I was talking to the model I was work I think it was a cloud model. It might have been it might have been soul. but basically it was like well the model's left around a bunch of trash code that like I think we should exclude for like test code and verifier code and like a bunch of scripts to like check the stuff. >> Yeah. >> And like >> I was like oh let's exclude that.

18:58 >> I don't know if you can >> Yeah. Go ahead. >> Go ahead. Well, I talked to the researcher, Gabe, and he was like, "No, like we actually want to measure like how much garbage the model's leaving your code base." Because if you're just committing and merging everything without looking the and the model is not going to clean up its like work in progress and test stuff without being asked to, then like we have to assume that that is part of the slop.

19:19 >> Yeah. >> And so, >> yeah, go ahead. No, we have this like this is the same rule like we have a rule in our read in our repo like you can't check in a readme file because by default models or like an MD file because models will just produce so much MD crap that's like temporary MD files and like if you leave that in the repo everyone is going to be degraded because some agent will read that file and it'll be polluted context and it's totally >> context it'll be extra context and also it might be out of date like it might be out of date incorrect information.

19:49 >> Yep. and then also like the more markdown files you have, the more the model's like, "Cool, the way we work in this codebase, so we drop markdown files everywhere." >> Exactly. And it just it just reinforces its belief constantly, which is not And that's the same thing with like garbage scripts. You leave garbage scripts in there, eventually those scripts stop working because you don't run them all the time. And the model's like, "Oh, I can just check in garbage scripts into this repo. It's an acceptable pattern."

20:12 Which it is because you've done that. >> Yep. So, this is we also do this thing. They have this thing called like they have like 212 all these all these challenges get written in Python. This actually thing I want to work with a researcher on is like making this work for TypeScript. But they built a bunch of custom llinters where they looked at repos here. Let me go back to Excaladraw. So they took a bunch of like pre-AI repos like PreAI like like commits.

20:37 >> Yeah. And then they looked at a bunch of like repos with a lot of AI contributions and they basically took these things looked at them like basically like qualitatively like I'm sure they use AI to help but there's like a human making decisions about like they probably came up with like about I want to say like 150 custom llinters like asbased llinters to like detect like patterns that or like AI slop patterns that like we've all seen like the the JavaScript thing with like is record everywhere and you have 50 instances of isre record across your codebase. So they like detect these specific things and then into this you actually add probably around like 50 to 60 like standard llinters.

21:22 So things things that we've they've been metrics codebased metrics that have been around forever like cyclomatic complexity graph traversal depth. Yeah, there's a bunch other metrics of just like how how messy is this code and how hard is it to understand. I think there's things like data like variables that basically get passed through a call stack and like it gets passed in at the top and passed all the way down through and then used like seven functions down the down the stack.

21:53 but what you get by combining all of this is you get about two I think it was 212 custom like slop detectors. basically understanding like how how much is and some of these are at the function level. So it's like if a function triggers the complexity then every line of that function gets treated as slop. and some of these are I think at the line level. So it's like okay if this line of code has this pattern or like a multi-line single expression has this pattern then it gets triggered.

22:24 >> You want to go ahead go ahead. >> What were you gonna say? >> I was going to say I can show some really interesting data right on that. That's exactly what I was going to loop in at the beginning. It's so funny you were thinking about that. >> We got two more charts and then I want to I want to get your take on this. so this is the slop coverage which is basically like what percent of the created lines triggered the slop filter.

22:47 >> yep. Makes sense. >> It's that high. >> Yeah, it's I mean the rules are very aggressive. and like again the goal of this benchmark was to create something that is very unsaturated. You may not even agree with all of the llinters you created. There may be a hundred of these like detectors that they made that you're like, I'm actually fine with that. I don't care. >> >> but basically, yeah. So, Opus, it's funny actually. So, Opus 5.5x high did the best on the slop metrics. It had the least like >> triggers. This also might be like these are newer models and I'm running on a version of the benchmark from, you know, the the actual like llinters are all from like some of them are from May and some of them a lot of them are from March. So, They're dated probably need to be updated. And actually, Gabe from Slop Code Bench is going to I think we should do another podcast. We'll get him on the podcast at some point. He's going through all this data and he said he wants to come up with some like qualitative observations of like what are the new slot patterns, which ones have like kind of no longer like being seen, what what have they trained out of the models and what have they accidentally trained into the models.

23:50 >> Yeah. and then, the last chart here is, yeah, actually the only one we filtered was Opus 5.5. The rest of them, basically, none of it really was a candidate. Opus 5.5 was the only one that left a lot of like things in like dot folders that were like clearly meant to be excluded. but it did write 200,000 lines of code where like Soul Medium actually wrote the least amount of code. And so like I actually I don't have a chart for this but I actually want to compare like total lines of code to actual like pass rate. we have cost which is probably a good proxy for that. I'm sure it will look a little bit like this chart but yeah total lines of code to pass rate. And then the last one is like the number of functions and methods and then the like weighted mean cyclomatic complexity. And so the other interesting thing here is like Fable actually had the the like the almost the most functions, the second most functions and had the lowest like average complexity of those functions.

24:51 So it actually did a good job of like making smaller functions. That doesn't mean they're not slop. I haven't looked at the code yet. but this is kind of like your like 50,000 foot view of like how do these models behave and how do they compare to one another. >> Yeah, that's that's a great I think this is really interesting. And and also just for everyone watching, I suspect just for full clarification, this is running a the standard benchmark for each model. So for GPT, we're probably running codeex. For cloud models, we're running claude.

25:19 >> >> we're using cloud code as the harness. Yeah. And then yeah, for GPT, we're using the codeex harness. For GLM, we're using open code. >> Yeah. So it's we're not we're using the best possible harness for that model at that given time. At least the or the most aligned harness, I should say. Maybe not the best, that's the wrong word, but like >> the default harness for that model. >> Yep. >> >> I want to go into something actually just riffing off this really Oh, you want to say >> I I think that's it. The the last thing I wanted to show is we did other posts on this and I think this one has this one from when was this? I don't remember. It was a couple months ago.

25:55 but this one actually does a good job of it. It it outlines in an appendix a bunch of the challenges. So if you want a summary of like okay cool we take this thing that is like jq for xml and then we build it out to like basically a generic like serializer des serializer for any binary data and like what are the actual like checkpoints and challenges. So if you want to get a better sense of that I mean you can clone the repo and ask your model to explain it to you but I have a little summary of that here. All right over to vibov.

26:22 >> It's really funny. when we went we spent a lot of time thinking about code quality a lot and the reason I spent a lot of time thinking about code quality is actually exactly first inspired by you Dax when you start first shared slop code bench with me >> and like I know you didn't make slop code bench but like just the way that you dug into it and really started talking about like this pattern of like long-term maintainability >> raised a lot of concerns and the first thing I noticed is when models first wrote any BAML code it basically was absolutely freaking garbage >> right and I'll show you how garbage it was because it goes straight into this problem of swap codebench because I think the BAML is a really easy way to prove that models are going to produce garbage code when it doesn't know what it's doing perfectly by default >> but if you go in a established codebase and you let the model run wild it basically converges to garbage in every language really fast right because like it tries to follow the patterns and can but it quickly devolves into trying to solve the problem not this comes back to the junior engineer versus senior engineer thing of like a junior engineer just builds what you ask for. A senior engineer like plans for the future and pushes back and says actually we like literally can't do that until we do this other thing first.

27:35 >> Yeah. So I'll like I'll show some code really fast just to show how bad it was and then after that I think it's useful I think it's super useful to see like disgusting code to see like these things these benchmarks are good but the benchmarks can sometimes be a little bit like removed you know >> cuz >> what you need to what you need to do is you need to make a BAML prompt for slop codeb that is I think going to be really interesting As soon as you see that, let me open the repo really fast. So, this is like a random project that I mode, but I want to I want you to start looking at like how ugly the code ends up getting really really fast.

28:15 >> let me see if I can find this. Like some of the patterns that it does, for example, is like it starts in Rust, you would never write if else statements. You would use to make match. >> Yep. >> It starts like, do you see how deeply nested this code starts getting? >> Grows. >> Exactly. You >> complexity. >> Yeah. You're not even thinking about it, but you're like instantly Exactly. And given arbitrary code places, you're not going to start writing code in any other way except this if you don't know any better. And once you start really go ahead.

28:45 >> This is how I wrote code in like the first program I ever wrote when I did like the internship at NASA writing code. It was like literally one giant function with like tons and tons of ifs and loops in it. >> Yeah. And what's funny here is like we're literally looking at this code in a way that a model does. There's no syntax highlighting. There's no nothing. You're just kind of staring at this. I should turn on syntax highlighting, but I it's on the browser version. Like right over here, for example, you would never write not equal to null. You would literally just write if not something.

29:10 >> Yep. >> These are small things that make a huge difference. And yes, llinters can help. Yes, a lot of things can help. >> no, this is please don't judge me. This is the browser version. I just press dot in the browser to open this very quickly. So I I am not a heathen. I don't >> highlighting, dude. >> Where's your syntax highlighting, dude? >> I don't have the in the browser version. it doesn't come with any default extensions included.

29:33 >> So like I I would have to open it locally. >> But we looked at this code and what's interesting is to reduce the skill what we did is we literally just put together a list of rules mostly just by being like here's examples of good code and here's examples of bad code. Like for example one thing is like don't put magical constants everywhere. We all know that's bad. >> Yep. >> But a model does every >> magic numbers.

29:54 >> Exactly. Don't do magic numbers. And you can just like tell a model this. You can do things like don't create like complex classes. Use like exceptions because we prefer exceptions in the language. And there's a whole bunch of things like you generally shouldn't write if else and construct list. Use like filter and map. There are better ways to write code. It makes it easier to write the code and read the code and understand it. >> I mean that that one is a little bit more of an opinion. I >> I think you can overdo the fil I'm a huge FP guy. I love filter folded map.

30:23 But I I I do remember having like PRs completely rejected. It was like you have an eight like thing pipeline with like a bunch of reduces and folds in it. >> Reduces and folds I agree are controversial. Filter and map is objectively the best way to do it in my opinion. >> Okay. I mean I I agree with you. I just I don't I don't know if that is like a a universal truth but like this >> this should be a universal truth at the very least. Like an if else is strictly worse than a match.

30:51 >> Yep. 100%. Because again, one is one is guaranteed to abide by your type system, the other one is not. >> So like if you add a new enum, the second one fixes it. >> And what's really interesting is like a lot of this is actually inspired by Google has this thing, their CPP style guide for Absol. It's one of the most beautiful style guides ever made. It really helps. >> Oh yeah, I've read their their Java style guide is also really good.

31:13 >> Oh well, Java is bad by default. So but otherwise, yeah, >> C++ is not good, dude. C++ I'm sadly a sucker for pain. There's other things like truthiness like don't write this just use if name because truthiness exists right >> and I see this even in Typescript models will write this crap when they really should be doing >> something like this >> but what's interesting is the way that you would typically write a llinter to sol like there's like bunch of rules here >> there's a the way you typically write a llinter to solve these rules would be you'd convert everything to a linting rule you'd make that work and that's nice programmatically but we kind of live in a new world now where you can just like make your llinter an LLM command and it's like a skill that you can go do. But when we actually started measuring this, I think this is where we got some really interesting results. And I think the way the biggest difference in the way that the world has changed is we used to care a lot about how expensive. Yeah. In Typescript not equal to null versus truthy is fundamentally different, but 90% of the time the usage is almost always the same.

32:18 >> Yeah. Exactly. Python like things can be nullish but like you actually only care if they're none. But anyways, keep going. >> Yeah, exactly. But what's interesting is I think when we first starting building BAML, we really >> Hold on. What am I looking at here? Can you explain this? >> I'll show you. I'll describe that in a second. But I just want to describe the highle metrics. When we really first started to care about it, what we really cared about was making sure that you could come to good code in a cheap way upfront. But I think many people now would sacrifice a little bit of cost in favor of maintainability.

32:51 >> Yeah. They would pay more to basic they would spend twice the tokens if it meant that like the code was much cleaner. >> Exactly. So >> or even a little bit even 20% cleaner. >> Yeah. So we started to do was actually like start evaluating like what does it look like if the system started to go do this for like arbitrary systems. So like we gave it a bunch of tasks to go implement like a chess move generator GTFS departures and a whole bunch of things like an engine which is like a redex thing. So these are like fairly complex systems to go build >> and we just asked itself like how many lines of code do you end up with in every single world and more lines of code is not necessarily bad. Tests are not necessarily tests we we try and have a metric for with tests without tests.

33:31 >> Yeah. >> And then we try and have an answer for like exactly what is going on. like let's use where is the one there's more metrics here like this one is might be more interesting but what's really interesting is actually these first metrics which are very highle calls of like just like roughly what did the coding agent what did the coding harness do at any given time but we actually started ignoring these metrics we said let's just not care at all about how long the agent took to solve the problem let's not care at all how many times it ran tests or how many times it ran like the actual >> script BML run calls and BML test calls kind shows it like how much is it like hill climbing against something or is is running more test calls better or worse?

34:13 >> So that's why we said we just ignored this like it's like ignore it. >> It's just kind of like blurry signal that gives you a shape of it. We don't care about like we're not ascribing a value to it. But yeah, okay, cool. Now we have the complexity metrics. >> But now we what we said is what if the compiler gave the system runtime pressure? >> Oh, this is sick. Okay, so your guidelines worked for a lot of things.

34:32 it not for a lot for every single thing >> except for cyclomatic complexity worst function it seems like it's about >> no ski guidelines is worse guidelines is better you want lower is better >> yeah yeah yeah but your guidelines your like mean bar is to the right of the one for baml core >> what are you talking which one >> the bottom left chart >> oh bottom left yeah the worst function yeah sorry >> that's the only one where it's like still up in the air but yeah all the rest of them are like basically like across the board getter >> but even then that one is still like roughly in the same order of magnitude.

35:04 So what that leads me to believe is like that that code base is probably going to be roughly around the same system, >> right? You're always going to have one big crazy function and it's like the least it's the least interesting metric probably >> at least for this problem. Like it feels like that doesn't help us converge. And that's where like seeing the difference here helps a lot. But the really interesting insight here that we had was like you can take all these benchmarks and now you can start measuring skills.

35:27 You can measure llinters. You can measure all sorts of things to see. >> You can try 10 different you can have instead of three versions you can have 10 versions and you can like look at all of them. >> Exactly. You can look at a git diff and the git diff can now tell you what your what your next step did. But what's really fascinating is if the compiler starts act the most interesting insight we had here is like one yes our guidelines are clearly being merged into the system and our skill is getting updated with these guidelines because it clearly just objectively makes the codebase better.

35:55 >> Yeah. >> But I think the more interesting insight was like oh you can just see like less nesting a maintain this is very interesting like the maintainability index of how you actually run the houseet volume >> and a few other things was like really fascinating like oh you your code base just gets better over time. Yep. >> But I think the most fast and what we did is every single project was started from scratch like end times. So instead of just running it once the >> same challenge end times for these three different like prompts that you gave it.

36:24 >> Exactly. But the most >> But this was oneshotted, right? This wasn't this wasn't like accumulating code over time. >> You should do this with Slob Codebench. >> Yeah, exactly. But the most interesting insight that we had out of this was actually >> if you just bake these metrics into the compiler, you can now give the LM back pressure of like, oh, you made the codebase worse >> over time and it's like super trivial to go.

36:46 >> This is the thing that I think is missing from slop codebench is like nobody in their like generic like if you're serious about making a dark factory, you have feedback for all of these things going into the agent. And I'd be really interested to see the difference between a like here's the thing, go build it prompt versus a like here's a thing, go build it and then run this battery of tests and then like you know try to get to some goal score basically.

37:09 >> Well, what I mean is like for example one really interesting I I wish I had the code bases here to show you but one really fascinating thing is like just by reducing the complexity of a codebase you often reduce bugs. >> Yep. >> Right. So like like the worst function like maybe >> for the model to understand it's easy it's easier for the model to understand your abstractions are better your data models are better you like eliminate whole classes of bugs.

37:30 >> Exactly. And that I think is the key insight here. So we talked about back pressure in a previous episode but like if you give the model more back pressure then boom you actually get to like this whole thing where like you're going to produce way way better code bases over time. And I think this will actually help with slob code bench with the exact same way >> cuz that's one of my tasks for next week. And maybe we should do a fun >> I got to I'm getting kicked out of this room in like 2 minutes. Thank you all for jumping in and really excited to share what's next on this benchmark.

38:01 And shouts out to the team at University of Wisconsin who created Slop Code Bench. Everyone thinks it was me. I don't know why. Sorry, Gabe. they are they are the the brilliant minds behind this. I just I just run the inference.

Summary

The episode discusses the latest findings from the Slop Code Bench, a benchmark designed to evaluate how well AI models can maintain and evolve a codebase over time. The hosts emphasize the importance of software maintainability and how current models struggle with it, often producing "slop" or messy code that complicates future development.

- **Slop Code Bench Overview**: A benchmark that evaluates AI models on their ability to inherit and maintain a codebase while adapting to changing requirements.
- **Model Performance**: Astrax High outperformed others in recent tests, though Opus 5.5 remains a favorite for many tasks.
- **Importance of Maintainability**: The discussion highlights that maintainability is more crucial than immediate performance, as it impacts long-term software quality.
- **Failure Cases**: Models often produce code that meets immediate requirements but fails to account for future changes, leading to increased complexity and bugs.
- **Code Quality Metrics**: The episode introduces various metrics to assess code quality, including cyclomatic complexity and function depth, which are crucial for understanding maintainability.
- **Learning from Human Engineers**: The hosts argue that human engineers possess an intuition for maintainability that current models lack, emphasizing the need for models to learn to "disobey" incorrect requirements for better outcomes.
- **Back Pressure Concept**: Introducing feedback mechanisms in AI models could help them produce better code by discouraging complexity and promoting maintainability.
- **Future Directions**: The hosts express interest in further refining the Slop Code Bench and exploring how to integrate maintainability metrics into AI training processes.

Questions Answered

What is the significance of the Slop Code Bench in evaluating models?

The Slop Code Bench evaluates how well models inherit and adapt to a codebase over time, emphasizing the importance of understanding requirements and maintaining code quality. It highlights that simply feeding a model features without understanding the end state can lead to poor outcomes.

How do we ensure AI models align with user needs?

The alignment problem involves ensuring that AI models not only follow instructions but also adapt to correct misunderstandings in requirements. This requires models to sometimes disobey initial commands to improve the overall codebase.

What are the implications of code quality in AI-generated code?

While AI-generated code may function correctly, its quality can be poor, leading to increased complexity over time. This complexity can hinder maintainability and usability, emphasizing the need for better metrics in evaluating code quality.

How do different models perform in terms of code generation?

Models like Opus 5.5 have shown superior performance in generating code with fewer issues, but there are concerns about the relevance of the benchmarks used. Continuous updates and qualitative observations are needed to assess evolving patterns in model performance.

What is the role of linting in maintaining code quality?

Linting helps enforce coding standards and improves code quality by identifying potential issues. The evolution of linting tools, especially with the integration of AI, allows for more sophisticated approaches to maintaining code standards.

© transcribe · For agents Built with care and craft by Gokul Rajaram