From the event: Mindstone London October AI MeetupControlling AI: Emerging Approaches to Making It Follow Your Rules
View event

Controlling AI: Emerging Approaches to Making It Follow Your Rules

I'm Maury Schenk. I'm CEO and co -founder of Ordinary Wisdom.

We control large language models according to human values, including policies, regulatory requirements in financial services and other regulated industries.

I'm not going to talk today about the business. I'm going to talk about the tech.

Why Controlling LLMs Matters

Before I start into the meat of the presentation, I'd like to say three things about past, present and future. About past, until ChatGPT came along in late 2022, we didn't really talk about controlling AI.

There were instances, I recall one in particular, where Google developed a great classifier for eye lesions that worked great in the lab, but didn't work when it got out into the hospital.

But that wasn't a lack, people didn't think about that as lack of control. They thought about the AI not working. This idea that it can get out of our control is really something that has come along with generative AI.

And so there's AI in the title of my talk, but i'm going to be talking about large language models and so in the present controlling large language models i just want to say that this talk is for builders i hope it will be interesting to all of you but the techniques that i'm talking about today are things that you would use if you were building an ai application if you want to control your own llm there are some pretty good techniques about prompting it well and using some of the tools that the llm providers make available They're not as good as the tools that I'm talking about today, but they're a lot easier to use.

And then in terms of the future, LLMs have problems, which I'm going to talk about. There are people who are coming up with alternatives to LLMs. People like Yann LeCun and Ilya Setskever have been important in the history of AI, have founded well -funded businesses to replace LLMs. I'm also not looking at that.

LLMs are the dominant paradigm. They're incredibly powerful. They have big problems, but the thesis of this talk is we can use them if we know how to control them So diving into the details

Why Large Language Models Are Hard to Control

LLMs are hard to control and the reasons that they are hard to control Well, they're unpredictable. They you know, the same question can get different answers and among other things that's because their next word predictors and

They there's a thermometer there. They have a parameter called temperature which is meant to to indicate how likely it is that the LLM will pick the most likely next word, and sometimes they do, sometimes they don't, although if you set the temperature to zero, most LLMs will be quite predictable.

That behavior we call stochastic, it's random, and they're also autoregressive, which means each next word goes through that process, and if you give an answer that's hundreds or thousands of words long, there's a bit of a butterfly fly effect. It can take very unusual directions, hallucinations, although often the answers are quite good and they're usually quite plausible.

LLMs are also black boxes. People know what the code is that was made to create them, but they are incredibly complex, over trillions of parameters now.

And there's been an effort to understand why LLMs do what they do called mechanistic interpretability. Anthropic has done a lot about it, of that, and it really hasn't gotten that far.

Although, in the last week, there has been a blog that people have been paying a lot of attention to by a guy called Nick Camerota at Goodfire, where he says, agents are going to figure that out. Others are skeptical. I'm personally skeptical, although I still need to read the whole thing carefully.

There is, at present, no standard fix for these problems. I've got the MIT AI Risk Initiative there, which is something I participated in, and And they got a list of about over 1 ,000 papers setting out principles from responsible AI.

The trouble is those principles need to be translated into code. And turning principles into code is not easy.

Two Paths to Better Control

But there are solutions. And there are basically two kinds of solutions. You can retrain an LLM to make it more predictable, or you can put guardrails around it.

And the rest of my presentation is going to be talking about details of those two kinds of solutions.

Retraining and Fine-Tuning Models

Now retraining the LLM means changing the model weights with fine -tuning or other technologies. It is a very good technique, particularly for small models for specific tasks.

For bigger models, they are evolving so fast that you don't want to fine -tune on general tasks because the big labs are going to come out with a better model soon anyhow.

And even doing it for small models is fairly expensive. In terms of both data and compute, I would say more in terms of data. You've got to have lots of data points that are relevant to the particular area in which you want to improve the LLM's performance, and so that's expensive.

It's also of limited applicability because it only works on open weight models. If you want to change the weights, you need access to the weights, and it must be redone for every new version of the model that comes out. If I fine -tune a version of ChatGPT 5 .1 when 6 .0 comes out, the weights are completely different and so you have to go back to scratch.

But it's a valuable thing to do and I'm going to talk briefly about some of the methods, a little bit of the surface tech of some of the methods that are doing for adjusting weight.

Methods for Adjusting Model Weights

So I mentioned fine -tuning. Fine -tuning means getting the LLM more accurate in a specific domain. And the way you do that is you have lots of data points in that domain.

Like if it's about health answers, then you have questions about health and model answers about health. Those can be answers from humans. They can be answers prepared by LLMs synthetically. and there's some problems with that feedback, but you can make the LLM better, subject to the problems I mentioned.

Reinforcement learning means you set a goal for the LLM. This is also a very powerful tool. The original DeepMind success on Atari games used reinforcement learning,

an algorithm called DQN, and a lot of the success on coding and math now is about reinforcement learning because you can set a very specific goal about getting the code right or getting the math problem answered and this includes reinforcement learning for human feedback RLHF which is what made ChatGPT work initially where the humans set the goals and then the model was trained to those goals and reinforcement learning for AI feedback which is the same thing but the AI gives the feedback.

This starts to get into the tech but one of the reasons why it's expensive to retrain is because you got to retrain all the weights, low rank adaptation, I'm not going to talk in detail about that, but that is a way that you can retrain two matrices of much lower dimension than all of the weights and it can save a lot of the expense, but you still need all the data.

And steering vectors is another thing that I believe holds some promise for changing weights where you do comparative analysis of LLMs of two models on a series of runs, say for friendliness, and you look at the weight activations for friendly versus unfriendly situations, and you can come up with a vector that's like a friendliness vector and insert it into an LLM, and it should behave in a more friendly manner.

That's the surface of some of those things and it's and i don't know them as well as what i'm about to tell you because this is

Guardrails Around the Model

what we do at ordinary wisdom we put guard rails around the llm and the benefit of that is you can put any llm inside that the llm changes the same guard rails still work maybe not identically because the guard where rails will respond differently with different llms but it's a it's a powerful technique for that reason this um x post by satya nadela was about about 10 days ago

was really interesting on this point. He was talking about the risks of LLMs. And he made the point that if you want to reliably control an LLM,

the controls cannot be inside the LLM because then it's still the LLM and you need to wrap something around it. So I personally am very enthusiastic

about this approach of guardrails around the LLM. And they fall into one of two categories. stories, before generation and after generation, what goes in, and then looking at what comes out and adjusting it.

And my last slide and my most detailed slide will be some examples of that. As it says in the subtitle there, this works with any model or version of that model and it and it needs a lot less data than fine tuning so my last slide about technical

Controls Before Generation

methods for guard rails this is the book the before and i've added feed forward there meaning

that you're feeding the the controls into the llm there are two big techniques that we use and they're fairly widely used retrieval augmented generation where you have a corpus of documents that provide reference data for the large language model. And through use of embeddings, which I can explain more if you talk to me after, you choose the bits of the corpus that are most relevant to the prompt. And then that gets fed into the prompt window before the LLM is asked to answer. So you type in the prompt, you add in the data, and then you send that to the LLM.

second feed forward method is a system prompt we call it a constitution in error in what we do which is basically give the LLM a set of instructions on how it should behave according to who it is what values it has what it shouldn't do how it should answer things like that basically you can tell it how to behave and this is quite powerful because LLMs they're language models and and they respond to instructions in language. And we've known, you know, early on, think it through was a good instruction to give an LLM. Most of them have figured that out now, but you can give much more detailed instructions.

Feedback and Controls After Generation

Feedback, so this is after the LLM has generated stuff, what can you do to control it?

Evaluations, we, a common method of evaluations is what's called LLM as a judge, which is you just ask the same or another LLM to evaluate how it's done, and it gives an answer.

There is a new method called JEV, or a decision -only model, which is rather than asking the LLM to explain how well it's done on a particular criterion, you pass to the LLM a little test of how it's done, and it's much, much more efficient. You've got to write all the tests, so that takes time, but it's a really powerful new method.

Jev is a company that introduced this, it just got investment at a seven or eight billion valuation, brand new company, but it's a very powerful idea.

There are various methods for hallucination detection. We use some of them and some of it's proprietary, I'm not going to go into that, but there are are good methods for detecting and reducing hallucinations. And we tell our customers about what we're doing on that.

Output filtering is another important method, which is run pre -generative technology classifiers against the outputs and say, is this about nuclear weapons? Is it about bio weapons? Is it about child pornography? And you can, I mean, Anthropic, and I think everybody else, but I listened to Dario talk about this. They run, they spend a certain amount of compute at inference on classifiers just to make sure that the LLMs aren't spitting out improper stuff.

And then finally, output tracing to the inputs. This is one where, another one where we have some very exciting proprietary technology. And I am not going to go into all the details of that, but a simple version of this, you can think about what perplexity does. Perplexity was the first widely distributed LLM that would spit out sources regularly with things. Having the sources gives you some additional confidence in the output.

There are much more sophisticated things that we can do now. We in particular can do very sophisticated things with that, which I'm not going to talk about in public at this point, but it's exciting.

Putting LLM Controls Into Practice

And then my final box is just some of the implementations of this stuff. Agentic harnesses have some good control methods, so OpenClaw or other harnesses have ways that they they can remember stuff about you.

It doesn't do all the things that we do at Ordinary Wisdom, but it's very powerful and probably the most common control question I get is, could we do this ourselves? And yeah, you could do some of this stuff.

If you're a good developer, you know how to set up an agent. You can do some of the stuff that we do yourself with an agentic harness.

The hyperscalers and others make available libraries for controls of LLMs, reducing harmful inputs and things like that. You can get those on Google Cloud Platform. It's called Model Armor.

Amazon Web Services has some. NVIDIA has some. Others do. And then there are various open source tools that are coming out.

A Control Pipeline for Organizations

And to summarize what we're doing, we're doing a lot of these things. We're putting it together in a pipeline to try to do this for companies in in a way that is very effective, increasingly effective. We're a young company, but it will get better.

So that's fairly technical stuff. There's a lot more technical detail underlying each of these. I wanted to give some flavor of what the near cutting edge in these things is today, and hopefully that's interesting for people to hear, and I'd be happy to talk about it after.

Finished reading?