Publications
Building with language models, not just chatting with them
A year and a half after ChatGPT, the interesting part isn't the chat anymore. What I've learned putting language models inside real features.
Publié
Temps de lecture
2 minutes
Article
So, it’s been about eighteen months since ChatGPT came out, and funny enough, chatting is now the least interesting thing I do with a model. More and more of my work puts a model inside a feature, where nobody even sees a chat box, and that’s a whole different job, it took me a few mistakes to realize just how different.
A model is an unreliable function
In a chat, a slightly wrong answer is fine, you read it, you fix it, you move on. In a feature though, the answer goes straight into your code, and your code expects a certain shape, so rule number one, ask for structure. Models can now return JSON on request, or call functions you describe to them, and every response I get gets validated against a schema before anything else touches it, if it doesn’t match, the code retries or falls back, it never guesses.
Small tasks beat big prompts
The features that work best ask one narrow thing, classify this, extract that, suggest three options. The ones that ask a model to do everything in one giant prompt? They work great in the demo, and fall apart the moment real data shows up. Splitting a task into small steps makes each one easier to check, and when something fails, I actually know which step it was.
Give it the context
A model knows what it was trained on, not what’s in your database or your docs, and hoping it somehow knows is exactly how you get confident nonsense. The fix is retrieval, find the few documents that matter for this question, and put them right in the prompt. Then ask it to answer only from what it’s been given, and to say so when the answer isn’t there, that alone cuts most of the made-up answers.
Check what comes back
Prompts behave like code without a compiler, a small change can quietly break cases that used to work, and so can a new model version. So keep a set of real examples with the answers you expect, and run it every time the prompt or the model changes. It’s nothing fancy (closer to unit tests than to research), but it’s the only way to tell whether a change made things better or just different.
Count the tokens
Every call costs money and time, and long prompts, long contexts and retries add up real quick once actual users show up. Streaming the answer makes the wait feel shorter, caching repeated questions makes it disappear, and honestly, a smaller model is often enough for those narrow tasks.
Keep a person in the loop
The model suggests, a person decides. And that’s not only about safety, it’s also what makes users trust the feature, they stay in charge, and the model saves them time instead of making choices for them.
Suivant
Writing an interpreter in our group's slangouLes 21 publicationsouAu hasardouAccueil