Intro0:00
Hey, everyone. Welcome to the Latent Space Podcast. This is Alessio, partner and CCO in residence at Decibel Partners, and I'm joined by my co-host Swyx, founder of Smol AI.
Hey, and today we're excited to be in the in-person studio with Michelle. Welcome.
Thanks. Thanks for having me. Very excited to be here.
This has been a long time coming. Uh, I've been following your work on the API Platform for a little bit, and, uh, I'm finally glad that we could make this happen after you, you shipped, uh, Structured Outputs. How does that feel?
Yeah, it feels great. Uh, we've been working on it for quite a while.
Yeah.
So very excited to have it out there and have people using it.
We'll tell the story soon, uh, but I wanna give people a little intro to your background. So you've interned and-or worked at Google, Stripe, Coinbase, Clubhouse, and obviously OpenAI. What was that journey like? Uh, you know, I, I...
The one that has the most appeal to me is Clubhouse because that was a, a very, very hot company for a while. You- Basically, you seem to join companies when they're about to scale up really a lot, and, uh, obviously OpenAI has been the latest.
But, uh, yeah, just what, what are your learnings and your history going into all these c- um, notable companies?
Yeah, totally. For a bit of my background, uh, I'm Canadian. I went to the University of Waterloo, and there you do, like, six internships as part of your degree. So I started... Uh, actually, my first job was really rough.
I worked at a bank, and I learned Visual Basic, and I, like, animated bond yield curves and it was, you know, not, not-
Me too.
Oh, really?
Yeah. I was a derivatives trader.
Oh, okay.
Interest rate swaps-
Awesome
... that kind of stuff. Yeah.
Yeah. So I liked, you know, having a job, but I didn't love that job. Uh, and then my next internship was Google, uh, and I learned so much there. Uh, it was tremendous. But I had a bunch of friends that were into startups more and, you know, Waterloo has, like, a big startup culture.
And one of my friends, uh, interned at Stripe, and he said it was super cool, so that was kind of my... I also was a little bit into crypto at the time, then I got into it on Hacker News, and, uh, so Coinbase was on my radar.
And so that was, like, my first real startup opportunity, was Coinbase. I think I've never learned, uh, more in my life than in the four-month period when I was interning at Coinbase. They actually put me on call. I worked on, like, the ACH rails there, and it was, it was absolutely crazy.
You know, crypto was a very formative experience. Yeah.
And this is, uh, 2018 to 2020, kind of like the first big wave.
That was my full time.
Yeah.
Uh, but I was there as an intern in 20-
16.
16. Yeah. And so that was the period where I really, like, learned to become an engineer, learned how to use Git, got on call right away. You know, managed production databases and stuff, so that was super cool. After that, I went to Stripe and kind of got a different flavor of payments on the other side.
Learned a lot. Uh, was really inspired by the Collisons. And then my next internship after that, I actually started a company at Waterloo. So there's this thing you can do, it's an entrepreneurship co-op, uh, and I did it with my roommate.
Uh, the company's called Readwise, which still exists, but-
Oh, yeah, yeah. I use it.
Oh, I thought you said Rewise. What?
Yeah. Awesome.
You, you co-founded Rewise?
Yeah. Um.
I love premium music.
Well, it's not even on your, your, your LinkedIn.
Yeah, I mean, I only worked on it for about a year, and so Tristan and Dan are the, the real founders, and, and I just had an interlude there. But, uh, yeah, really loved working on something very startup focused, user focused, and, and hacking with friends.
It was super fun. Eventually, I decided to go back to Coinbase and really, like, get a lot better as an engineer. I didn't feel like I was... You know, didn't feel equipped to be a CTO of anything at that point, and so just learned so much at Coinbase, and that was a really fun curve.
But yeah, after that I went to Clubhouse, which was, like, a really interesting, uh, time. So I wouldn't say that I went there before it blew up. I would say I went there as it blew up, so, uh, not quite the starling track record that it might seem.
But it was a super exciting place. I joined as, like, the second or third backend engineer and, you know, we were down every day, basically. You know, one time Oprah came on, and a- absolutely everything melted down. And so we would have a standup every morning and be like, "How do we make everything stay up?"
Um, which was super exciting. Also, one of the first things I worked on there was making our notifications go out more quickly because when you join a Clubhouse room, you know, you need everyone to come in right away so that it's exciting and the person speaking thinks a lot of my audience is here.
But when I first joined, I think it would take, like, 10 minutes for all the notifications to go out, which is insane. Like, you know, by the time you want to start talking to the time your audience is there, it's, like, you can totally kill the room.
So that's one of the first things I worked on, is making that a lot faster and, you know, keeping everything up.
I mean, so already we have an audience of engineers. Uh, those two things are useful. It's keeping things up and notifications out. Notifications, like, is it a Kafka topic?
It was a Postgres shop, and you had all of the followers in Postgres, and you needed to, like, iterate over the followers and, like, figure out is this a good notification-
Ah
... to send.
Okay.
And so all of this logic, it wasn't, like, well batched and parallelized, and our job queuing infrastructure wasn't right, and so there was a lot of, like, fixing all of these things. Um, eventually there were a lot of database migrations because Postgres just wasn't scaling well for us.
Interesting. And then thing... Uh, keeping things up, that was more of a, I don't know, reliability issue, SRE type?
A lot of it, yeah, just goes down to, like, database stuff. Um, everywhere I've worked-
It's all databases.
Yeah.
Yeah.
Indexing.
Actually, at, at Coinbase, at Clubhouse, and at OpenAI, Postgres has been a perennial challenge.
Huh.
It's like the stuff you learn at one job carries over to all the others because you're always debugging a long-running Postgres query at 3:00 AM for some reason. Um, so those skills have really carried me forward, for sure.
Why do you think that not as much of this is practiced? Uh-
Mm.
Obviously Postgres as an open source project is not aimed at, like, giga scale-
Right
... but you would think somebody would come around and say, "Hey, we're, like, the..."
Yeah. I think that's what PlanetScale is doing, kind of. It's not on Postgres, I think. It's on MySQL. But I think that's the vision. It's like they have zero time, zero downtime, uh, migrations, and that's a big pain point.
I don't know why no one is doing this on Postgres, but I think it would be very cool.
Their connection poolers like PgBouncer is, like, good enough? I don't know.
Yeah. Well, even, I mean, I've run PgBouncer everywhere, and it's, there's still a lot of problems. Like-
I mean, your scale-
Yeah.
... is something that not many people see, so.
Yeah. I mean, at some point, every company hits the scale, every successful company gets to the scale where Postgres is not cutting it, and then you migrate to some sort of NoSQL database.
Yeah.
And, and that process I've seen happen a bunch of times now.
MongoDB, Redis, something like that. Yeah.
Yeah. Um, I mean, we're on Azure now, and so there's... And we use Cosmos DB.
Cosmos DB. Hey.
At Clubhouse, we, I really love DynamoDB. That's probably my favorite database, which is, like, a very nerdy sentence, but that's the one I'm using if I need to scale something as far as it goes.
Yeah. DynamoDB, I, I, um, when I learned, I worked at AWS briefly, and it's kind of like the memory register for the web. Like-
Yes
... it, you know, if you treat it just as physical memory, you will use it well. If you treat it as a real database, you might run into problems.
Right. You have to totally change your mindset-
Yeah
... when you're going from Postgres to Dynamo. But I think it's a good mindset shift and kind of makes you design things in a more scalable way.
Early Days6:37
Yeah. I'll recommend a DynamoDB book for people who need to use DynamoDB. But we're not here to talk about AWS. We're here to talk about OpenAI. You joined OpenAI pre-ChatGPT. I also had the opportunity to join, and I didn't.
Oh, no way.
What was, what was your insight?
Yeah. I think a lot of people who joined OpenAI joined because of a product that really gets them excited, and for most people it's ChatGPT. But for me, I was a daily user of Copilot, GitHub Copilot, and I was, like, so blown away at the quality of this thing.
I actually remember the first time seeing it on Hacker News and being like, "Wow, this is absolutely crazy." Like, "This is gonna change everything." And I started using it every day. It just really... I, even now, when, like, I'm, I don't have service and, and I'm coding without Copilot, it's just, like, 10X difference.
So I was really excited about that product. I thought now is maybe the time for AI, and I'd done some AI in college and thought some of those skill, skills would transfer. Um, and I got introduced to the team.
I liked everyone I talked to, so I thought, thought it'd be cool. Why didn't you join?
It was like, I was like, "Is DALL-E it?"
Mm.
Yeah, we were there.
We were at the DALL-E
We, we were at the DALL-E, like, launch thing. And, and I think you were talking with Lenny, and, uh-
Yeah
... Lenny was at OpenAI at the time, and you were like, "I don't-"
We don't have to go into too much detail, but-
Yeah, no, no, but it was-
... this is one of my biggest regrets of my life, I think.
No, no, no.
Um, but, but, well, I was like, "Okay. I mean, I can, I can create images. I don't know if, like, this is the thing to, to dedicate." But obviously you had a bigger vision than, than I did. Um, but-
DALL-E was really cool too. I remember, like, first showing my family, I was like, "I'm going to this company, and here's, like, one of the things they do." And it, like, really helped bridge the gap, whereas, like, I still haven't figured out how to explain to my parents what crypto is.
Um, my mom for a while thought I worked at Bitcoin. So it's like- ... it's pretty different to be able to tell your family what you actually do, and they can see it.
Yeah. Yeah. And they can use it too-
Yes
... personally. So you were there w- were you immediately on API Platform? You were there for the ChatGPT moment.
Yeah. I mean, API Platform is, like, a very grandiose term for what it was. There was, like, just a handful of us working on the API.
Yeah, it was like a closed beta, right? Not even everyone had access to-
Yeah, there was a-
... the GPT-3 model
... a very different access model then. Um, a lot more, like, tiered rollouts.
Yeah.
But yeah, I, I would say the applied team was maybe, like, 30 or 40 people and... Yeah, probably closer to 30, and there was maybe, like, five-ish total working on the API at most. So yeah, we've grown a lot since then.
It's like 60, 70 now, right?
No, Applied is much bigger than that. Applied now is bigger than the company when I joined.
Okay. All right.
Yeah, we've grown a lot. I mean, there's so much to build, so we need all-
I'm, I'm a little out of date
... the help we can get.
Yeah.
Any ChatGPT release, kind of like all hands on deck stories? I had lunch with, um, Evan Morikawa a few months ago. It sounded like it was a fun time to get, build the APIs and have all these people trying to use the web thing.
Yes.
Like, how are you prioritizing internally? Like, what was the helping scaling when you're scaling now GPU workloads versus, like, Postgres bouncers and things like that?
Oh. Yeah, actually, surprisingly, there were a lot of Postgres issues, um- ... when ChatGPT came out because the accounts for, like, ChatGPT were tied to the accounts in the API. And so you're basically creating a developer account-
Mm
... to log into ChatGPT at the time-
Mm
... 'cause it's just what we had. It was low-key research preview. And so I remember there was just so much work scaling, like, our authorization system, and that would be down a lot. Yeah, also GPU, you know, I never had worked in a place where you couldn't just scale the thing up.
It's like everywhere I've worked-
Yeah.
... compute is, like, free, and you just, like, auto-scale a thing- ... and you, like, never think about it again. But here we're having, like, tough decisions every day. We're, like, discussing, like, you know, should it go here or here?
And we have to be principled about it. So that's a real mindset shift.
Structured Outputs9:58
So you just released Structured Outputs. Congrats. You also wrote the blog post for it, which was really well-written, and I loved all the examples that you put out. Like, it really give the, the full story. Yeah-
Yeah
... tell us about the whole story from beginning to end.
Yeah. I guess the story, we should rewind, uh, quite a bit to Dev Day last year. Dev Day last year-
Mm-hmm
... exactly, we shipped JSON mode, which is our first foray into this area of product. So for folks who don't know, JSON mode is this functionality you can enable in our chat completions and other APIs, where if you opt in, uh, we'll kind of constrain the output of the model to match the JSON language.
And so you basically will always get something in a curly brace, and this is good. This is nice for a lot of people. You can, like, describe your schema, what you want in prompt, and then, you know, we'll constrain it to JSON.
But it's not getting you exactly where you want because you don't want the model to kind of make up the keys or, like, match different values than what you want. Like, if you want an enum or a number and you get a string instead, it's, like, pretty frustrating.
So we've been ideating on this for a while, and, like, people have been asking for basically this every time I talk to customers for maybe the last year. So it was really clear that there's a developer need, and we started working on kind of making it happen, and this is a real collab between engineering and research, I would say.
And so it's not enough to just kind of constrain the model. I think of that as the engineering side, whereas basically you mask the available tokens that are produced every time to only fit the schema. And so you can do this engineering thing, and you can force the model to do what you want, but you might not get good outputs.
And sometimes with JSON mode, developers have seen that our models output, like, white space for a really long time where they don't match-
Because it's a legal character.
Right.
Yeah.
It's legal for JSON, but it's not really what they want. And so that's what happens when you do kind of a very engineering-biased approach, but the modeling approach is to also train the model to do more of what you want.
And so we did these together. We trained a model which is significantly better than our past models at following formats, and we did the end work to serve, like, this constrained decoding concept at scale. So I think marrying these two is, is why this feature is pretty cool.
You just mentioned starts and ends with a curly brace, and maybe people's minds go to, uh, Prefills in the Claude API. How should people think about JSON mode structured output Prefills? Because some of them are like roughly starts with a curly brace and asks you for JSON, you should do it.
And then instructor is like, "Hey, here's a rough data schema you should use." And how do you think about them?
So I think we kind of designed structured outputs to be the easiest to use. So you just... Like, the way you use it in our SDK, I think, is my favorite thing. So you just create like a Pydantic object or a Zod object, and you pass it in, and you get back an object.
And so you don't have to deal with any of the serialization on-
With the parse helper.
Yeah. You don't have to deal with any of the serialization on the way in or out. So I, I kind of think of this as the feature for the developer who is like, "I need this to plug into my system.
I need the function call to be exact. I don't want to deal with any parsing." So that's where structured outputs is tailored. Whereas if you want the model to be more creative and use it to come up with a JSON schema that you don't even know you want, then that's kind of where JSON mode fits in.
But I expect most developers are probably gonna want to upgrade to structured outputs.
The thing you just said, you just used interchangeable terms for, for the same thing, which is two... Function Calling and Structured Outputs. We've had, uh, disagreements or discussion before on the podcast about are they the same thing.
Mm.
Semantically, they're slightly different.
They are, yes.
Because I think Function Calling API came out first-
Yes
... then JSON mode, and we used to abuse Function Calling for JSON mode.
Right.
Do you think we should treat them as synonymous?
No.
Okay. Yeah.
Um-
Please clarify.
Yeah.
And there, by the way, there's also tool calling.
Yeah. The history here is we started with Function Calling, and Function Calling, you know, came from the idea of like, let's give the model access to tools, and let's see what it does. And we basically had these internal prototypes of, of what a Code Interpreter is now, and we were like, "This is super cool.
Let's make it an API." But we're not ready to host Code Interpreter for everybody, so, you know, we're just gonna expose the raw capability and see what people do with it. But even now, I think there's a really big difference between Function Calling and Structured Outputs.
So you, you should use Function Calling when you actually have functions that you w- want the model to call.
Right.
And so, like, if you have a database that you want the model to be able to query from, or if you want the model to send an email or, like, you know, generate arguments for an actual action. And that's the way the model has been, like, fine-tuned on, is to, like, treat Function Calling for actually calling these tools and getting their outputs.
The new response format is a way of just getting the model to respond to the user, but in a structured way. And so this is very different, like, responding to a user versus, like, you know, I'm gonna go send an email.
A lot of people were hacking Function Calling to get the response format they needed, and so this is why we shipped kind of this new response format. So you can get exactly what you want, and you get kind of more of the model's verbosity.
It's, like, kind of responding in the way it would speak to a user, and so less kind of just programmatic tool calling, if that makes sense.
Are you building something into the SDK to actually close the loop with the Function Calling?
Yes.
Because right now it returns the function, then you gotta run it, then you gotta, like, fake another message to then-
Yeah
... continue the conversation like-
They have that in beta, the, the runs.
Yes. We have this in beta in the Node SDK. So you can basically-
Mm
... define-
Oh, not Python. Oh.
It's coming to Python as well.
Oh.
That's why I didn't know.
Yeah, I'm a N- Node guy, so the Python guys are-
The JavaScript, the JavaScript mind is so advanced
... so I'm like, "This, this already existed."
It, it's coming everywhere. But basically what you do is you write a function, and then you add a decorator to it, and then you can... Basically, there's this run tools method-
Yeah
... and it does the whole loop for you, which is pretty cool.
When I saw that in the Node SDK, I wasn't sure if that's... Because it, it basically runs it in the same machine.
Yeah.
And maybe you don't want that-
Right
... to happen.
Yeah, I think of it as, like, if you're prototyping and building something really quickly and just playing around, it's so cool-
Yeah
... to just create a function and give it this decorator. But, you know, you have the flexibility to do it however you like.
Like, you don't want it in a critical path of a web request because-
I mean, some people definitely will. Um-
Really?
You know, it's just kind of the easiest way to get started.
Yeah.
But let's say you wanna, like, execute this function on a job queue async, then, you know, it wouldn't make sense-
Yes
... to use that.
Yeah.
Prior art in Structure Outlines, JSON former, what did you study? What did you, you know, credit or learn from these things?
Yeah. There's a lot of different approaches to this. There's more fill-in-the-blank style sampling, where you, uh, basically pre-form kind of the keys and then get the model to sample just the value. There's kind of a lot of approaches here.
We didn't kind of use any of them wholesale, but we really loved what we saw from the community and, like, the developer experiences we saw, so that's where we took a lot of, uh, inspiration.
There was a question also just about constrained grammar. This is something that I s- I first saw in Llama CPP, which seems to be the most, let's just say, academically permissive form-
For the lowest level
... of constr- Yeah.
Yeah.
For those who don't know, maybe, I don't know if you want to explain it, but they use, uh, Backus-Naur Form, which you only learn in, like, college when you're working on-
Yeah
... programming languages and compilers. I don't know if you, like, use that under the hood or you explore that.
Yeah, we, we didn't, uh, use any kind of other stuff. Um, we kind of built, you know, our solution from, from scratch to meet our specific needs. But I think there's a lot of cool stuff i- out there where you can supply your own grammar.
Right now we only allow JSON schema and a dialect of that, but I think in the future it could be a really cool extension to let you supply a, a grammar more broadly, and maybe it's more token efficient than JSON.
So a l- lot of opportunity there.
API Design17:08
You mentioned before also training the model to be better at Function Calling. What's that discussion like internally for, like, resources? It's like, "Hey, we need to get better JSON mode," and it's like, "Well, can you figure it out on the API platform without touching the model?"
Like a-
Yeah
... is there a really tight collaboration between the two teams?
Yeah, so I actually work on the API models team. I guess we didn't quite get into what I do in API.
Yeah.
Yeah. What do you say w- it is you do here?
Yeah. So yeah, I'm the, I'm the tech lead for the API, but also I work on the API models team, and this team is really working on making the best models for the API. And a lot of common deployment patterns are research makes a model, and then you kind of ship it in the API.
But- You know, I think there's a lot you miss when you do that. You miss a lot of developer feedback and things that are not kind of immediately obvious. What we do is we get a lot of feedback from developers, and we go and make the models better in certain ways.
So our team does model training as well. We work c- very closely with our post-training team. And so for Structured Outputs, it was a collab between a bunch of teams, including safety systems, to make, you know, a really great model that does, uh, Structured Outputs.
Mentioning safety systems, you have a Refusal field.
Yes.
Uh, you wanna talk about that?
Yeah.
That, that one's like a-
Yeah, it's a little... it's pretty interesting. So you can imagine, basically, if you constrain the model to follow a schema, you can imagine there being, like, a, a schema supplied that it wouldn't... it would add some risk or be harmful for the model to kind of follow that schema, and we wanted to preserve our model's abilities to refuse, uh, when something, you know, doesn't match our policies or is harmful in some way.
And so we needed to give the model an ability to refuse even when there is this schema. But also, you know, if you are a developer and you have this schema and you get back something that doesn't match it, you're like, "Ah, the feature's broken."
So we wanted a really clear way for developers to program against this. So if you get something back in the content, you know it's valid, it's JSON parsable. But if you get something back in the Refusal field, it makes for a much better UI for you to kind of display this to your user in a different way-
Yeah
... and it makes it easier to program against. So really there was a few goals, but it was mainly to allow the model to continue to refuse, but also with a really good developer experience.
Yeah. Why not offer it as, like, an error code? Because we have to display error codes anyway.
Yeah, we fluffled for a long time about API design, as we are want to do, and there are a few reasons against an error code. Like, you could imagine this being a 4xx error code or something-
Mm
... but, you know, the developer's paying for the tokens, and that's kind of atypical for, like, a 4xx error code.
D- we pay with errors anyway, right? Or no?
So 4xx's don't-
It's not. That's a, that's a U- that's a U error.
Right.
Okay.
And it, it doesn't make sense-
That's a malformed request
... as a 5xx either-
Yeah
... 'cause it's not our fault, you know?
It's not your fault.
It's the way the API, the model is designed. And I think the HTTP spec is a little bit limiting for AI in a lot of ways. Like, there are things that are in between your fault and my fault.
There's kind of, like-
Oh
... the model's fault, and there's no, you know, error code for that. So we really have to kind of invent a lot of the paradigm here.
Make a 6xx.
Yeah, that's one option. There's actually some, like, esoteric error codes we've considered adopting.
328, my favorite.
Um, yeah, there's, uh, yeah, there's the teapot one. Um-
Hey.
We're still figuring that out, but I think there are some things, like, for example, sometimes our model will produce tokens that are invalid based on kind of our language, and when that happens, it's an error. But, you know, it doesn't...
500 is fine, which is what we return, but it's not as expressive as it could be.
Mm-hmm.
So yeah, just areas where, you know, Web 2.0 doesn't quite fit with AI yet.
If you had to put in a spec-
I was gonna
... to this chain-
Yeah, yeah.
What would be your number one proposal to, like, re-haul in the-
The HTTP committee-
Yeah
... to reinvent the world?
Yeah, that's a good one. I mean, I think we just need an error of, like, a range of model error, and we can have many different kinds of model errors. Like, a refusal is a model error.
601, model refusal.
Yeah. Again, like, so we, we've mentioned before that chat completions uses this ChatML format, so when the model doesn't follow ChatML, that's an error. Um, and we're working on reducing those errors, but that's, like, I don't know, 602, I guess.
A lot of people actually don't no longer know what ChatML is-
Yeah
... because that-
Fair enough
... that was, uh, briefly introduced by OpenAI and then, like, kind of deprecated. Everyone who introdu- who implements this under the hood knows it, but maybe the, the API users don't know it.
Function Calling21:23
Basically, the API started with just one endpoint, the completions endpoint, and the completions endpoint, you just put text in, and you get text out, and you can prompt in certain ways. Then we released ChatGPT, and we decided to put that in the API as well, and that became the chat completions API.
And that API doesn't just take, like, a string input and produce an output. It actually takes in messages and produces messages, and so you can get a distinction between, like, an assistant message and a user message, and that allows all kinds of behavior.
And so the format under the hood for that is called ChatML. Sometimes, you know, because the model is so out of distribution based on what you're doing, maybe the temperature's super high, then it can't follow ChatML.
Yeah. I didn't know that there could be errors generated there. Maybe I'm not asking challenging enough questions.
It's pretty rare- ... and we're, we're working on driving it down. But actually, this is a side effect of Structured Outputs now, which is that we have removed a class of errors. We didn't really mention this in the blog just 'cause we ran out of space.
But, uh-
That's what we're here to do.
Yeah, the model used to, um, occasionally pick a recipient that was invalid, um, and this would cause an error, but now we are able to constrain to ChatML in a more valid way, and this reduces a class of errors as well.
Recipient meaning, so there's, there's, like, a, a few number of defined roles like user, assistant, system.
So, like, recipient as in, like, picking the right tool. Um, so-
Oh.
Oh
... so the model before w- was able to res- to hallucinate a tool, but now it's, uh, it can't when you're using Structured Outputs.
Do you collaborate with other model developers to try and figure out these type of errors? Like, how do you display them? Because a lot of people try to work with different models.
Yeah.
Is there any?
Yeah, not a ton. We're, we're kind of just focused on making the best API for developers.
A lot of research and engineering, I guess, c- comes together with evals. You published some evals there. I think, I think Gorilla is one of them. What is your assessment of, like, the state of evals for function calling and structured output right now?
Yeah, we've actually collaborated with, uh, BFCL a little bit, which is-
Mm-hmm
... I think the same thing as Gorilla.
The Berkeley Function Calling Leaderboard.
Kudos to the team. Those, those evals are great, and we use them internally. Yeah, we've also sent some feedback on some things that are misgraded, but... and so we're, we're collaborating to, to make those better. In general, I feel evals are kind of the hardest part of AI.
Like, when we talk to developers, it's so hard to get started. It's really hard to make a robust pipeline, and you don't want evals that are, like, 80% successful because, you know, things are gonna improve dramatically. And- It's really hard to craft the right eval.
You kind of want to hit everything on the difficulty curve. I find that a lot of these evals are, are mostly saturated, like for BFCL, all the models are near, near the top already, and kind of the errors are more, I would say, like, just differences in default behaviors.
I think most of the models on the leaderboard can kind of get 100% with different prompting, but it's more kind of you're just pulling apart different defal-defaults at this point. So yeah, I would say in general, we're missing evals.
You know, we work on this a lot internally, but it's hard.
Did you... Other than BFCL, would you call out any others just for people exploring this space?
SweetBench is actually, like, a very interesting eval if people don't know. You basically give the model a GitHub issue and, like, a repo and just see how well it does with the issue. Which I think is super cool.
It's kind of like an integration test, I would say, for models.
It's a little unfair, right?
What do you mean?
A little unfair because, like, usually as a human, you have more opportunity to, like, ask questions about what it's supposed to do.
Right.
And you're giving the model, model, like, way too little information-
It's a hard job
... to, to do the job.
Yeah. But yeah, SweetBench targets, like, how well can you follow the diff format and how well can you, like, search across files and how well can you write code? So really excited about evals like that because the pass rate is low-
Mm-hmm
... so there's a lot of room to improve.
Yeah.
And it's just targeting a really cool capability.
I've seen other evals for function calling where I think might be BFCL as well, where they, they evaluate different kinds of function calling, and I think the, the top one that people care about for some reason, I, I don't know personally that this is so important to me, but it's parallel function calling.
Right.
I think you confirmed that you're-- you have don't support that yet. Why is that hard? Just-
Yeah
... more context about it.
So yeah, we put out parallel function calling, uh, Dev Day last year as well, and, uh, it's kind of the evolution of function calling. So function calling V1, you just get one function back. Function calling V2, you can get multiple back at the same time and save latency.
We have this in our API, all our models support it, or all of our newer models support it, but we don't support it with structured outputs right now. And there's actually a very interesting trade-off here. Uh, so when you basically call our API for structured outputs with a new schema, we have to build this artifact for fast sampling later on.
But when you do parallel function calling, the kind of schema we follow is not just directly one of the function schemas. It's like this combined schema based on a lot of them. If we were kind of do the same thing and build an index every time you pass in a list of functions, if you ever change the list, you would kind of incur more latency.
And we thought it would be really unintuitive for developers and, like, hard to reason about. So we decided to kind of wait until we can support a no added latency solution, um, and not just kind of make it really confusing for developers.
Mentioning latency, that is something that people discovered, is that there is an increased cost in latency for the first token.
For the first request, yeah.
First request. Is that an issue? Is that gonna go down over time? Is, is there just an overhead to parsing JSON that used to just un- insurmountable?
It's definitely not insurmountable, and I think it will definitely go down over time. We just kind of take the approach of, of ship early and often. Um, and you know, if you-- if there's nothing in there you, you don't wanna fix, then you probably ship too late.
Um, so I think we will get that latency down over time. But yeah, I think for most developers it's not a big concern, 'cause you're testing out your integration, you're, you're sending some requests while you're developing it, and then it's fast in prod.
So it kind of works for most people. The alternative design space that we, uh, explored was, like, pre-registering your schema, so, like, a totally different endpoint, and then passing in, like, a schema ID. But we thought, you know, that was a lot of overhead and, like, another endpoint to maintain and just kind of more complexity for the developer, and we think this latency is gonna come down over time, so it made sense to keep it kind of in chat completions.
I mean, hypothetically, if one were to ship caching at a future point- ... it would basically be the superset of that.
Maybe. I think the caching space is a little underexplored. Like, we've seen kind of two versions of it, but I think, yeah, there's ways that maybe put less onus on the developer. But, you know, we haven't committed to anything yet, but we're definitely exploring opportunities for making things cheaper over, over time.
Agentic Apps27:42
Is AGI in agents just gonna be a bunch of structure upload and function calling one next to each other? Like, how do you see... You know, there's like the model does everything. Where do you draw the line? Because you don't call these things like an agent API, but, like, if I were a startup trying to raise a seed round, I would just do function calling and say-
Yes
... this is an agent API.
Yeah.
So how do you think about the difference and, like, how people build on top of it for, like, agentic systems?
Yeah, love that question. One of the reasons we wanted to build structured outputs is to make agentic applications actually work. So right now it's really hard, like, if something is ninety-five percent reliable but you're chaining together a bunch of calls, if you magnify that error rate, it makes your, like, application not work.
So that's a really exciting thing here from going from, like, ninety-five percent to a hundred percent. I'm very biased working on the API and working on function calling and structured outputs, but I think those are the building blocks that we'll be using kind of to distribute this technology very far.
It's the way you connect, like, natural language and converting user intent into working with your application. And so I think, like, kind of there's no way to build without it, honestly. Like, you, you need your function calls to work.
Like, yeah, we wanted to make that a lot easier.
Yeah. And, and do you think the assistants kind of like API thing will be a bigger part as people build agents? I think maybe most people just use messages and completion and-
So I would say the assistants API was kind of a bet in a few areas. One bet is hosted tools, so we have the file search tool and, and code interpreter. Another bet was kind of statefulness. It's our first stateful API.
It'll store, you know, threads, and you can fetch them later. I would say the hosted tools aspect has been really successful. Like, people love our file search tool, and it's like saves a lot of time to not build your own RAG pipeline.
Um, I think we're still iterating on the shape for the stateful thing to make it as useful as possible. Right now there's kind of a few endpoints you need to call before you can get a run going, and we wanna work to make that, you know, much more intuitive and easier over time.
One thing I'm, I'm just kinda curious about, did you notice any trade-offs when you add more structured output, it gets worse at some other thing that was, like, kind of you didn't think was related at all?
Yeah, it's a good question. Yeah, I mean, models are very spiky, and RL is hard to predict. And so every model kind of improves on some things and maybe is flat or neutral on other things.
Yeah, like it's, it's like very rare to just add a capability-
Yeah
... and have no trade-offs in everything else.
So yeah, I don't have something off the top of my head, but I would say, yeah, every model is a special kind of its own thing. This is why we put them in API dated so developers can choose for themselves which one works best for them.
In general, we strive to continue improving on all evals, but it's stochastic.
Yeah. Able to apply the structured output system on backdated models like, uh, 4o May as well as Mini as well as August.
Actually, the new response format-
Yeah
... is only available on two models. It's 4o Mini and the new 4o.
Okay.
So the old 4o doesn't have the new response format.
Okay.
However, for function calling, we were able to enable it for all models that support function calling, and that's because those models were already trained to follow these schemas. We basically just didn't wanna add the new response format to models that would do poorly at it, because they would just kind of do infinite white space, which is, you know, the most likely token if you have no idea what's going on.
I just wanted to call out a little bit more in the, in the stuff you've done in a blog post. So in the blog post, just use cases, right? I just want people to be like, yeah, we're spelling it out for you.
Use these for extracting structured data from unstructured data. By the way, it does vision too.
Yes.
Right? So that's cool. Dynamic UI generation. Actually, let's talk about dynamic UI. Um, I think Gen UI, I think is like something that people are very interested in.
Yeah.
It's your first example. What did you find about it?
Yeah, I just thought it was a super cool capability we have now. So the schemas we s- we support recursive schemas, and this allows you to do really cool stuff. Like, you know-
Nested this
... every UI is a nested tree that has children. And so I thought that was super cool. You can use one schema and generate like tons of, of UIs. As a backend engineer who's always struggled with JavaScript and front end- ...
like for me, that's super cool. I've now... We've now built a system where I can get any front end that I want. So yeah, that's super cool. The extracting structured data, like the reality of a lot of AI applications is like you're plugging them into your enterprise business, and you have something that works, but you wanna make it a little bit better.
And so the reliability gains you get here is like, you'll never get a m- like a classification using the wrong enum. It's like, it's just exactly your, your types. So really excited about that.
Like maybe hallucinate the actual values, right?
Sure.
So le- let's clearly state what the guarantees are. The guarantees is that this fits the schema, but the schema itself may be too broad because the JSON schema type system doesn't say like, "I only want a range from 1 to 11."
You might give me 0.
Right, right.
You know, you might give me 12.
So yeah, JSON schema, so this is actually a good thing to talk about. So JSON schema is ex- extremely vast, and we weren't able to support every corner of it.
Yes.
So we kind of support our own dialect, and it's described in the docs. And there are a few trade-offs we had to make there. So by default, if you don't pass in additional properties in a schema, by default that's true.
And so that means you can get other keys, which, you know, you didn't spell out, which is kind of the opposite of what developers want. You basically wanna supply the keys and values, and you wanna get those keys and values.
And so then we had a decision to make. It's like, do we redefine what additional properties means as the default? And that felt really bad. It's like there's a schema that's predated us, like, you know, it wouldn't be good...
It'd be better to play nice with the community. And so we require that you pass it in as false. You know, one of our design principles is to be very explicit, and so developers know, you know, what to expect.
And so this is one where we decided, you know, it's a little harder to discover, but we think you should pass this thing in so that we can have like a very clear definition of what you mean and what we mean.
There's a similar one here with like required. By default, every key in JSON scheme is optional. But that's not what developers want, right? Like you would, you'd be very surprised if you passed in a bunch of keys and you didn't get some of them back.
And so that's the trade-off we made, is to make everything required and have the developer spell that out.
Is there a require false?
Um-
Can people turn it off or-
So-
... they're just getting all the, the keys?
So developers can... Basically what we recommend for that is to make your actual key a union type. And so like-
Null able.
Yeah. So make it a union of-
Yeah, yeah
... int and null, and that gets you the same behavior.
Any other, uh, the examples you wanna dive into, math, chain of thought?
Yeah. You can now specify like a chain of thought field before a final answer. This is just like a more structured way of extracting the final answer.
Yeah.
One example we have, I think we put up a demo app of this math tutoring, uh, example, or it's coming out soon.
Did I miss it? Oh, okay. Well.
Basically, it's this math tutoring thing, and you put in an equation, and you can go step by step and answer it. This is something you can do now with structured outputs. In the past, a developer would have to like specify their format and then write a parser and parse out the model's output, which would be pretty hard.
But now you just specify like steps, and it's an array of steps, and every step you can render, and then the user can try to... and you can see if it matches and go on that way. So I think it just opens up a lot of opportunities, like for any kind of UI where you wanna treat different parts of the model's responses differently, structured outputs is great for that.
I remembered my, my question from earlier. So I'm basically just using this to ask you all the questions as a user-
Yeah, totally
... as a daily, daily user of the stuff that you put out. So one is a tip that people don't know, and I confirmed with you on Twitter, which is you respect descriptions-
Yes
... of JSON schemas, right? And you can basically use that as a prompt for the field.
Totally.
I assume that's blessed and-
Yes
... you know, people should do that.
Intentional, yeah.
Right? One thing that I started to do, which I don't... it could be a hallucination of me- ... is I changed the, the property name to, to s- to, to prompt the model to what I want it to do.
So for example, instead of saying topics as a property name, I would say like, "Brainstorm a list of topics up to five," or something like that-
Nice.
... as, as like a, a property name. I, I could stick that in the description as well, but is that too much?
Yeah. I would say, I mean, we're so early in AI- ... that people are figuring out the best way to do things. And I love when I learn from a developer, like a way they found to make something work.
In general, I think there's like three or four places to put instructions.
Yeah.
You can put instructions in the system message, and I would say that's helpful for like when to call a function. So it's like- You know, let's say you're building a customer support thing, and you want the model to verify the user's phone number or something.
You can tell the model in the system message, like, "Here's when you should call this function." Then when you're within a function, I would say the descriptions there should be more about how to call a function. So really common is someone will have, like, date as a string, but you don't tell the model, like, do you want year, year, month, month, day, day, or do you want that backwards?
And that's what a really good spot is for those kind of descriptions is, like, how do you call this thing? And then sometimes there's, like, really... stuff like what you're doing is, like, name the, the key by what you want.
So sometimes people put, like, do not use, and, you know, if they don't want, you know, this parameter to be used except only in some s- some circumstances. And really, I think that's the fun nature of this. It's like you're figuring out the best way to get something out of the model.
Okay. So, so you don't have an official recommendation is what I'm hearing.
Well, the official recommendation is, you know, how to call a model system instructions.
Exactly, exactly. The-
Or when to call a function
... hierarchy.
Yeah.
Do you benchmark these type of things? So, like, say with date, it's like description, it's like return it in, like, ISO 8-
Yeah
... or if you called the key date in ISO-
Mm
... A6001. I feel like the benchmarks don't go that, that deep.
Yeah.
But then all the AI engineering kind of community, like, all the work that people do is like, "Oh, actually this performs better," but then there's no way to verify.
Right.
You know? Like, uh, even the, "I'm gonna tip you $100,000," or whatever-
Sure
... like, some people say it works, some people say it doesn't. Do you pay attention to this stuff as you build this, or are you just like, the model is just gonna get better, so why waste my time running evals on these small, small things?
Yeah. I would say... To that, I would say we basically pick our battles. I mean, there's so much surface area of LLMs that we could dig into, and we're just moc- mostly focused on kind of raising the capabilities for everyone.
I think for customers, and we work with a lot of customers, really developing their own evals is super high leverage. 'Cause then you can upgrade really quickly when we have a new model, you can experiment with these things with confidence.
So yeah, we're, we're hoping to make making evals easier. I think that's really generally very helpful for developers.
For people, I would just kind of wrap up the discussion for Structured Outputs. I immediately implemented... We used Structured Outputs for AI news. I used Instructor, and I ripped it out, and I think it w- I saved, um, 20 lines of code.
But more importantly, it was like we cut it by 55% of API costs based on what I, what I measured because of all, uh, we saved on the retries.
Nice.
Um-
Yeah, love to hear that.
Yeah, which, which people I think don't understand when y- you, you can't just simply, like, add Instructor or add outlines. You can do that, but it's actually gonna cost you a lot of retries to get the, the, the model that you want, but you're kind of just kind of building that internally into the model.
Yeah. I think this is the kind of feature that works really well when it's integrated with, like, the LLM provider. Yeah, actually, I had folks... even my, my husband's company, he works at a small startup, they thought we were just retrying, um, and so I had to make clear to a lot of folks- ...
we are not retrying, you know, we're doing it in one shot, and this is how you save on latency and cost.
Roadmap & Tuning38:36
Awesome. Any other behind the scenes stuff, just generally on Structured Outputs? We, we, we're gonna move on to the other models.
Yeah, I think that's it.
Well, look, that's an excellent product, and I, I think everyone will be using it, and we have the full story now that people can try out. So roadmap would be parallel function calling. Anything else that you've called out as, like, coming soon?
Uh, quite soon, but, you know, we're thinking about does it make sense to expose custom grammars-
Yeah
... um, beyond JSON schema.
What would you want to hear from developers to give you information, whether it's custom grammars or anything else about Structured Output? Like, what would you want to know more of?
Just, you know, always interested in, in feature requests, what's not working. But I'm, I'd be really curious, like, what specific grammars folks want. I know some folks want to match programming languages like Python. There's some challenges, like with the expressivity of our, you know, implementation.
And so, yeah, just kind of the class of grammars folks want.
I have a very simple one, which is a lot of people try to do... use GPT as judge, right?
Mm-hmm.
Which means they end up doing a rating system, and then there's like 10 different kinds of rating systems. There's a Likert scale-
Right
... there's whatever. If there was an o- officially blessed way to do a rating system with Structured Outputs-
Totally
... everyone would use it.
Yeah. Yeah, that makes sense. I mean, we often recommend using log probs with classification tasks. So rather than, like, sampling, you know, let's say you have four options like red, yellow, blue, green. Rather than sampling, you know, two tokens for yellow, you can just do like A, B, C, D and get the log probs of those.
You know, the inherent randomness of each sampling isn't taken into account, and you can just actually look at what is the most likely token.
I think this is more of like a calibration question. Like, if I ask you to rate things from one to 10-
Mm-hmm
... a non-calibrated model might always pick seven-
Mm-hmm
... just like a human would.
Right.
So, like, actually have a nice gradation from one to 10 would be the, the, the rough idea.
Yeah.
And then even for Structured Outputs, I can't just say, have a field of rating from one to 10 because I, I have to then validate it and, you know-
Right
... it might give me 11.
Yeah, absolutely.
So, yeah.
So what about model selection? Now you have a lot of models. When you first started, you had one model endpoint. I guess you had like the, the v3 and then a-
Yeah, the advantage
But, like-
Yeah
... most people are using one-
Right
... uh, model endpoint. Today, you have, like, a lot of competitive models, and I think we're nearing the end of the 3.5 run RIP. How do you advise people to, like, experiment, select, both in terms of, like, task and, like, cost?
Like, what's your playbook?
In general, I think folks should start with 4o mini. That's our cheapest model, and it's a great workh- work- workhorse, uh, works for a lot of great use cases. If you're not finding the performance you need, like, you know, maybe it's not smart enough, then I would suggest going to 4o.
And if 4o works well for you, that's great. Finally, there's some, like, really advanced frontier use cases, um, and maybe 4o is not quite cutting it, and there I would recommend our fine-tuning API. Even just, like, 100 examples is enough to get started there, and you can really get the performance you're looking for.
We're recording this ahead of it, but, like, you're announcing other, some fine-tuning stuff that people should pay attention to.
Yeah. Actually, tomorrow we're dropping our GA for GPT-4o fine-tuning. So 4o mini has been available for a few weeks now, and 4o is now gonna be generally available. And we also have a free training Offering for a bit, I think until September 23rd, you get one million in free training tokens a day.
This is already announced, right? Or was... am, am, am I talking about a different date?
So that was for 4o Mini, and now it's also for 4o. So we're really excited to see what people do with it, and it's actually a lot easier to get started than a lot of people expect. They think they might need tens of thousands of examples, but even 100 really high-quality ones or 1,000 is, is enough to get going.
Oh, well, we might get a separate podcast just specifically on that, but, um, you know, we haven't confirmed that yet. It basically seems like every time... I think people's concerns about fine-tuning is that they're kind of locked into a model, and I think you're paving the path for migration of models.
Um, as long as they keep their original data set, like they can at least migrate nicely.
Yeah, I'm not sure what we've said publicly there yet, but we definitely want to make it easier for folks to, to migrate.
It's the number one concern, you know?
Yeah.
I'm just... You know, it's obvious.
Absolutely.
I also want to point people to the... you have official model selection docs where it's, it's on, it's in the guide. We'll put it in the show notes where it says to op-optimize for accuracy first, so prompt engineering, RAG, evals, fine-tuning.
This was done at DevDay last year, so I'm just repeating things, and then optimize for cost and latency second, and there's a, there's a few sets of steps for optimizing latency, so people can read up on that stuff.
Yeah, totally.
Yeah.
We had one episode with, um, Miguel Scarlini from DeepMind, and we actually talked about how some people don't actually get to the boundaries of the model performance. You know, they just kind of try one model, and it's like, "Oh, LLMs cannot do this," and they stop.
Right.
How should people get over the hurdle? It's like, how do you know if you hit the model performance or like you hit skill issues, you know?
Mm.
It's like your prompt is not good or like try another model and whatnot. Is there an easy way to do that?
That's tough. Some people are really good at prompting, and they just kind of get it right away, and, and for others, it's more of a challenge. I think there's a lot we can do to make it easier to prompt our models.
But for now, I think requires a lot of creativity and not giving up right away. Yeah. And a lot of people have experience now with ChatGPT. You know, before ChatGPT, the easiest way to play with our models was in the playground.
But now kind of everyone's played with it, uh, with a model of some sort, and they have some sort of intuition. It's like, you know, if I tell you my grandma is sick, then maybe I'll get the right output.
And, and we're hoping to kind of remove the need for that. But playing around with ChatGPT is a really good way to get a feel for, you know, how to use the API as well.
Will prompt engineering be here forever, or is it a dying art as the models get better?
I mean, it's like the perennial question of software engineering as well. It's like, as the models get better at coding, you know, if we hit 100 on SWE-bench, what does that mean? I think there will always be alpha and people who are able to like clearly explain what they're trying to build.
Most of engineering is like figuring out the requirements and, and stating what you're trying to do, and I believe this will be the case with AI as well. You're gonna have to very clearly explain what you need, and some people are better than others at it, and people will always be building.
It's just the tools are going to get far better.
Last two weeks, you released two models. There's gpt-4o 20240806, and then there's also chatgpt-4-latest. I think people were a little bit confused by that, and then you, you issued a clarification that it was one's chat tuned and the other is more function-calling tuned.
Can you elaborate just-
Yeah. Totally. So part of the impetus here was to kind of be very transparent with what's on ChatGPT and in the API. So basically, we're, we're often training models and, and there are different use cases. So you don't really need function calling for user-defined functions in ChatGPT, and so this gives us kind of the freedom to build the best model for each use case.
So in chatgpt-latest, we're releasing kind of this rolling model. The weights aren't pinned as we release new models-
Like this is literally what we use.
Yeah. So it's in what's, what's in ChatGPT, so it's very good for like chat style use cases. But for the API broadly, you know, we really tune our models to be good at things that developers want, like function calling and structured outputs.
And when a developer builds their application, they want to know that kind of the weights are stable under them. And so we have this offering where it's like if you're tuning to a specific model and you know your function works, you know we will never change the weights out from under you.
And so those are the models we commit to supporting for a long time, and we think those are the best for developers. But we want to give it up. You know, we want to leave the choice to developers, like, "Do you want the ChatGPT model or do you want the API model?"
And you have the freedom to choose what's best for you.
I think it's... for people, they, they do want to pin model versions. So I don't know when they would use ChatGPT, like the, the, the rolling one, unless they're really just kind of cloning ChatGPT-
Yeah
... which it's like why would they?
I mean, I think there's a lot of interesting stuff that developers can do wh-when unbounded, and so we don't, we don't want to limit them artificially. So it's kind of survival of the fittest. Like whichever model is better, you know, that's the one that people should use.
Yeah. I talked about it to, to my friends as like this isn't a new thing. Like they... and basically, OpenAI has never actually shared with you the actual ChatGPT model, uh, and now they do. That's it.
Well, it's not necessarily true. Actually, a lot of the models we have shipped have been the same.
Oh, okay.
But you know, sometimes they diverge, and it's not a limitation we want to stick around.
Anything else we should know about the new model? I don't think there were, there were e- there was no evals announced or anything, but, but people say it's better. I mean, obviously, LMSYS is like way better evolved on everything, right?
It's like number one in the world on-
Yeah. We're, um, we published some release notes. They're not as in-depth as we want to be yet-
Yeah
... because we're still, it's still kind of a science and we're learning what actually changes with each model and how can we better understand the capabilities. But we are trying to do more release notes in the future and, and keep folks updated.
But yeah, it, it's, it's kind of an art and a science right now.
You need the best evals team in the world to help you figure this out.
Yeah. Evals are hard. We're hiring if you want to come work on evals.
Hold that thought on hiring. Uh, we'll, we'll come back to the end on what you want, what you're looking for because obviously people want to join you, and they want to know what, uh, qualities you're looking for.
So we just talked about API versus ChatGPT. What's, I guess, like the vision for the interface? You know, the, the mission of OpenAI is like build AGI that is accessible. Like, uh, uh, where is it gonna come from?
Totally, yeah. So I believe that, uh, the API is kind of our broadest vehicle for distributing AGI. Um, you know, we're building some first-party products, but they'll never reach every niche in the world and kind of every corner and community.
And so really love working with developers and seeing the incredible things they come up with. I often find that developers kind of see the future before anyone else, and we love working with them to make it happen. And so really, the API is a bet on going really broad.
And we-we'll go very deep as well in our first-party products, but I think just that our impact is absolutely magnified by every developer that we up-uplift.
War Stories48:13
They can do the last mile where's-- where you cannot. Like-
Yeah
... ChatGPT is one type of product, but there's many other kinds. Uh, in fact, uh, you know, I, I observed, I think in February, basically ChatGPT's user growth stopped when the API was launched because everyone's like kinda be able to take that and, and build other things.
That has n-not become true anymore because ChatGPT growth has-
Yeah
... has continued to grow. But then you're not confirming any of this. This is me quoting Similarweb numbers which are, have very high variance.
Well, the API predates ChatGPT. The API was actually OpenAI's first product, and the first, uh, idea for commercialization, that predates me as well.
Wide release, like GA, everyone can sign up and use it immediately.
Right.
Yeah, that's what I'm talking about. But, but yeah, I mean, I, I, I do believe that. Uh, a-and, you know, that means you also have to expose all of OpenAI models, right? Like, um, all the multimodal models. We'll ask you, uh, questions on that, but, like, uh, I think that a- that API mission is, is important.
It's interesting that hottest new programming language is supposed to be English.
Hmm.
But it's actually just software engineering, right? It's, it's just, you know, we're talking about HTTP error codes.
Right.
Like
Yeah. I think, you know, engineering is still the way you access these models, and I think there are companies working on, on tools to make engineering more accessible for everyone. But there's still so much alpha in just writing code and, and deploying.
Yeah. One might even call it AI engineering.
Exactly.
I don't know. Yeah, so, like, th-there's lots of war stories from, from building this platform. We started at the start of your career, and then we jumped straight to Structured Outputs. There's a whole thing, like two years, that we skipped in between.
Right.
What have become your principles? What are your favorite stories that, that you like to tell?
We had so much fun working on the Assistants API-
Yeah
... and leading up to Dev Day. You know, things are always pretty chaotic when you have an externally, like a date-
It's a hosting function
... that is hard, and there's like a stage and there's like 1,000 people coming. Um-
You can always launch a waitlist. I mean
We're trying hard not to.
Yeah.
Um, because, you know, we love it when people can access the thing on day one. And, and so yeah, the Assistants API, we had like this really small team and just working as hard as we could to make this come to life.
But even actually the morning of, I don't know if you remember this, but Sam did this keynote.
Yep.
And Roman came up, and they gave free credits to everybody.
Mm-hmm.
So that was live, fully live, as were all of the demos that day. Um, but actually maybe like two hours before that, we had a little outage, and everyone was like scrambling to make this thing work again. So we're, yeah, th-things are, are early and scrappy here and, you know, we were really glad.
We were a bit on the edge of our seat watching it live.
Wow.
What's the plan B in that situation? If you can share, it's like, okay-
Play, play a video. It's just a classic DevRel, right? I don't know.
I mean, I, I actually don't know what the plan B was.
No plan B, no failure.
But we just, you know, we fixed it. We got, got everything running again and, uh, the demo went well.
Just hire cracked Waterloo grads.
Exactly.
Skill issues as usual.
Sometimes you just gotta make it happen.
So I'm-- I imagine it's actually very motivating. But I, I did hear that after Dev Day, like the whole company got like a few weeks off just to relax a little bit.
Yeah. We, um, we sometimes get... Like, we just had the week of July 4th off and, yeah.
Yeah.
It's, it's hard to take vacation because people are working on such exciting things, and it's like you get a lot of FOMO on vacation, so it helps when the whole company's on vacation.
Mentioning Assistants API, you actually announced a roadmap there, and things have developed. Um, I think people may not be up to date. What's the offering today versus, you know, one year ago?
Yeah. So we've made a, a bunch of key improvements. I would say the biggest one is in the File Search product. Before, we only supported, I think, like 20 files per assistant, and the way we used those files was like, like less effective.
Basically, model would decide based on the file name whether to search a file, and there's like not a ton of information in there. So our new offering, which we shipped, uh, a few months ago, I think now allows 10K files per assistant, which is like dramatically more.
And also it's a, it's a kind of different operation, so you can search semantically over all files at once rather than just kind of the model choosing one up front. So a lot of customers have seen really good performance.
We also have exposed more like chunking and re-ranking options. I think the re-ranking one is coming, I think, next week or, or very soon. So this kind of gives developers more control and more flexibility there. So we're trying to make it the easiest way to kind of do RAG at scale.
Yeah. I think that visibility into the, the RAG system was the number one thing missing from Dev Day, and then people got their first impressions, and then they never looked at it again. So that's, it's important. The re-ranker is a core feature of, let's say, some other foundation model labs.
Is OpenAI gonna like offer a re-ranking service, um, a re-ranker model?
So we do re-ranking as part of it. I think we're soon going to ship more controls for that.
Okay, got it. And like if I'm an existing LangChain, LlamaIndex, whatever, how do you compare? Do you make different choices? Like where does that e-exist in the spectrum of choices?
I think we are just coming at it trying to be the easiest option. And so ideally, like you don't have to know what a re-ranker is, and you don't have to have a chunking strategy, and the thing just kind of works out of the box.
So I would say that's where we're going. And then, you know, giving controls to the power users to, to make the changes they need.
Awesome. I want to ask about a couple other things, just updates on stuff also announced at De-Dev Day, and we talked about this before. Uh, determinism, something that people really want. Dev Day, we announced the seed param as well as system fingerprint and like objectively, I've heard issues.
Yeah.
I don't know what's going on.
Yeah, the seed parameter is not fully deterministic, and it's kind of a best effort thing.
Yeah.
So you'll notice there's more determinism in the first few tokens. That's kind of the current implementation. We've heard a lot of feedback. We're, we're thinking about ways to make it better, but it's challenging. It's kind of trading off against, you know, reliability and uptime.
Other maybe underrated API-only thing, logic bias. Uh, that's another thing that kind of seems very useful and that maybe most people are like, "It's a lot of work. I don't want to use it." Uh-
Yeah
... do you have any examples of like Use cases or, like, products that are made a lot better-
Yeah
... uh, through using it.
So yeah, classification is the big one. So you logic bias your valid classification outputs and, you know, you're more likely to get something that matches. We've seen that people logic bias, like, punctuation tokens, maybe-
Mm
... trying to get more succinct writing. Yeah, it's generally a very much a power user feature, and so not a ton of folks use it.
I actually wanted to use it to reduce the incidence of the word delve.
Yeah.
Have people done that?
Probably. I don't know. Is delve one token? It- you're probably... You gotta do a lot of-
It's gotta be
... permutations.
It's used so much.
Maybe it is.
It's gotta be.
Depends on the tokenizer.
Are there non-public tokenizers that... I guess you cannot answer or you would admit it. Are the 100K and 200K vocabs, like, the ones that you use, like, across all models or, um-
Yeah, I think we have docs that publish more information. I don't have it off the top, but I think we publish which tokenizers for which model.
Okay. So those are the only two.
Rate the, the tiering rate limiting system, I don't think there was an official, like, blog post kind of announcing this, but it was kind of mentioned that, like, you started tying, like, fine-tuning to, to tiering, uh, and, like, feature rollouts.
Just on a, from, from your point of view, like, how do you manage that? And, like, what should people know about the-
Yeah
... tiering system and rate limiting?
Yeah, I think basically the main changes here were to be more transparent and easier to use. So before, developers didn't know what tier they're in, and now you can see that in, in the play- in the dashboard. I think it's also...
I think we publish, like, how you move from tier to tier, and so this just helps us do kind of gated rollouts. For the fine-tuning launch, I think everyone tier two and up has full access.
That makes sense. That, you know, I would just advise people to just get to tier five as quickly as possible.
Sure.
Like, gold star customer, you know. Like, I don't know, it seems to make sense.
API Tour55:48
Do we wanna maybe wrap with future things and kinda, like, how you think about designing and everything? So you just mentioned you wanna be the easiest way to basically do everything. What's the relationship with other people building in the developer ecosystem?
Like, I think at, uh, maybe in the early days it's like, "Okay, we only have these APIs," and then everybody helps us, but now you're kind of building a whole platform. How do you make decisions?
Yeah, I think kind of the 80/20 principle applies here. We'll build things that kind of capture, you know, 80% of the value and, and maybe leave the long tail to other developers. So we really prioritize by, like, how much feedback are we getting?
How much easier will make this, will this make something, like, an integration for a developer? So yeah, we, we, we wanna do more in this space and not just be an LLM as a service, but kind of AI development platform as a service.
Ooh, okay. That ties into a, a thing that I put in the, in the notes that we prepped. There are other companies trying to be AI development platform, so you will compete with them, or they... Do you just want to know what you won't s- uh, build so that they can build it?
Yeah. It's a tough question. I, I think we haven't, you know, determined what exactly we will and won't build, but you can think of something, if it makes it a lot easier for developers to integrate, you know, it's probably on our radar, and we'll, you know, stack rank by impact.
Yeah. I... So there's, like, cost tracking and model fallbacks. Model fallbacks is an interesting one because people do it. I don't think it adds a ton of value, but, like, if you don't build it, I have to build it because-
Right
... if one API's down or something, I, I need to fall back to another one.
Yeah. I mean, the way we're targeting that user need is just by investing a lot in reliability, and so we-
Oh, yeah.
We have-
Just don't fail.
I mean, we have improved our uptime, like, pretty dramatically over the last year, and it's been, you know, the result of a lot of hard work from folks. So you'll see that on our status page and, and our continued commitment going forward.
It's the important thing about owning the platform that it gives you the flexibility to put all the kind of messy stuff behind the, the scenes? Or, yeah, how do you draw the line between what you wanna include?
Yeah, I just think of it as, like, how can we onboard the next generation of, of AI engineers, as you put it, right? Like, what's the easiest way to get them building really cool apps? And I think it's by building stuff to kind of hide this complexity or just make it really easy to inte- integrate.
So I think of it a lot as, like, what is the value add we can provide beyond just the models that makes the models really useful?
Okay. We'll touch on four more features of the API platform that we prepped: Batch, Vision, Whisper, and then team enterprise stuff. So you wanted to talk about Batch.
Yeah.
So the rough idea is you give a... The, the contract between you and me is that I give you, give you the Batch job, you have 24 hours to run it, and, and it's kind of like Spot Inst for-
Sort of
... for a- of the API. What, what, what should people know about it?
Yeah. So it's half off, which is a great savings. It also works with, like, 4o mini, so the savings on top of 4o mini is, is pretty crazy. Like, the stuff you can do-
Like 7.5 cents or something per million.
Yeah. I should really have that number top of mind, but it's, like, staggeringly cheap. And so I think this opens up a lot more use cases. Like, let's say you have a user activation flow and you wanna send them an email, like, maybe every day or, like, at certain points in their user journey.
So now you can do this with the Batch API, and something that was maybe a lot more expensive and not feasible is now very easy to do. So r- right now we have this 24-hour turnaround time for half off, and, and curious, would love to hear from your community, like, what kind of turnaround time do they want?
I would be an ideal user of Batch, and I cannot use Batch because it's 24 hours. I need two to four.
Two to four hours, okay. Yeah, that's good to know. But yeah, just a lot of folks haven't heard about it. It's also really great for, like, evals, running them offline. Like, you don't, generally don't need them to come back within, you know, two hours.
Yeah. I think you could do a range, right? Two to four for me, like, I need to produce a daily thing, and then 24 for, like, the, the average use case, and then maybe, like, a week, a month, who cares?
Yeah.
Like, for people who just have a lot to do.
Yeah, absolutely. So yeah, that's Batch API. I think folks should use it more. It's pretty cool.
Is there a future in which, like, six months is, like, free? You know? Like, is there, like-
What?
... small-
Oh.
Is there, like, super small, like, shards of, like, GPU runtime that, like-
Maybe
... over a long enough timeline you can just run all these things for free?
Yeah, it's certainly possible. I think we're getting to the point where a lot of these are, like, almost free.
That's true.
Yeah. Why, why-
You're already close, but- Why, why would they work on something that's, like, completely free? I don't know. Okay, so Vision. Vision got GA'd. Like, last year people were so wowed by the GPT-4 demo-
Yeah
... and that was primarily Vision. Um, what was it like building the Vision API?
Yeah. The Vision API is super cool. We have a great team working there. I think the cool thing about Vision is that it works across our APIs, so there's... You can use it in the Assistants API, you can use it in the Batch API, in Check Completions, it works with Structured Outputs.
I think it just helps a lot of folks with kind of data extraction where, you know, the spatial relationships between the data i- is com- too complicated, and you can't get that over text. But yeah, there's a lot of really cool use cases.
I think the, the tricky thing for me is understanding how frequent to turn Vision into from, like, i- single images into, like, effectively just always watching.
Hmm.
And right now, I think people just, like, send a frame every s- every second. Will that model ever change? Will, will, will there just be, like, I stream you video and then
Yeah, I think it's very possible that we'll have an API where you stream video in, and maybe, you know, to start we'll do the frame, uh, sampling for you.
'Cause the frame sampling is, is the default, right?
Right.
But I, I feel like it's hacky.
Yeah, I think it's hard for developers to do, and so, you know, we should definitely work on making that easier.
Is there... In the Batch API, do you have, like, um, time, uh, guarantees, like order guarantees? Like, if I send you a batch request of, like, a video analysis, I need every frame to be done in order.
For Batch you send, like, a list of requests, and each of them stand alone.
Mm-hmm.
So you'll get all of them finished, but they don't kind of chain off each other.
Well, if you're doing a video, you know, if you're doing, like, a- analyzing a video, so you can have-
Oh, I wasn't linking video to Batch, but that's interesting. Okay.
Yeah. Well-
All right
... a video it's like, you know, if you have a very long video, you can just do a batch of all the images-
Yeah
... and let it process.
Well, it's a good idea.
If it's the same.
You could offer, like-
Batch but serially
... sequential true.
Yeah, yeah, yeah. Exactly.
You know?
Uh, but the whole point of Batch is you're just using kind of spare time to run it.
Right.
Let's talk about my favorite model, Whisper. Oliver, I, I built this thing-
We described this on, yeah.
Yeah, built this thing called Small Podcaster, which is a open source tool for podcasters, and why does Whisper API not have diarization when- ... everybody is transcribing people talking?
Yes.
That's my main question.
Yeah, it's a good question, and you've come to the right person. I actually worked on the Whisper API and, and shipped that. That was one of my first APIs I shipped. Long story short is that, like, Whisper V3, which we open sourced, has, I think, m- the diarization feature, but there's some, like, performance trade-offs, and so Whisper V2 is better at some things than Whisper V3.
And so it didn't seem that worthwhile to ship Whisper V3 compared to, like, the other things in our priorities.
Oh.
I think we still will at some point, but yeah, it's just... You know, there's always so many things we could work on. It, it's, it's tough to do everything.
We have a Python notebook that does the diarization-
Nice
... for the pod, but I would just like... You can translate, like, 50 languages-
Yeah
... but you cannot tell me who's speaking.
I feel like-
That was, like, the funniest thing
... there's, like, an xkcd thing about this, about hard problems in AI. I f- I forget the link.
Yeah, yeah. Exactly.
But there's like-
It's nonlinear
... tell me if this was taken in a park, and, like, that's easy, and it's like, tell me if there's a bird in this picture, and it's like, give me 10 people and a research team.
Yeah.
It's like you never know which things are, are challenging, and diarization is, I think, you know, more challenging than, than expected.
Yeah. It still breaks a lot with, like, overlaps obviously. Sometimes similar voices it struggles with. Like, I need to, like, double-read the thing.
Totally.
But yeah, great model. I mean, it would take us so long to do transcriptions, and I don't know why... Like, Small Podcast has better transcription than, like, mostly every-
Descripts
... commercial tool.
Oh, yeah.
It, it, it beats Descript.
Like, it-
Nice
... and I'm like, I'm just using the model. I'm literally not doing anything.
Yeah.
You know? It's just a notebook, so yeah, it just speaks to, like, sometimes just using the simple OpenAI model is better than, like, figuring out your own-
Yeah
... pipeline thing.
Totally.
I think the top feature request there just would be, um... I mean, s- again, you know, using you as a feature request dump
Yeah, totally
... is, uh, is, like, being able to bias the, the vocab. I think there is, like, in raw Whisper you can do that, but-
You can pass a prompt in the API as well
... in, in a... But you pass it in a prompt? Okay.
Yeah.
There's no more deterministic way to do it.
So you... This is really helpful when you have, like, acronyms that aren't very familiar-
Yeah
... to the model, and so you can put them in the prompt, and it... You'll, you'll basically get the transcription using those correctly.
We have the AI engineer solution, which is just a dictionary
Nice
... with, like, all the way misspelt it in the past-
Yeah
... and then gsub- ... and, like, replace the-
Listen, but if it works-
... the thing
... it works. Like, that's-
Ah
... that's engineering.
Yeah.
Okay.
It's like, you know, Lama with, like, one L-
Yeah
... or, like, all, all these different things, or like LangChain, it, like, transcribes LangChain in, like-
Capitalization does im- is important
... a bunch of, like, three or four different ways.
Yeah.
Um.
You guys should try-
It works
... the prompt feature.
I love these, like, kind of pro-tip. Okay, fun question that I know we don't know yet, but I've been enjoying the Advanced voice mode. It really streams back and forth, uh, and it handles interruptions. How would your audio endpoint change when, when that comes out?
We're exploring, you know, new shape of the API to see how it would, would work in this kind of speech-to-speech paradigm. I don't think we're ready to share quite yet, but we're definitely working on it, and I think just the regular request response probably isn't going to be the right solution.
For those who are listening along, I, I think it's pretty public that OpenAI uses LiveKit for the, for the ChatGPT app, which, like, seems to be the socket-based approach that people should be at least up to speed on.
Like, I think a lot of developers only do request response-
Right
... and, like, that doesn't work for streaming.
Yeah. When we do put out this API, I think we'll make it really easy for developers to figure out how to use it. Yeah.
Yeah.
It, it's hard to do audio.
It'll be a paradigm change. Okay, and then I think the last one on our list was team enterprise stuff. Audit logs, service accounts, API keys, what should people know-
Yeah
... is in the enterprise offering?
Yeah, we recently shipped our admin and audit log APIs, and so a lot of enterprise users have been asking for this for a while, the ability to kind of manage API keys programmatically, manage your projects, get the audit log.
So we've shipped this, and, and for folks that need it, it's, it's out there, and happy for your feedback.
Yeah. Awesome. I don't use them, so I don't know. I, I imagine it's just, like, build your own internal gateway for-
Yeah
... you know, your internal developers to manage your deployment of OpenAI.
Yeah, I mean, if you work at, like, a company that needs to keep track of all the API keys, it was v- it was pretty hard in the past to do this in the, in the dashboard. We've also improved our SSO offering, so that's, uh, much easier to use now.
The most important feature-
Yeah
... of any enterprise company.
People love SSO.
Personal Insights1:06:09
All right, let's go outside of OpenAI. What about just you personally? So you mentioned Waterloo. Maybe let's just do why is everybody at Waterloo cracked, and why are people so good, and, like-
Yeah
... why have people not replicated it? Or any other commentary on your experience.
The first is the co-op program. It's obviously really good. You know, I did six internships, learned so much in those. I think another reason is that Waterloo is, like- You know, it's very cold in the winter. It's pretty miserable.
There's, like, not that much to do apart from study and, like, hack on projects, and there's this big, like, hacker mentality. You know? There's a... Hack the North is a very popular hackathon, and there's a lot of, like, startup incubators.
It kind of just has this, like, startup and hacker ethos. Then that combined with the six internships means that you get people who, like, graduate with two years of experience, and they're very entrepreneurial and, you know, they're down to grind.
I do notice a correlation between climate and the correctness of engineers. Uh, so, you know, it's no coincidence that Seattle is the birthplace of Microsoft and, and Amazon. I think I had this, uh, compilation of Denmark, where, uh, people, like...
Uh, so it's the birthplace of C++, PHP, Turbo Pascal, Standard ML-
Wow
... BNF, the, the thing that we just talked about, MD5Crypt, Ruby on Rails, Google Maps, and V8 for-
Wow
... for Chrome, and it's 'cause according to Bjarne Stroustrup, the creator of C++, there's nothing else to do.
Yeah. Well, you have- ... Linus Torvalds in Finland, right?
Yeah, yeah.
Yeah. I mean, you hear a lot about this, like, in relation to SF. People say, you know, "New York is way more fun. There's nothing to do in SF," and maybe it's a little by design that all, all tech is here.
The climate is too good.
Yeah.
If we had- if we also have fun things to do.
Nature is so nice. You can touch grass. Why- why are we not touching grass?
But, like, you know, restaurants close at, like, 8:00 PM.
Yeah.
Like, that's what people are referring to. There's not a lot of, like, late night dining culture or- Yeah. So you're- you have time to wake up early and, and get to work.
You are a book recommender or book enjoyer. Uh, what underrated books do you recommend most to others?
Yeah, I think a book I read somewhat recently that was very formative was The Making of the Prince of Persia. It's a Stripe Press book. That book just made me wanna work hard like nothing I've ever read. It's just, like, this journal of, of what it takes to, like, build, you know, incredible things.
So I'd recommend that.
Yeah. It's funny how video games are for a lot of people, at least for me, kind of like the, some of the moments-
Yeah
... in technology. Like, when I played The Sands of Time on PS2, it was, like, my first PlayStation 2 game.
Mm-hmm.
And I was like, "Man, this thing is so crazy compared to any PlayStation 1 game."
Right.
And it's like, wow. My expectations for, like, the technology, I, I think, like, OpenAI has a lot of similar things, like the advanced voice. It's like you see that thing and then you're like, "Okay, what I can expect from everybody else-
Right
... is kind of raised now."
Yeah.
You know?
Totally. Another book I like to plug is called Misbehaving by Richard Thaler. He's a behavioral economist and talks a lot about how people act irrationally in terms of decision-making, and I actually think about that book, like, once a week probably, at least when I'm making a decision and I realize that, you know, I'm falling into a fallacy or, you know, it could be a better decision.
Yeah. You did a minor in psych.
I did, yeah. I don't know if I learned that much there, but it was interesting.
Did you... Is there, like, an example of, like, a cognitive bias or misbehavior that-
Yeah, um-
... you just love telling people about?
Yeah, people... So let's say you won tickets to, like, a Taylor Swift concert.
Uh-huh.
And I don't know how much they're going for, but it's probably, like, $10,000.
Oh, okay.
Or whatever. Sure. And, like, a lot of people are like, "Oh, I have to keep these. Like, I won them. It's $10,000." But really it's the same decision you're making if you have $10,000, like would you buy these tickets?
And so people don't really think about it rationally, like would they rather have $10,000 or the tickets. For people who want it, a lot of the time it's gonna be the $10,000, but their bias is because they want it.
The w- world organized itself this way, and you should keep it for some reason.
Yeah, yeah. Oh, okay. I'm pretty familiar with this stuff. There- there's also a loss version-
Yes
... a loss of version version of this where it's like if I take it away from you-
Right
... you respond mo- more strongly than if I give it to you.
Yes. Yeah, people are, like, really upset if they, like, don't get a promotion, but if they do get a promotion, they're like, "Okay, phew." It's, like, not even, you know, excitement. It's more... Like, we re- react a lot worse to losing something.
Which is why, like, when you join, like, a new platform, they often give you points and then they'll take it away if you, like, don't do some, some action-
Yeah
... uh, in, in, like, the first few days.
Yeah, totally. Yeah. Uh, the book references people who w- like, operate very rationally as econs, as, like, a separate group to humans.
Oh.
And I often think, like, you know, what would an econ do here in this moment and, and try to act that way.
Okay. Let's, let's do this. Are LLMs econs?
I mean, they are maximizing probability distributions and-
Minimizing loss.
Yeah. So I think way more than all of us, they are econs.
Whoa, okay. So they're more rational than us? Hmm.
I think their optimization functions are more clear than ours.
Yeah, just to wrap, you mentioned, uh, you need help on a lot of things.
Yeah.
Any specific roles, call-outs, and also people's backgrounds, like is there anything that they need to have done before? Like, what people fit well at OpenAI?
Yeah. We've hired people with all kinds of backgrounds, people who have PhD in, in ML or, or folks who've just done engineering like me, and we're really hiring for a lot of teams. We're hiring across the applied org, which is where I sit for engineering, and for a lot of researchers, and there's a really cool model behavior role, um, that we, we just dropped.
So yeah, across the board would recommend checking out our careers page, and, and you don't need a ton of experience in AI specifically to, to join.
I, I think one thing that I'm trying to get at is, like, what kind of person does well at OpenAI? I think objectively you have done well, and I've seen other people not do as well and, and, and ba- basically be managed out.
I know it's an intense environment.
I mean, the people I enjoy working with the most are kind of low ego, do what it takes, ready to roll up their sleeves, do what needs to be done, and, and unpretentious about it. Yeah, I also think folks that are, are very user-focused do well on, on kind of API and ChatGPT.
Like, the YC ethos of build something people want is, is very true at OpenAI as well. So I would say low ego, user-focused, driven.
Um, cool. Yeah, this was great. Thank you so much for coming on.
Yeah. Thanks for having me.






