Skip to main content Skip to secondary navigation
Main content start

The future of AI and the legal field

A law professor and self-taught expert in natural language processing tells how he uses large language models to explore and improve AI’s increasingly impressive legal skills.
Scales of justice on a blue and green binary background
Can AI help us study contract design, algorithmic fairness, and legal reasoning to make legal systems more transparent and equitable? | iStock/iweta0077

Law professor Julian Nyarko has drawn attention for his studies using large language models to investigate and improve legal education and explore AI’s biases. 

He hopes AI can become a reliable, always-on legal learning and assistance tool to lower costs and expand access to legal services. In one recent study, he asked a group of law professors to evaluate written answers to student questions. Three-quarters of the time, the professors preferred AI-generated answers to those of their human colleagues. “AI is good at law,” Nyarko says, the challenge now is to use it most effectively, he tells host Russ Altman in this episode of Stanford Engineering’s The Future of Everything podcast.

Listen on your favorite podcast platform:

Transcript

[00:00:00] Russ Altman: This is Stanford Engineering's The Future of Everything, and I'm your host, Russ Altman. Since we started this show eight years ago, it's become an archive of amazing and impactful work by my Stanford colleagues. Research is not something that just happens in the lab, and as you'll hear on this show, the research at Stanford can impact areas like health, technology, law, and business, and many other topics that can affect everyday life.

[00:00:23] We hope you'll tune in to learn more about how research has the potential to help your life and to help the lives of people you care about in your family and your community. 

[00:00:32] Julian Nyarko: So the lab has four pillars. One pillar is evaluation. Evaluation is an interesting one, so it harkens back to this question of, you know, what is actual, what actually works.

[00:00:41] Russ Altman: Yep. 

[00:00:42] Julian Nyarko: And, in law it's so interesting because I think the evaluation pillar raises very fundamental questions about, what good lawyering is. Because, now that we have AI, you know, and AI can write a contract for us, we gotta know what kind of contract we want it to write for us.

[00:01:06] Russ Altman: This is Stanford Engineering's The Future of Everything, and I'm your host, Russ Altman. You know what? You're listening to the podcast right now. Why don't you just press the follow button so you're always alerted to new episodes? That'll guarantee that you never miss the future of anything. 

[00:01:20] Today, Julian Nyarko will tell us that AI is pretty good at law. The question is, how do we best use it to decrease costs and increase justice? It's the future of AI in the law. 

[00:01:35] Before we get started, we're continuing our feature at the very end, where I'm gonna ask Julian some rapid fire questions. He's gonna give me some rapid answers, and we're gonna call that the future in a minute. Also, a reminder before we get started to press that follow button so you're always alerted to the new episodes

[00:01:58] Well, AI is everywhere, and there's a lot of hopes that it's gonna improve many parts of our society. One of the great areas of application is AI in the law. Can we use AI to reduce the cost of legal services, make them more accessible, and increase justice in the world? Well, Professor Julian Nyarko from Stanford Law School at Stanford University is a lawyer, and he's also a social science researcher who is evaluating the ways in which AI can be used to improve access to legal services and improve legal education 

[00:02:31] Julian, how did you decide to focus your research on the ways that AI can be used both in teaching law and in delivering legal services?

[00:02:41] Julian Nyarko: Yeah, Russ, so that's, that's a, pretty big question for me in my case. So actually, started with, natural language processing a little bit before, you know, before AI became cool, as I say. So basically, when I was a PhD student, I was interested in contracts and, for my, job market paper, I, had access to the SEC EDGAR database.

[00:03:07] So, the Securities and Exchange Commission, they, require publicly registered companies to submit so-called material contracts, and I was interested in studying these contracts. So I had, you know, half a million contracts in front of me back then. And I said, "What can I do?" Because, you know, even though PhD student time is, is not always valued that much, it would have had to have taken too long to actually go through everything manually.

[00:03:34] And so, at that point I thought, you know, "What kind of methodologies are out there?" And, I came in, in touch with NLP, natural language processing. and, that was sort of the first time I dipped my toe into AI. I always had sort of an empirical background. I was doing empirical legal work. but, yeah, from then on it just compounded and as you know, you know, large language models took off a couple of years later. So this was all around 2018. And then, you know, five years later, we now have language models. 

[00:04:07] And, so, I, I, I just from an early point, I saw how, transformational really, these types of methodologies can be for, you know, legal research, and also then increasingly legal practice. But what was very interesting was that as sort of the hype picked up around AI, everyone was excited in the legal domain, but most people didn't really know what worked, right?

[00:04:33] We, we just took whatever worked in the general language domain, and we applied it to law. But, you know, do these things really work, what kind of tweaks do we have to make, were, questions that came up time and time and again, as you were talking to, you know, people in Silicon Valley and, you know, people at law schools. And that really sort of piqued my most current interest, which is, you know, really looking at how, large language model technology, can be adapted for the legal services sector. 

[00:05:03] Russ Altman: Did you come in with a, a strong, like, computer science background as a youth, or is this something that you've adopted mostly from the, kind of perspective of a practitioner lawyer, law professor, who then is trying to figure out how can we use these tools?

[00:05:18] Julian Nyarko: Yeah, my, my path was pretty, unusual overall. So I studied law in Germany, and in Germany, you, which is different from the US, law is a, a combined undergraduate graduate degree. 

[00:05:32] Russ Altman: Yeah. 

[00:05:32] Julian Nyarko: So you never do something other than law, basically at, in, at a university. Whereas, you know, the students I teach now, they have backgrounds in economics or in political science.

[00:05:41] But in Germany, if you're a German lawyer, you really don't know much about anything. You have never seen an equation maybe other than in high school, right? But after high school you never see an equation again. But I, I was fortunate enough that my program back in Germany had, law and economics as a discipline, and that got me really interested into, in, sort of using economic and statistical methodologies- 

[00:06:04] Russ Altman: Yes

[00:06:05] Julian Nyarko: in law. And so my PhD then was at Berkeley Law called jurisprudence and social policy. It's basically a PhD where you do law and. And my focus was law and economics, and I, you know, I, got, I, I would say good methodological training in empirical economics and statistics and so on and so forth. But no computer science background. So, this was all basically picked up, and largely self-taught when I sort of approached this project that I mentioned from my job talk paper in around 2018. 

[00:06:39] Yeah. And, but, what, what I find fascinating about computer science is which increasingly is, is, is true for other fields as well. But computer science has always been a very accessible field, I think, as long as you were able to code, which is something you, you know, for a large part you don't even need to do, be able to do, these days. But, as long as you're able to code, you're, you know, most of the conversation always happened online and, you 

[00:07:07] Russ Altman: Yep

[00:07:07] Julian Nyarko: You were able to plug yourself in and really sort of, you know, copy someone's script and then alter it to your taste and so on and so forth. And, so it's really a nice discipline for, you know, self-teaching the material, whereas in many other fields it's a little bit harder. 

[00:07:23] Russ Altman: So, so somebody, looking at your website might be surprised to know that you lead a lab. I don't think, I don't know that law professors are always thought of as having a lab. But tell me a little bit about the LIFT Lab and what's its, what's its reason for existence and what, what kind of questions do you ask in this lab? 

[00:07:40] Julian Nyarko: Yeah. So first of all, I think your intuition is exactly right. So in, in law we don't really have labs, and I think one of the primary reasons is that we typically don't have PhD, programs at law schools, right? We are a professional school and, there are a couple of exceptions out there. but for the most part, PhD students, post-docs are what keeps a lab going. And so, in law we don't have that, so most professors just don't have labs. 

[00:08:05] Russ Altman: Right. 

[00:08:05] Julian Nyarko: But, you know, the more you are sort of in the CS world, right, I think it's just a very good way of, increasing your productivity, right? And so, yeah, it, it, it requires a lot of creative thinking about how to staff that lab 

[00:08:20] Russ Altman: Yes 

[00:08:21] Julian Nyarko: you know, lab members and, sometimes PhD students from other programs and so on and so forth. But the origin of this lab was really, yeah, so the previously mentioned sort of conversations we had, everyone's interested in AI for the legal services sector and how lawyers would use AI. But, it's very difficult for people to, you know, really know what, what works.

[00:08:43] Russ Altman: Yeah. 

[00:08:44] Julian Nyarko: And, so we, thought that, so this is together with my, executive director, Megan Ma, who's also involved in research. we, we, we got together, one year ago, one and a half years ago, and sort of thought, "Okay, can we make a more concentrated research effort?" And that gave sort of rise to this idea of the lab.

[00:09:06] And, you know, I think, so the lab has four pillars. I'll keep it short for now. one pillar is evaluation. evaluation is an interesting one, so it harkens back to this question of, you know, what is what actually works. 

[00:09:21] Russ Altman: Yep. 

[00:09:21] Julian Nyarko: And, in law it's so interesting because I think the evaluation pillar raises very fundamental questions about, what good lawyering is.

[00:09:31] Because now that we have AI, you know, and AI can write a contract for us, we got to know what kind of contract we wanted to write for us, right? 

[00:09:39] Russ Altman: Yeah. 

[00:09:40] Julian Nyarko: And there are different types of contracts out there, and presumably we wanted to write a good contract, and now we are faced with the question, how do we even define what a good contract is?

[00:09:49] And it turns out, you know, I'm teaching contracts, and it turns out at the end of a full quarter of teaching contracts, we don't have an answer to that question, in part because no one has an answer to that question, right? And so when you're thinking about how do you do evaluation in law, you're really thinking about, how do I want, want to measure the quality of legal services? What good legal services are? Do I want a rubric? Do I want to do what's called pairwise preference ranks, where I show two examples and I have lawyers, you know, pick out which one they prefer and so on. And so, this is an extremely exciting pillar to me. 

[00:10:22] The second one is, AI to improve the quality of legal services. So, many AI applications are really about helping lawyers do what they always did, but faster, less error-prone and so on. Which is all well and good, but from a research perspective, I think what's exciting is can we leverage this technology to actually, for instance, produce information for lawyers that otherwise would not be available. To help them make better decisions, to help them use their judgment in a more efficient way.

[00:10:57] Third pillar is legal education. Where we are asking, how, you know, this technology can be used in order to improve legal education because, you know, in part the big question that, everyone has in, in the legal sphere and in many other sort of services sectors is, you know, now that AI can do many of the, much of the grunt work, right, how do we train the next generation of lawyers, to develop judgment, to develop, you know, all these strategic thinking skills and so on and so forth. 

[00:11:27] And then the fourth pillar is sort of a grab bag, we call it, methods, where we are, you know, looking at how can we tweak existing methodology, how do we need to tweak it in order to make it work for the, legal sector.

[00:11:41] Russ Altman: Great. And so LIFT just for, The LIFT Lab stands for Legal Innovation Through Frontier Technology, Lab. So, very good. 

[00:11:50] Julian Nyarko: And we don't need anyone to remember that. LIFT Lab. 

[00:11:51] Russ Altman: Very good. Yes. So, so, one recent study that came out that you, that I've heard you speak about, which is just fascinating, and it actually seems to me that it, it definitely hits legal education, but it also hits evaluation, although you get to, you get to tell me if that's right or wrong, is a really interesting study that you did on, on AI's ability to, answer hard questions kind of in a in the setting of an office hour, where a student might come to a a law professor and say, "Hey, thanks for that lecture. I had some questions." And, can you just tell us about that study and what you found at, at a high level? Because it... I think people found it surprising, and it's gotten a fair amount of attention. 

[00:12:31] Julian Nyarko: Yeah, sure. So this study, the background of this study was that, when I teach contracts, two years ago I made a contracts tutor, AI tutor available for students. But back then tutors were not really... AI was not really, you know, that good. It was pretty good, but not great. And so we constantly had to monitor what students, how students interact with the AI, and then we had to intervene if the AI would make a mistake. And that's not scalable, clearly. 

[00:12:58] Russ Altman: Right. 

[00:12:58] Julian Nyarko: And so, I thought, can we, you know, have a, a more rigorous evaluation of newer models? And so, in the summer of 2025, I reached out to, 16 law professors, or a greater number, but 16 ultimately agreed to participate- 

[00:13:17] Russ Altman: Yes 

[00:13:17] Julian Nyarko: ... in the study. Everyone uses the same casebook, which is important in law, so everyone kind of approaches the contract material the same way. And, we did a three-part, three-step study with them.

[00:13:28] In the first step, as you as, as you just highlighted, we asked them to come up with 40 questions that students would ask them in office hours or after class. Step two, we asked them to answer each other's questions. And then in step three, we would do these pairwise preference ranks, meaning we show, a, a law professor, two answers to a question, and then, they have to pick the one they prefer. And, one of those two questions, answers that they saw was LLM generated. This was summer 2025, so it was Gemini 2.5 Pro and Notebook LM, which runs on Gemini 2.5 Pro, but has retrieval augmented generation, so it can draw from the actual casebook. 

[00:14:12] Russ Altman: Yes. 

[00:14:13] Julian Nyarko: And so we, yeah, we compared basically the win rate and the, had to implicitly estimate the strength of the different instructors and the models. And what we found was that, the, the models were on par with the very best instructor who participated in this study out, out of the 16 

[00:14:32] Russ Altman: So that certainly gets your attention. So let me, I'm gonna interrupt because I just wanna make sure I have this right. So, these are 16 law professors, and their, their answers that, to questions that they've made up, are being compared to answers that the LLM, the the Gemini, and when they're blinded and they're said, "This is either this could be a human or it could be..." Did they know that it was either human or AI, or did they not even know that there was necessarily an AI involved?

[00:15:00] Julian Nyarko: We, we did not tell them that there was. They, they, they knew, AI was in the study. 

[00:15:05] Russ Altman: Yeah 

[00:15:05] Julian Nyarko: ... but they didn't know whether one of the two was AI. 

[00:15:08] Russ Altman: Okay. 

[00:15:08] Julian Nyarko: In fact, some of the pairs included two AI models. 

[00:15:11] Russ Altman: Gotcha. Gotcha. And then to repeat what you said, they actually preferred the AI frequently. 

[00:15:18] Julian Nyarko: 75% of the time across all instructors, they preferred the AI answer over the instruct, professor-generated answer. And, a secondary outcome that was, quite interesting to us was we allowed them to flag when they would, when they considered an answer pedagogically harmful, which we defined as you would rather have the student not get any answer than this answer. And the instructors flagged each other's answers, forget the exact number, I think 10 or 12% of the time as pedagogically harmful, whereas LLM-generated answers on average were flagged 1 or 2%, low single digit percent of the time as harmful.

[00:15:59] Russ Altman: So I, I hope everyone can see why this would get a lot of attention because these are some of, you know, the most, these, these are great legal minds, I'm gonna just stipulate that. And, and they are, not impressed with each other, and they're actually a little bit more impressed with the AI. So what does this mean to you?

[00:16:16] So, you did this study. You had the reasons for doing it, which you actually recounted at the beginning. How well does it answer your questions, and what kind of conclusions do you draw? And I'm sure it raises a lot of other questions that you then wanna pursue. So how have you processed these results in terms of your own research agenda?

[00:16:34] Julian Nyarko: Yeah. So I, I try to be a careful empiricist, so I try to not extrapolate beyond what we can actually say, and so there are some important caveats here, right? Really, the scenario that I was interested in was, is it responsible to make AI tutors available to students so they can get correct answers? And I think the answer to this question is, if I would be comfortable to hire my, you know, Yale or Chicago law professor colleague as a, as a resource for students to answer questions, then I should also be comfortable having an AI contract tutor.

[00:17:09] We did not answer the question, whether, AI is good for student learning outcomes, right? 

[00:17:17] Russ Altman: Yeah. 

[00:17:17] Julian Nyarko: That is something, and, and, and in fact, we see conflicting evidence out there. Some of it suggests, you know, ... one, one of, one of, one of the, my favorite studies is one where they did a randomized controlled trial. They had students go through two tasks. The first one, the treated group had AI assistance in the first task, the control group didn't. And then in the second task they took it away from everyone. And what they found was that people who initially had AI assistance gave up sooner during the second task. And if they completed the second task, they did it worse. 

[00:17:51] Russ Altman: Oh. 

[00:17:52] Julian Nyarko: Right? We have a similar similarly designed study in law in in particular, and we can't find these negative effects. So probably it depends a lot on, you know, implementation details, but there certainly is a risk that if you have this resource that always gives you an answer to every question that you might have instantly, that you, you get

[00:18:10] You know, you, you lose the protect, productive struggle, right? 

[00:18:13] Russ Altman: Yes. 

[00:18:14] Julian Nyarko: And so, a longer term goal is to really see, you know, what are good ways of implementing the, this type of technology in order to help students learn better. What we also didn't answer was, you know, sort of some people suggested, "Oh, this means we don't need lawyers in the future," right?

[00:18:31] And this is certainly a discussion I'm willing to have, but our study has very little bearing on our beliefs about whether, you know, AI can automate what lawyers do, because answering specific contract law questions is very far from, you know, the day-to-day of what an attorney does in practice. 

[00:18:48] Russ Altman: If I can ask a a kind of a detailed question is, you know, I have office hours, and it's often not just a question and then my answer; it's an interaction. So, to what degree were the, were these questions and answers, interactive, or was it a one-shot question and one-shot answer? And, and does that also in some way limit what you can say? 

[00:19:09] Because, in especially in terms of the student learning, usually there's a, a misconception. We have to clarify why the question, how to ask the question, why the question is good, and so the ... it's almost a negotiation with the student to understand exactly what they want, what, where they're falling short in terms of their knowledge base. So, what can we say about that, if anything, from this study? 

[00:19:32] Julian Nyarko: Yeah, no, that's a good point. So we have, I think there's still many questions around how to exactly evaluate longer multi-turn conversations. 

[00:19:41] Russ Altman: Yeah. 

[00:19:42] Julian Nyarko: And, we set our study up as a single turn, so someone asks a question and the AI gives an answer. Now, I will say that some instructors did provide us with answers that are in dialogue form, dialogue form.

[00:19:57] Russ Altman: Oh. 

[00:19:57] Julian Nyarko: So they, they gave us answers in the Socratic style that said, "Here's what I would do first." You know, student, do you remember this concept from class?" And then walk them through. but, they were not rewarded, let's say, 

[00:20:12] Russ Altman: Yes 

[00:20:12] Julian Nyarko: ... in the, in the, in 

[00:20:14] Russ Altman: the rubric 

[00:20:15] Julian Nyarko: ... in the rubric. Yeah, exactly. well, so they were not rewarded by their other faculty colleagues for providing answers in this scaffolded sort of, interactive way. But really, yeah, we were, our study was not designed to exactly test that, which is another good point on why learning outcomes when interacting with a professor might actually be different. And really, you know, this is also, you know, another important aspect is really, I don't think this clearly shows or shows at all that, you know, it replaces professors. The, the, the, the thing we have in mind is, you know, it, it may be sort of a teaching assistant that's always available 

[00:20:53] Russ Altman: Right ... 

[00:20:53] Julian Nyarko: as an additional resource to sort of these more productive, engagements. 

[00:20:59] Russ Altman: This is The Future of Everything with Russ Altman, and I'm speaking with Julian Nyarko from Stanford University.

[00:21:03] We've been exploring Julian's work at the intersection of law and AI. He told us about a fascinating study where AI professors are about as good as human professors at asking questions that students ask in their contracts class. We're gonna move our discussion to the use of AI for social science research, and especially how fairness, bias, and equity can be addressed using the tools of AI.

[00:21:29] So Julian, what you do is kind of considered social science research. And I believe that you've talked about, kind of the special opportunities for social science research that AI offers, and I you just gave us one example in the previous segment. tell me a little bit more about how you think about this type of research and where AI fits in.

[00:21:50] Julian Nyarko: Yeah, definitely. So there's, sort of AI as the object of study, right, which the contract tutor, study falls in. But then AI can really also amplify, social scientific research, and to me this is extremely exciting. As you know, it all pretty much started, December, January of, of, of January of this year, December of last year, when Claude Code, became really good, to work with.

[00:22:21] And so it really helps, in implementing, you know, analyses. It sort of supercharges what, we as social scientists can do. And what I find particularly interesting is, you know, there's one aspect of it that is just, oh, we can write the papers. As social scientists, we can write the papers that we always wrote, but much faster, right?

[00:22:43] Because we can send Claude Code out to gather data and, you know, match different data sets and then do these statistical analyses and so on and so forth. what I'm particularly excited about these days is also thinking about how AI allows us to write papers that we couldn't write before, right? 

[00:23:01] And so, you know, just to give you an example, one, one piece that I'm particularly excited about is, going through legal scholarship. And what legal scholars sometimes do is they, you know, to set up their paper, they say, you know courts have increasingly considered doctrine XYZ, or they say, you know, scholarship has discussed topic X but does not, did, did not discuss topic Y, so my intervention is entirely new. And so, we have AI agents basically go through and automatically pull out these statements- 

[00:23:36] Russ Altman: Uh-huh

[00:23:37] Julian Nyarko: and then test them empirically to, to see whether they were correct at the time they were made. 

[00:23:42] Russ Altman: Oh, 'cause they might have been, they might have been using them as, what's the word? The, the, they, they're using them as, decoys almost, and it actually isn't true. And so, therefore, the basis and justification for the work is not quite as strong as they're letting on.

[00:23:56] Julian Nyarko: Exactly. And so, you know, the, the, the project is not just a gotcha, but really sort of, right, the, the idea is A, maybe we can sort of increase standards, but B is also maybe this is a useful tool for authors to, you know, check their own, preconceived notions of what the world actually looks like. Editors might use this, to check and verify claims, 

[00:24:18] Russ Altman: Yes 

[00:24:18] Julian Nyarko: ... are made in papers quite often, right? And so this is really, right, every claim, every individual claim has a research agent that has access to certain tools, scholarship, case law, the internet, and so on and so forth, and then examines that, right? And, those are projects, right, we're still sort of at the early stages, but those are projects that would definitely not have been possible without AI, at least not at scale, right? And, they can sort of really, you know, make investigations, possible that previously were not possible. 

[00:24:51] More generally, I'm, my, my, my project is currently to also center the work at the lab a lot around agentic AI to to basically assist us at the lab, as much as possible when it comes, you know, to, think about ideas and so on and so forth. So, for instance, every new project I start, I now have certain research skills, and I engage in a one to two-hour conversation, Socratic dialogue with Claude Code. 

[00:25:20] Russ Altman: Yep 

[00:25:20] Julian Nyarko: Which I think is a really helpful process to, you know, sharpen research ideas and make them, put more structure around them. Basically, in empirical projects, it surfaces the types of questions early that usually come up later in the project, and so front-loading much of that is, is a really helpful experience.

[00:25:41] Russ Altman: Yeah, I've been doing the exact same thing in an entirely different area, and I think our colleagues all over are starting to use this. It's like before you have the first conversation with a human colleague, you can deeply practice your arguments and your approach with, with the AI, so that when you do have the conversation with the, with the human colleagues, it's a much more nuanced kind of high-quality interaction.

[00:26:06] Julian Nyarko: That's exactly right. Yep. 

[00:26:07] Russ Altman: So, so you've done, you've done a lot of work on fairness and bias. You did that separate from a computation, and now you're looking at, the ways in which computation can either alleviate that or, or, or exacerbate it. So how, what is the approach of the lab towards these types of projects?

[00:26:27] Julian Nyarko: Yeah. So, you know, to, to take a step back, I think, there's a; so, so first of all, I, I think, the interesting interactions are both auditing, computational tools, right? If we have, tools that automate, let's say, detention decisions or automate, allocation of healthcare resources or or something. There are definitely interesting questions to be raised about, whether these tools are fair.

[00:26:53] But then also there are some interesting applications that can actually use these computational methods to audit human decision-making. And 

[00:27:01] Russ Altman: Yeah 

[00:27:01] ... we can 

[00:27:01] Julian Nyarko: talk more about this. But there are sort of two different lenses. I would say at a high level, much of the work, that we're interested in is, so, in law when you're thinking about anti-discrimination law, there, there are two notions of bias. One is called disparate treatment, which, you know, in a nutshell means you're treating someone differently because of their protected characteristic like race or gender. And we've done some studies. 

[00:27:29] So, for instance, we've done auditing studies where we go to large language models and we say, "Hey, I want to buy a car from Jamal Washington. how much should I offer? And then I want to buy a car from Peter Smith. How much should I offer?" The implication being that Jamal Washington signals, racial minority status, whereas Peter Smith does not.

[00:27:51] And what we found, this was two years ago, I think, was that, you know, basic, it's almost ubiquitous among the frontier models that they suggest offering a lower price to Jamal Washington than to Peter Smith And here, right, I compare the response of the models across two strings and, I can say that the only difference is the name, so I can make the causal statement that the name, is responsible for the disparity that we see.

[00:28:18] Russ Altman: Yeah. 

[00:28:19] Julian Nyarko: So in, in a follow-on project, we then used model editing, to see whether we can basically prune out certain neurons in the model to reduce the disparity without hurting the utility. And the conceptual question that is interesting- 

[00:28:31] Russ Altman: Ah 

[00:28:31] Julian Nyarko: ... here is, you know, is it the case; so, so when we see that the models act with disparities across different sectors, let's say, you know, financial decisions and, job hiring decisions and product sale decisions. Is it the case that the same neurons within the model are responsible for this? So they're basically these disparity neurons.

[00:28:54] Russ Altman: Right. Right. 

[00:28:55] Julian Nyarko: Or it's, is, racial disparity and gender disparity sort of a 

[00:29:00] context, 

[00:29:01] Julian Nyarko: represented in the models in a context-specific way, in a domain-specific way, such that if I want to prune bias out of the models in finance, those are actually different neurons.

[00:29:12] Russ Altman: Right. So it'd be a lot more work in the, in the second case where it's, my phrase not yours, distributed racism, for example, it's harder to get the model to stop doing that, versus if it has a single locus where you can kind of do surgery to fix things. 

[00:29:28] Julian Nyarko: Yeah. And it's also, especially interesting for this question of regulation, right?

[00:29:33] If it's, if, if you really have some bias neurons, then we can go to the Anthropics and the OpenAIs of the world, and we can say, you know, "Make your models safe no matter what the downstream deployment is." But if it's really context specific, right, then we definitely also have to look at the deployment layer because, you know, it's almost impossible for, the model developer to foresee every downstream use of their models, right? And so, it might inform some of this regulatory question. 

[00:30:00] And what we found in that study was that roughly 50%, of the bias that we found, you know, defined in this narrow way is context invariant, and then the other 50% are really highly context dependent. 

[00:30:14] Russ Altman: Ah. 

[00:30:16] Julian Nyarko: So this is all disparate treatment, but then part of the intellectual, effort here is also to really emphasize this notion of disparate impact that exists, which, you know, again in a nutshell says, you, you treat, you, you know, you have a decision-making process that ultimately disadvantages minorities, and you cannot really justify it with the goal you're after.

[00:30:41] So to give an example, if I, you know, I'm Meta and I wanna hire a software engineer, and I say, "You need an engineering degree for this," I disproportionately exclude minorities because minorities are less likely, at least, African American minorities in the US are less likely to have a engineering degree, than other groups. However, there is a justification in this case because, you know, you need some certain technical knowledge and so on and so forth, right? 

[00:31:11] Russ Altman: Yeah. 

[00:31:11] Julian Nyarko: Or at least potentially a justification. But it turns out there are many practices out there where the actors might not even be, you know, might not have ill intent, but, it turns out that, you know, say, you know, one study that my colleague did is from the National Police Department. Police stops, citizens for minor traffic infractions, and the argument was, you know, sort of a broken glass argument. If I, if we stop them for minor traffic infractions, this prevents more violent crime But it turns out that people who were stopped for minor traffic infractions were disproportionately minorities.

[00:31:51] And so what they did is to say, "Okay, let's actually investigate whether these minor traffic stopping for minor traffic infractions reduces violent crime," right? And they found no evidence of that. And so this is an example of a policy that is inherently well-meaning- 

[00:32:07] Russ Altman: Yeah. 

[00:32:07] Julian Nyarko: Maybe, right? But, you know, many of the models we hold in our heads are not actually bearing out in reality, and the minorities might be the ones who are sort of carrying the burden, right? And so, much of that project is to highlight, and measurable and surface sort of these disparities in the sense of disparate impact, which are not always illegal, right? But from a normative perspective, I find it to be the case that, you know, you have a policy out there, it's not really effective, and minorities are the ones, you know, who are damaged by that policy.

[00:32:43] You might wanna change, think about a change- 

[00:32:44] Russ Altman: Right 

[00:32:44] Julian Nyarko: ... in the policy, right? I feel 

[00:32:46] Russ Altman: Right 

[00:32:46] Julian Nyarko: ... this is normatively not very controversial, even if it's not, illegal necessarily because 

[00:32:53] Russ Altman: So, so I think this leads-- We're, we're, we're, we're running low on time, but it does lead to, my final question, which is you mentioned, in your example just now, you, you, you referred to policymakers, and a couple of minutes ago you also referred to, like, you might wanna go to Anthropic and suggest, you know, something.

[00:33:09] So how are, is the work of your lab, how successful have you been or do you anticipate being in actually moving the levers of people like policymakers or frontier, LLM companies? Is that part of your agenda? It, it sounds like it's gonna be hard, but I guess if your evidence is strong, they might listen and they might actually do some of these things. So do you have any preliminary evidence or instincts about how that's gonna go? 

[00:33:34] Julian Nyarko: Oh, that's a, yeah, that's a, that's a, that's a tough one. So I do think, so only part of the work of our lab is sort of aimed at regulation- Yeah ... and, you know, much of it is really AI for the legal services sector. But I would say it's, it's, it's, it's, it's a difficult question how to measure impact, but we do, you know, we do work with stakeholders.

[00:33:58] So for one of the projects, for instance, we're working with courts in our partner jurisdictions to assess disparities in the, detention pipeline and, you know, the, the consequences of that were, that, that, were very concrete because now they know that there's a potential source of disparities, and they can think about how to address that.

[00:34:20] Beyond this, you know, it's, it's, it's sometimes difficult to measure impact. ,So for instance, our auditing study, right, I do think was one of the early auditing studies in the field, but, you know, there are now many other auditing studies, of a similar type, and so which ones actually move the needle and, you know, have OpenAI and to adopt their own name-based discrimination study, hard to measure. But, yeah, it's certainly our, our hope that we're actually moving the conversation forward and, making a dent. 

[00:34:49] Russ Altman: Yeah. That's, that's great, and, and good evidence can lead to, compelling, compelling arguments. Well, before we finish up, I wanted to, do our long promised, future in a minute. So I wanted to ask if you're ready for my five questions.

[00:35:04] Julian Nyarko: I am ready, Russ. 

[00:35:05] Russ Altman: Okay. What is one thing that gives you the most hope about the future? 

[00:35:11] Julian Nyarko: So I think that, AI has the potential to very significantly drive down the cost of legal services, which could then in turn, increase the access to justice. 

[00:35:23] Russ Altman: What's one thing you want people to walk away from this episode remembering?

[00:35:28] Julian Nyarko: I think AI is good at doing law, and I think the interesting questions for us in the future will be to figure out how to use it most effectively, not so much whether it can do much of the tasks that we would like it to do. 

[00:35:46] Russ Altman: Aside from money, what is the one thing you need to succeed in your research?

[00:35:51] Julian Nyarko: Talent. We, we talked a little bit about the difficulties of having a lab at the law school, and so really getting good people involved who are interested in the project is the thing that we benefit most from. 

[00:36:04] Russ Altman: If all goes well, what does the future look like? 

[00:36:06] Julian Nyarko: Going back to my early answer, I think greater access to justice, really.

[00:36:10] we are driving down the cost, and everyone has access to high quality legal services for limited amounts of money. 

[00:36:18] Russ Altman: And if you were starting over again and you needed to get your certification or degree in a different discipline, what would it be? 

[00:36:25] Julian Nyarko: So the, the easy answer to that question is probably something like statistics, which is a little bit close to what I got my degree in.

[00:36:34] Yeah, but, but a, a, a totally different answer would probably be medicine. What I do think is interesting is that both law and medicine are sort of high expertise, high judgment domains. And in medicine, I think the positive impact on the world is more easily measurable and quite tangible, and so that is something that would probably excite me a lot as well.

[00:36:57] Russ Altman: Thanks to Julian Nyarko. That was the future of AI and the law. Thank you for listening to The Future of Everything. And don't forget that we have a back catalog with more than 300 episodes, so you can spend a lot of time listening to the future of just about anything. I'd like to remind you that if you're enjoying the show, just share it with your friends, family, and loved ones because that'll grow the show, it'll increase our audience, and it'll help us spread the news about The Future of Everything.

[00:37:23] You can connect with me on many social media platforms, including LinkedIn, Threads, Bluesky, and Mastodon, where I'm @RussBAltman or @RBAltman. And also you can follow the Stanford School of Engineering @StanfordSchoolOfEngineering or @StanfordENG.