[00:15.860 --> 00:16.700] Hi, everybody. [00:16.700 --> 00:18.100] My name is Dave Musliner. [00:18.200 --> 00:19.200] This is my colleague, Dr. [00:19.200 --> 00:22.620] Matt McClure from SIFT, or Smart Information Flow Technology. [00:22.660 --> 00:30.140] We're here to describe the La Crosse Cyber Reasoning System for automatically finding and fixing software vulnerabilities at scale and speed. [00:30.460 --> 00:37.660] So I'll give you one slide on who is SIFT, since you may not have heard of us, and then I'll talk briefly about the SIFTies who are here at DEF CON. [00:38.440 --> 00:45.300] Mostly we're spending our time over in our booth behind us describing how our cyber reasoning system works in more detail than you'll hear in this talk. [00:45.860 --> 00:55.600] But I'll give you a quick overview of the history and design of the cyber reasoning system and what we actually build for finals, which is different than what we build for semifinals and different than what we planned. [00:55.600 --> 00:58.480] That's kind of an ongoing theme you've heard in the other presentations. [00:58.840 --> 01:04.820] And Matt's going to give you a deep dive into the most important part, the newest part of our system, how all the large language model works. [01:06.000 --> 01:06.880] So who is SIFT? [01:06.880 --> 01:10.360] We're a small research company located in Minneapolis. [01:10.360 --> 01:14.040] We have a branch office in Boston and individuals scattered around the country. [01:14.040 --> 01:19.140] We're about 35 people and we focus on all areas of computer science and human-centered research. [01:19.140 --> 01:23.060] So a little bit different than some of the other teams that have built cyber reasoning systems here. [01:23.060 --> 01:25.140] We're not purely a cyber company. [01:25.400 --> 01:33.100] We have a great deal of cyber work, but probably two-thirds of our work is in other areas of AI and other research topics. [01:34.040 --> 01:37.080] SIFTies here at DEF CON, we've got five folks for your enjoyment. [01:37.080 --> 01:40.340] Lewis, Nathan, and Dan are either in the audience. [01:40.340 --> 01:41.440] Oh, there they are in the audience. [01:41.440 --> 01:42.360] Thank you. [01:43.340 --> 01:48.100] And Matt's up here with me to tell you all about the large language models. [01:48.700 --> 01:53.340] So our cyber reasoning system is actually fairly old. [01:53.580 --> 02:06.920] Our work in autonomous cyber reasoning goes all the way back 25 years to the DARPA Cyber Panel Program where we started working on decision-theoretic, mission-aware, automated response or defensive responses for cyber threats. [02:07.380 --> 02:22.400] But we didn't really get into large-scale multi-agent CRSs, cyber reasoning systems, until the DARPA Crash Program in around 2009 when we built a very large-scale system called Fuzzbuster which could run hundreds of nodes doing fuzzing before OSS fuzzing, [02:22.400 --> 02:26.900] before a lot of the fuzzers that you're familiar with, also before large language models. [02:26.900 --> 02:37.700] And the focus of Fuzzbuster was really to find bugs in source code and also to shield them, not necessarily fix them the way we do for this project, but to shield them from bad inputs. [02:38.440 --> 02:44.720] We participated in the DARPA Cyber Grand Challenge, which you may have heard a little bit about, about 10 years ago. [02:44.760 --> 02:49.580] We built a system called Fuzzbomb, which was designed to find and fix bugs in binaries. [02:49.580 --> 03:02.100] So very similar to what has happened here in the AI Cyber Challenge in the last two years, only instead of binaries in the CGC, here we have source code for all the open-source projects that were turned into challenge projects. [03:03.680 --> 03:10.420] After CGC, we continued working on large-scale fuzzing systems for the Navy, looking at more targets. [03:10.560 --> 03:17.180] And now we've built, as you've heard for the last two years, the La Crosse LLM plus AI Cyber Reasoning Security System. [03:17.600 --> 03:20.680] So what does all this Cyber Reasoning Security System look like? [03:20.680 --> 03:23.900] It's a little different than some of the other architectures you've heard about earlier. [03:24.620 --> 03:30.340] SIFT's existing system is designed as a multi-agent system with a plug-in analysis tool architecture. [03:30.340 --> 03:41.600] So on the bottom, you can see the system has the ability to take a lot of different kinds of tools from traditional cyber reasoning, static analysis, fuzz testing, symbolic analysis tools. [03:41.820 --> 03:47.360] All of those have been integrated into the cyber reasoning framework in previous projects. [03:47.360 --> 03:54.620] And the most important thing probably is that it's not one core or one agent running these tools. [03:54.620 --> 04:02.460] We can run hundreds of agents, and there is a built-in ability to coordinate which agents are working on which problems at which time. [04:02.600 --> 04:10.000] In the different architectures we've worked on, the different designs we've worked on, the exact layout of the hierarchy of agents is variable. [04:10.000 --> 04:16.260] But for La Crosse, there was essentially one agent responsible for gameplay and strategy. [04:16.260 --> 04:28.560] And it would task up to 300 other agents what to be doing, whether they were fuzz testing to try and find proofs of vulnerability or asking large language models to generate patches, et cetera. [04:28.560 --> 04:29.960] Matt's going to tell you all about that. [04:29.960 --> 04:35.480] The big new thing here in yellow is, as I said before, adding code-trained large language models. [04:35.640 --> 04:39.360] Now, underneath that, you'll see it says fine-tuning, and it's crossed out. [04:39.360 --> 04:49.040] Because two years ago, when we proposed to develop this system, we thought that we were going to have to fine-tune the LLMs to be better at reasoning about patching software. [04:49.400 --> 04:58.440] And as time went on, and as the LLMs got so dramatically better, not only did we not have time to even try fine-tuning, but we realized we probably didn't need to anyways. [04:58.440 --> 05:00.760] They're fabulous at this point, and they're getting better. [05:00.980 --> 05:03.360] And we try to do as much testing as possible. [05:03.380 --> 05:12.540] You've heard all the other teams saying, hey , these LLMs can lie to you, they can give you bad results, you've got to test the results, make sure they're as good as possible. [05:12.540 --> 05:23.740] Perhaps feed responses from testing systems like compilers and regression testing back into the LLM and say, you made a mistake, try again. [05:23.940 --> 05:30.020] So I'll give you just a quick overview of some of the kinds of workflows that LaCrosse can engage in. [05:30.020 --> 05:38.080] And the red Xs, just a preview, are things that we thought we were going to build, or we did build, but we didn't end up using for various reasons. [05:38.200 --> 05:51.840] But if you look at the top workflow, this looks a lot like some of the things you've seen before, where we start up one or more fuzzers on a new target, and then if a fuzzer can find a proof of vulnerability, a crashing input, we'll give that to a large language model and say, [05:51.840 --> 05:59.500] could you please figure out, based on the crashing data, what's going on, what's the kind of vulnerability, could you describe it or characterize it? [05:59.500 --> 06:02.940] And then we'll ask the large language model, please generate me a patch. [06:02.940 --> 06:06.820] We may ask multiple large language models multiple times. [06:07.220 --> 06:15.000] Those patches go through as much regression testing as we can, and it depends on what the exact challenge problem is, how much we have in the way of testing. [06:15.000 --> 06:20.980] But certainly the patches are checked to make sure that they compile correctly and the program turns over as much as we can. [06:21.040 --> 06:23.420] So that workflow was in the original design. [06:23.420 --> 06:35.200] On the left, you see that we had also planned to use static analysis tools to identify bugs, and we all know that static analysis tools are very likely to have false positives, and so we're like, that's no problem. [06:35.200 --> 06:40.340] The large language model will filter out the false positives, and it's just going to be great and awesome. [06:40.760 --> 06:50.800] In practice, what happened was the static analyzers we used weren't very good, and in the semifinals, you actually needed a proof of vulnerability to score any points at all. [06:50.800 --> 06:56.720] And so you could not just take a static analysis tool and say, here's a possible problem, LLM, please patch it. [06:56.720 --> 06:57.800] You will get no points. [06:57.800 --> 07:03.400] You actually need crashing input, and that pushed us back into fuzz testing, so there went static analysis. [07:03.480 --> 07:09.360] We also wanted to use dynamic symbolic execution to assess whether the patch was actually seeming to do the right thing. [07:09.360 --> 07:10.600] That never happened. [07:10.640 --> 07:11.600] Crossed that baby off. [07:11.600 --> 07:24.480] So another workflow, a cross-queuing workflow between analysis tools on the bottom, where in some situations in the finals, it became possible to score points without actually having a crashing input. [07:24.480 --> 07:31.240] And so we were able to generate a new workflow where you just feed some code to the LLM and say, does it look like there's a problem here? [07:31.500 --> 07:47.560] If so, generate a patch, regression test it, and then you may generate a lot of these patches, so do some patch selection heuristics to try and find a patch that seems like it's fixing something that's serious enough that the challenge problem might actually include it as a known bug. [07:48.600 --> 08:00.120] But we didn't want to do too many of these, because this pipeline could generate hundreds of suspected bugs and patches, and we knew that the organizers were probably not going to put in hundreds in each of the challenge problems. [08:00.120 --> 08:04.240] So we had to kind of tamp this thing down and do a better job with patch selection there. [08:04.240 --> 08:07.640] If you want to know more about that, I don't think you're going to get all that in Matt's talk. [08:07.700 --> 08:13.100] You have to come back to our booth to know a little bit more about how we scored patches to decide which ones to submit. [08:13.500 --> 08:19.160] But I'll just mention quickly some of the recent advances in large language models that you've probably already heard about today. [08:19.280 --> 08:27.220] But among other things, most important for us in the differences between when we started two years ago and where we are now is greatly increased token limits. [08:27.220 --> 08:31.420] So how many tokens, how much code can you actually feed into the large language models? [08:31.420 --> 08:34.640] In the semifinals, you really couldn't feed in very large chunks of code. [08:35.100 --> 08:37.780] Those limits have gone up by orders of magnitude. [08:38.020 --> 08:53.020] And now, in many cases, you can fit a whole source code file from an application, a large real-world application, you can fit the whole thing into a large language model context window and just ask questions like, is there a bug or can you patch it for me? [08:53.420 --> 08:59.940] And the output windows are important, too, because if you ask it to just rewrite the whole file, it's got to be able to output the whole file. [08:59.940 --> 09:01.240] And that doesn't always work. [09:01.240 --> 09:03.440] We have stuff to work around that. [09:03.440 --> 09:07.140] But it got a lot better as the LLMs improved. [09:07.900 --> 09:10.140] It is important to note that they're still not reliable. [09:10.140 --> 09:11.580] They make mistakes all the time. [09:11.580 --> 09:16.840] So we had to do a lot of work to detect when they might be making a mistake. [09:16.840 --> 09:24.340] And as I mentioned already, re-prompting them with error messages from things like compilers or testing frameworks to say, yeah, you patched it. [09:24.340 --> 09:25.180] It did compile. [09:25.180 --> 09:26.300] But these tests broke. [09:26.300 --> 09:27.560] Please fix that. [09:28.440 --> 09:36.740] I think with that, I'll just hand the mic right to Matt, and he'll go into the details of our really cool LLM stuff, which is this is different than anything you've seen before. [09:42.360 --> 09:43.420] Hi, everyone. [09:44.540 --> 09:48.420] My job is to tell you mostly about our LLM magic. [09:48.740 --> 09:50.520] I'm not a cyber person by background. [09:50.520 --> 09:56.820] You've seen a lot of people here today that are cyber experts that came to AI more recently for AICC, perhaps. [09:56.820 --> 09:57.820] I am the opposite. [09:57.820 --> 10:03.180] I am an AI person by background who had no cyber experience coming into AICC finals. [10:03.180 --> 10:04.400] I wasn't involved in the semifinals. [10:04.400 --> 10:09.540] So if I say anything squirrelly on the cyber side, that's why I say squirrelly things on the AI side. [10:09.540 --> 10:10.540] I have no excuse. [10:11.420 --> 10:18.020] So this is a high-level map of our Lisp-level tasks in LaCrosse. [10:18.060 --> 10:21.880] Embedded in here is kind of another view of what Dave was showing earlier with those workflows. [10:22.620 --> 10:27.340] When LaCrosse gets a challenge problem, it's going to be fuzzing, like Dave said, on hundreds of nodes. [10:27.340 --> 10:31.000] It's also going to be generating patches. [10:31.000 --> 10:36.740] And some of those generated patches are going to be in response to the POVs that it finds. [10:36.800 --> 10:39.160] Those are the proofs of vulnerabilities, i.e. [10:39.160 --> 10:43.280] crashing inputs coming from the fuzzers that are getting sent back incrementally. [10:43.340 --> 10:48.680] Some of the patches that it generates are going to be proactively just scanning code, not based on POVs. [10:48.960 --> 10:53.060] That's actually the path that you see along here on the top. [10:53.060 --> 11:00.480] We have a hypothesized vulnerabilities task whose job it is to be scanning code, generating hypothesized vulnerabilities. [11:00.780 --> 11:02.740] We also call that characterization. [11:03.740 --> 11:08.660] And then as they incrementally come into Optimist, it's going to be spawning these patching tasks. [11:08.800 --> 11:13.900] Those don't get submitted right away because we're not as confident in them as if we have a POV. [11:14.380 --> 11:19.160] Across the middle there, we have our main path through the fuzzer. [11:19.160 --> 11:23.180] Again, running on hundreds of nodes, sending back crashing inputs incrementally. [11:23.220 --> 11:28.640] And then we have these two tasks that are mirroring the two tasks above, essentially a characterization step. [11:28.640 --> 11:33.020] And then for each characterized vulnerability, a patching task. [11:33.560 --> 11:36.960] The dashed box does not exist in our final system. [11:36.960 --> 11:39.720] Some version of it existed in our semi-final system. [11:40.400 --> 11:42.300] But it's an exciting piece. [11:42.300 --> 11:51.540] It's just in those final stages, those final weeks, the calculus of the expected points to be gained by working on different things versus the risk and the cost. [11:51.940 --> 11:53.840] This just didn't make it to the top of the list. [11:53.840 --> 11:55.140] But we are excited about it. [11:55.140 --> 11:59.800] And also, it's motivated the task structure here, which is why I included it. [12:01.020 --> 12:09.140] And then along the bottom there, we just have that one monolithic task, an LLM pipeline, whose job it is to deal with serif assessment. [12:10.320 --> 12:13.340] I think that covers that slide. [12:13.440 --> 12:20.160] So now, oh, so we had those three main pipelines, characterization, patching, and serif assessment. [12:20.160 --> 12:21.560] So I'm going to talk about each one. [12:21.980 --> 12:25.940] So characterization, I'm actually going to direct you to the bottom first here. [12:25.940 --> 12:27.120] These are the inputs. [12:27.620 --> 12:30.340] Some of these are not, the first three are not always available. [12:30.340 --> 12:31.880] The last one is always available. [12:32.200 --> 12:36.420] In the POV case, we get a crash log from reproducing the POV. [12:36.420 --> 12:44.060] And as a first step, we always will filter that down to the stack trace and any relevant instrumentation leading up to the stack trace. [12:44.800 --> 12:50.760] In the case of a delta scan, we have a delta, which is the diff of the commit that introduced or exposed the bug. [12:51.320 --> 12:56.980] The blob is just another name for the crashing input itself, which again is only available for the POV case. [12:57.000 --> 12:59.940] And then the code base is always available. [12:59.940 --> 13:05.400] So as a first step, if a delta or crash exists... [13:05.400 --> 13:06.900] Actually, let's go on the bottom first. [13:06.900 --> 13:14.560] If it does not exist, then we're going to scan every file in the code base that's in the target language, which we determined programmatically. [13:14.780 --> 13:19.360] We feed that file into this identify vulnerabilities prompt. [13:19.660 --> 13:21.360] It's a single prompt. [13:22.480 --> 13:24.940] And we're going to ask it what vulnerabilities are in the file. [13:24.940 --> 13:31.680] And that's going to give us this first initial raw list of vulnerability hypotheses, this data structure that you see in the middle there. [13:31.720 --> 13:36.060] If we have a delta or crash, we're going to do something more sophisticated. [13:36.080 --> 13:47.700] It's shown as a single box there, but it's actually a whole sub-pipeline whose job it is to determine the relevant context, potentially relevant context, for identifying vulnerabilities. [13:47.700 --> 13:53.560] It can be pulled from different files, different functions, and in some cases, just more free-form snippets than a function. [13:53.560 --> 13:58.800] That gets passed in as context to this identify vulnerabilities step. [13:59.280 --> 14:11.420] And again, we end up with these structured hypotheses that include a natural language description of the bug in terms of specifics, variable names, function names, etc., line numbers. [14:11.600 --> 14:15.360] We have a CWE as assessed by the LLM. [14:15.360 --> 14:23.000] We have a list of suggested repairs, which are per file, that together will jointly fix the bugs according to the hypothesis. [14:23.000 --> 14:27.080] And notes, which is just anything that doesn't fit into the above fields. [14:28.040 --> 14:31.440] Okay, so next step, we filter and score this list of vulnerabilities. [14:31.760 --> 14:34.620] We have a list of yes or no questions that we filter against. [14:34.620 --> 14:36.260] It has to pass all of those. [14:36.580 --> 14:46.680] So, for example, if you need to create file system effects, like symlinks, whatever, in order for the bug to be exploitable, we toss it. [14:46.680 --> 14:50.780] Because we don't think that's accessible in the parameters of the competition. [14:51.900 --> 14:56.900] We deduplicate against existing vulnerabilities involving the same file. [14:56.920 --> 15:01.080] Again, this is shown as one block, but there's actually more subtleties inside there. [15:01.460 --> 15:04.960] And then we score, again, against a list of yes or no questions. [15:04.960 --> 15:08.440] There's like five to ten yes or no questions in both of those. [15:09.020 --> 15:12.200] And in this case, there's a reward associated with each question. [15:12.200 --> 15:20.440] So, for example, one of them is, does this CWE show up in the list of the most serious CWEs of 2024? [15:20.440 --> 15:21.480] And then we list them. [15:21.900 --> 15:24.660] If it does, you get five points or something like that. [15:24.860 --> 15:31.820] So, this is how we end up with a filtered list of vulnerability hypotheses that each one is scored. [15:35.480 --> 15:37.760] Okay, here's the patching pipeline. [15:37.880 --> 15:42.780] In comes our single vulnerability hypothesis, and it has this list of suggested repairs. [15:42.860 --> 15:46.200] For each one, we're going to do everything inside that dashed box. [15:46.780 --> 15:50.420] First, we're going to choose whether we want to work in functions or snippets. [15:50.420 --> 15:53.020] We're asking the LLM that with the relevant context. [15:53.760 --> 16:03.640] And we end up with these code snippets, and we're going to feed those into this rewriting prompt that is going to jointly rewrite them, because they might have cross-dependencies. [16:03.780 --> 16:09.180] So, that's a structured prompt where you're going to rewrite all the code snips together to implement the file repair. [16:09.200 --> 16:18.540] Then we have this rectify step, which is because sometimes the LLM will hallucinate a rewritten function that does not correspond to any original function. [16:18.540 --> 16:22.480] So, we found that, and we had to filter those out, essentially. [16:23.120 --> 16:26.860] So, now we have our rewritten code snippets, our original code snippets. [16:26.860 --> 16:31.020] And because we worked in line numbers early on, it's as simple as a string replace. [16:31.020 --> 16:32.420] We can do that programmatically. [16:32.420 --> 16:34.840] That's that replace function snippets box. [16:36.540 --> 16:39.280] And so, we implement all our file repairs. [16:39.280 --> 16:41.800] Then we have a modified code base, an original code base. [16:41.800 --> 16:43.180] We do a programmatic diff. [16:43.180 --> 16:44.620] That gives us a patch. [16:44.760 --> 16:46.480] Then we move on to patch testing. [16:46.480 --> 16:48.480] And this has four stages. [16:48.600 --> 16:50.060] Does the patch apply? [16:50.300 --> 16:53.240] Does the patched code base build? [16:54.000 --> 16:57.520] Did it fix the POV, in the case where we have a POV? [16:57.620 --> 17:00.840] And does it pass functionality tests, which are not always available? [17:00.840 --> 17:03.960] So, those third and fourth ones are not always available. [17:04.440 --> 17:09.340] We look at whether the patch passed all available tests. [17:09.460 --> 17:10.340] If it did, great. [17:10.340 --> 17:11.480] We output a patch. [17:11.500 --> 17:15.160] If not, we get feedback on what exactly failed. [17:15.160 --> 17:16.620] How many steps failed and more detail. [17:16.620 --> 17:19.800] For example, if it didn't fix the POV, we have a new stack trace. [17:20.520 --> 17:26.420] And this feeds back into this running list of patching attempts and their associated feedback. [17:26.800 --> 17:34.680] This gets fed into this modified vulnerability hypothesis sub-pipeline, which also has the relevant inputs. [17:34.680 --> 17:44.420] And we are going to modify the original vulnerability hypothesis, start the whole thing over again, and repeat that until you succeed or reach some max number of attempts. [17:44.780 --> 17:49.920] And if you fail, then I'll get to this, but the whole thing is going to be rerun with a different model. [17:49.920 --> 17:51.500] A different default model. [17:51.640 --> 17:59.980] Individual components can have assigned specific models, depending if we found that that model is particularly good at that step. [18:02.140 --> 18:05.240] Okay, this is the serif assessment pipeline. [18:05.240 --> 18:10.000] Shout out to Luis Baez who implemented this and the testing for it. [18:10.000 --> 18:13.340] So we have our serif report coming in. [18:13.500 --> 18:17.740] We extract the relevant snippets from the serif report. [18:17.740 --> 18:20.080] Sorry, we extract the relevant locations. [18:20.300 --> 18:23.500] That allows us to extract the code snippets that it's referring to. [18:23.500 --> 18:26.300] We add some margin on the front and the back. [18:26.980 --> 18:33.340] Then we just feed the serif report and these relevant code snippets into this prompt that's actually surprisingly brief. [18:33.340 --> 18:38.060] It determines whether the serif is internally consistent and correct with respect to the code. [18:38.060 --> 18:41.920] Output a binary yes or no and a reason and Bob's your uncle. [18:44.040 --> 18:51.640] So Luis had created these seven additional tests in addition to the seven serif tests that we had from the competition. [18:51.640 --> 19:02.100] These were like slight variants that were made to be incorrect and out of those 14 we were finding that we had 13 of 14 consistently correct by the time we tuned this thing. [19:03.680 --> 19:06.320] Okay, that leads me to prompts and mixins. [19:06.320 --> 19:09.900] This is a look at what a prompt is like in Lacrosse. [19:09.900 --> 19:12.640] We used a framework called DSPy. [19:12.640 --> 19:14.000] Some of you might have heard of it. [19:14.100 --> 19:15.440] I love DSPy. [19:15.440 --> 19:20.320] And the reason I love DSPy is because it allows you to treat prompts like functions. [19:20.840 --> 19:24.920] And the way it does that is by giving you a typed interface to every prompt. [19:24.920 --> 19:27.340] So you have some number of input fields. [19:27.340 --> 19:29.780] Each of them has an arbitrary type specifier. [19:29.780 --> 19:33.320] You have some number of output fields, also type specified. [19:33.460 --> 19:39.560] And DSPy has gotten really good at getting those types right on the outputs. [19:41.360 --> 19:45.240] And so for example here, we have a serif assessment signature. [19:45.440 --> 19:54.640] In DSPy you have this block that's describing the purpose of the prompt itself, the operation of the prompt, that natural language description. [19:54.640 --> 20:00.800] Then for each field you have, in addition to your type specifier, you have a natural language description of the field. [20:01.280 --> 20:08.740] Now, this is great for composing these complicated pipelines that become more reliable because you're treating prompts like functions. [20:08.740 --> 20:13.420] But it is cumbersome because you have to define all these input and output fields every time. [20:13.420 --> 20:15.180] Describe your prompt, describe each field. [20:15.180 --> 20:22.900] So what we do in Lacrosse is we go further and we turn any potentially reusable input or output field into a mixin. [20:22.900 --> 20:31.400] So it gets its own class and we just make sure that the description for the input or output field is not specific to the operation of this prompt. [20:31.580 --> 20:36.900] And that way we get to, as long as it can work together and make sense in the context of the prompt. [20:36.900 --> 20:46.560] So you get kind of the best of both worlds where you eventually build up this library of mixins and your prompts become as simple as writing the general description of what it's doing. [20:46.580 --> 20:51.480] You import these mixins, make it inherit from them, and there's your typed interface. [20:51.480 --> 20:56.560] So we think that's an exciting way to prototype more quickly. [20:57.920 --> 21:00.500] These are some fun examples I'll gloss through. [21:00.500 --> 21:01.440] Oh yeah, I've got to gloss. [21:01.840 --> 21:07.540] Basically the punchline here is that this is the same serif challenge that came in. [21:08.100 --> 21:14.880] And in one case we had a larger margin on each side of those code snippets, 50 to 100 lines. [21:14.880 --> 21:23.860] In the lower case we had the same model, same pipeline, but a tighter margin, which was less intuitive to us, of 0 to 10 lines. [21:23.860 --> 21:25.060] We ended up with 10. [21:25.420 --> 21:29.260] But anyway, the thing nails it when you give it less context. [21:29.340 --> 21:34.720] And this gets at a repeated lesson of these things is context management is so key. [21:35.160 --> 21:43.360] They have hard limits on the context window, but really there's a soft limit to think about with these context windows because it's going to be more performant the more you can eliminate distractors. [21:45.420 --> 21:48.460] Real quick, this is one that we were surprised by. [21:48.980 --> 21:54.820] Lewis modified a test to have, instead of an out-of-bounds read, which is correct, the test had an out-of-bounds write. [21:55.060 --> 21:58.580] And we saw that the O3 model nailed this. [21:58.580 --> 21:59.880] We were kind of shocked at the time. [21:59.880 --> 22:05.280] O3 ended up being the model that we went with for serif assessment as a first resort. [22:05.720 --> 22:09.260] And yeah, just kind of an anecdote about these things being impressive. [22:09.860 --> 22:17.080] Okay, so real quickly, these are a couple robustness mechanisms that are sprinkled throughout LaCrosse. [22:17.380 --> 22:28.400] Trimodels is a wrapper that we have where you're giving it some function which has all these LLM operations under the hood, and you're giving it a list of LLMs, models to use as resorts. [22:28.400 --> 22:30.280] First resort, second resort, et cetera. [22:30.360 --> 22:42.560] If your first resort model hits an exception somewhere, maybe it didn't get the interface right, maybe it hit a rate limit, it's going to raise the exception and go to the second model in the list. [22:42.560 --> 22:45.300] Only when it gets through the whole list does it raise the exception further. [22:46.480 --> 22:52.600] So respond to error patterns real quick is just a back-off mechanism where you're going to retry with the same LLM instead. [22:52.600 --> 22:55.680] Some number of times, random delay each time. [22:56.980 --> 23:00.980] This is the robustness mechanism that we're most excited about. [23:01.140 --> 23:03.120] This is called parallel consensus. [23:03.220 --> 23:09.360] And the idea here is it's a super general wrapper that wraps around any Python call, remember. [23:10.720 --> 23:14.160] Pipelines and prompts, they all just look like Python function calls. [23:14.240 --> 23:16.280] So you're going to wrap parallel consensus around it. [23:16.280 --> 23:21.760] You're going to give it a list of LLMs and a number of each to instantiate. [23:21.940 --> 23:26.020] It's going to go and run the LLM operation on all of those in parallel. [23:26.540 --> 23:30.340] Then it's going to come back with this list of outputs from each one. [23:30.500 --> 23:33.620] Some of them may not come back, rate limits, whatever, it doesn't matter. [23:34.580 --> 23:35.520] That's okay. [23:35.640 --> 23:36.900] You get this list of outputs. [23:36.900 --> 23:39.120] And then this consensus stage is just... [23:39.120 --> 23:43.220] the whole job is to just pick the most representative output from the list. [23:43.500 --> 23:45.560] And the key things, there are three key things to notice here. [23:45.560 --> 23:46.440] I have too many call-outs. [23:46.440 --> 23:49.700] But the three things to notice are super general wrapper. [23:50.420 --> 23:52.860] The output can be any data structure. [23:52.860 --> 23:54.180] It does not have to be a string. [23:54.280 --> 23:59.040] It just needs to be castable to a string so that you can present it to the LLM meaningfully. [23:59.040 --> 24:02.040] But the LLM is going to pick... [24:02.700 --> 24:09.460] which looks like picking an index and it's going to index into that list of output data structures and give you that corresponding output. [24:10.220 --> 24:20.440] And the other thing to notice is this consensus stage does not need to know anything about the inputs to the LLM operations or the nature of the LLM operations. [24:20.480 --> 24:22.200] This is part of what makes it so general. [24:22.200 --> 24:24.640] You can wrap an arbitrarily complex pipeline. [24:24.740 --> 24:26.400] It only cares about the outputs. [24:26.400 --> 24:30.300] So it's very predictable what the inputs to the second stage are going to be. [24:32.060 --> 24:35.840] This is where we use parallel consensus in La Crosse. [24:35.840 --> 24:42.300] Anywhere you want to trade money for robustness in high stakes, moderately difficult, empirically inconsistent modules. [24:42.580 --> 24:48.740] And I say empirically inconsistent because it's going to allow common good answers to crowd out rare bad answers. [24:48.740 --> 24:50.980] In other words, most hallucinations. [24:52.360 --> 24:54.400] Now, we also use a unanimous consensus... [24:54.400 --> 24:55.120] Oh, sorry. [24:55.120 --> 25:01.240] And that we use around our identify vulnerability stage which can cause problems if it goes off the rails. [25:01.260 --> 25:04.660] We were seeing that in maybe 5-10% of cases. [25:07.200 --> 25:19.560] We have a unanimous consensus variant that's used with these yes or no questions and that was really a play against rate limits because these questions are pretty easy to get for a less performant model which we don't use in many other places. [25:19.560 --> 25:21.740] So outsource to a group of those first. [25:21.740 --> 25:23.640] As long as they're unanimous, move on. [25:23.640 --> 25:26.980] If they disagree, that's when you escalate to a more performant model. [25:27.920 --> 25:36.640] I'm excited about where to go with this which is allowing rare good answers to spread among the experts and crowd out common bad answers. [25:36.920 --> 25:41.580] But it's a more complicated thing, specifically how general it can be. [25:41.580 --> 25:48.360] I don't think it can be as general as parallel consensus because it needs to know about the nature of the operations in that case. [25:48.360 --> 25:50.660] It's hard to know what a smart answer is without knowing that. [25:51.040 --> 25:52.980] Okay, so, last of my slides. [25:52.980 --> 25:56.040] This is a glimpse at our pipeline testing framework. [25:56.040 --> 25:58.940] The viz for our internal pipeline testing. [25:59.160 --> 26:11.740] What you're seeing is along the x-axis here are different combinations that we tried of pipeline structures, input combinations, and the models. [26:11.980 --> 26:18.100] And on the y-axis, you're seeing the performance on the NGINX dataset that we got from the semifinals. [26:18.100 --> 26:21.640] Each color is a different challenge problem in the NGINX dataset. [26:21.640 --> 26:24.480] And the max score for each one is four points. [26:24.480 --> 26:26.620] Those blocks you're seeing. [26:27.020 --> 26:29.860] And those correspond to those same four stages I talked about before. [26:29.860 --> 26:31.020] Did the patch apply? [26:31.020 --> 26:32.440] Did the code build? [26:32.900 --> 26:36.300] Did it fix the POV and did it pass functionality tests? [26:36.580 --> 26:44.820] So we were seeing by the end here that this allowed us to hill climb on models, on pipeline structures, and also it allowed us to see what's complementary. [26:44.920 --> 26:50.780] So this allowed us to combine different elements of pipelines if they were good at different types of problems. [26:50.780 --> 26:52.720] It also motivated parallel consensus. [26:53.520 --> 27:02.240] And by the end, we were seeing consistently 12 to 13 of these 14 NGINX problems nailed by the system. [27:03.200 --> 27:04.820] So let's see, I think that's all I got.