JB Astau

Reflection 01 · Applied AI

What about hallucinations?

The model names, the database provides. Why the Carnet Catalan assistant never writes an address itself, and how that answers the first question companies ask about AI.

“What about hallucinations?” It is the first question any manager asks as soon as generative AI comes up. It is a fair one. In a travel guide, a hallucination is anything but abstract: a restaurant that closed two years ago, the wrong opening hours, or a pin dropped on a map in the middle of a field.

A precise error is invisible

A false sentence can be spotted on a second read. A false latitude cannot. It looks just as precise as a real one, and once it is on the map, it carries authority.

My assistant gave me very concrete examples. It wrote a link to a hiking page that did not exist. It announced a Sunday that was actually a Saturday. Nothing in the tone set these sentences apart from the others.

The rule: separate words from facts

So I split the roles. The model understands the question, picks criteria and names places. Everything factual, the address, the opening hours, the coordinates, the link, comes from the database, never from the generated text.

In practice:

  • the model cannot write a link: only those returned by the search tools survive;
  • if a name appears in bold in the answer without being in the results, the code asks for a rewrite;
  • days of the week are computed by the code, no longer by the model;
  • when the question touches on something the database does not know, such as “where is my dog welcome?”, and the answer does not say so, the server adds the warning itself.
THE MODELUnderstands and namescriteria, intent, place names
THE DATABASEProvides the factsaddresses, opening hours, coordinates, links
THE CODEChecks before sendinga name missing from the results triggers a rewrite
Who is allowed to write what in a Carnet Catalan answer.

Why not an instruction in the prompt

The natural reflex is to add instructions: “check your facts”, “don’t state anything you don’t know”. I tried, and that is what made me change my approach.

At the time, the model decided everything in a single pass: show the map or answer in text, pick the criteria, write. I added a few instructions, including one about questions built on a false premise. On “where to eat in Collioure”, asked twenty times, the map used to appear 19 times. After those additions, 9 times. The instructions had nothing to do with the map. They simply tipped the model towards answering in text.

Nobody noticed at the time. The answers looked normal, and my checks did not include that question. That is why I built an evaluation bench the very next day.

19 → 9 / 20

Maps shown for the same question asked twenty times, before and after adding a few instructions to the prompt.

The lesson came back later, in another form. I added a parameter to a search tool to filter events by genre. On “two days in Perpignan, culture and food”, an unrelated question, the map went from 5 appearances out of 6 to 0. This time the bench caught it. The filter stayed, but in the code: the code spots the genre in the question, not the model.

Since then, the rule is simple: whatever must be true is guaranteed by the code. The prompt guides the model; it does not police it. And every word added to the prompt or to a tool can change behaviour somewhere else, which only shows up when you measure.

What the guardrail does not cover

The automatic checks verify bold names, links and dates. They do not read everything. A second model, tasked with grading the answers, still finds details that do not come from the data: a bus line number, a slightly wrong figure. The architecture reduces fabrication; it does not eliminate it. That needs saying, and measuring has to continue.

What it means for a company

When a client asks “what about hallucinations?”, the best answer is not “our model is very reliable”. It is: “here is what the model is allowed to write, here is what always comes from your data, and here is how we check it still holds after every change”.

Separating language from facts is an architecture decision. It costs less than a bigger model, and it can be verified.