veden.

Dakar → Paris, on the whiteboard · episode 9 of 10

Home

9Dakar → Paris, on the whiteboard · episode 9 of 10

Getting AI to write without making things up

An artificial intelligence that writes well can also be confidently wrong. It can return a flawless text that says nothing, take a rumour for a fact, or slip in a detail it was never given.

This episode covers three of these traps, which we ran into for real in our travel log, and how we spotted them, fixed them and proved the fixes.

The writing step sends each ten-minute slice to Claude Opus and receives a list of events constrained by a JSON schema. It produced valid but empty answers, facts drawn from mere hints, and published texts that needed correcting.

On the agenda: structured output and the limits of the schema, the “what goes in, what comes out” check, proof of a fix, instructions written like a contract, and the minimal correction of already published texts, verified by invariants.

Independent Veden project, not affiliated with Nico, Ascend or their partners.

Dennys Salioski · 10 min

Move forward with the arrow → or the Next button. “Discovery / Technical”, at the top, changes the level of the text; “Listen” reads it aloud.

9The format

A well-formed answer is not a good answer

So that a program can use what the AI writes, we impose a form on it: a time, a title, a summary, quotes, an importance rating. The AI is obliged to fill it in correctly.

But a well-filled form can say nothing. The AI can write “to be completed” in every box, and the program is none the wiser.

Claude is called in non-interactive mode (claude -p) with a JSON schema: the output is constrained and validated. Each event has its required fields, and an empty list is a permitted answer, so that a slice of silence produces nothing.

The schema guarantees the form. It guarantees nothing about the substance: an event can have all its fields filled in and tell nothing. That is exactly what happened.

9The symptom

5 hours 20 minutes of livestream vanished, without an error

While checking the travel log, we found 33 fake moments titled “placeholder”, an English word meaning “to be filled in”. Our first idea: night-time moments, when nothing was happening. So we hid them.

Then we counted the words spoken. Those moments were not silent at all: in total, 5 hours 20 minutes of livestream were missing from the travel log. By hiding the symptom, we had nearly made the hole invisible.

A side check found 33 fake “placeholder” events, 24 of them visible online. First reassuring explanation: night-time slices, where the model fills in for lack of material. They were filtered out at display time.

Before stopping there, we counted the words spoken: the 32 slices concerned contained between 500 and 1,750 words of speech, most of them over 900. That is 5 hours 20 minutes of livestream missing, spread over seven days. Rerun identically, two of them gave 5 and 4 real events: a one-off failure of the model, impossible to reproduce on demand.

livestream missing from the travel log, with no error at all

5 hours 20 minutes

32 ten-minute slices, over seven days.

9The check

Comparing what goes in with what comes out

The fix is simple: if we gave the AI ten minutes full of speech and it says nothing, that is suspicious. We ask again, once. If it still says nothing, we flag it instead of silently accepting it.

Result: almost all the lost slices were recovered. Three remain empty, and we say so.

From 300 words spoken upwards, a slice with no real event is rerun once; if it stays empty, an alert is written. Only one rerun, because the failures are one-off and rerunning endlessly would mask a real problem.

Of the 32 slices, 29 gave real events, 134 in total, added to the days without touching the rest. Three slices, that is 30 minutes, remain empty after two attempts, with no explanation found: they are flagged.

See the code: rerun once, then alert (simplified version)
SEUIL_MOTS = 300

def est_reel(e) -> bool:
    return e["title"] not in ("", "placeholder") and e["summary"] != "placeholder"

def ecrire_tranche(demande: str, nb_mots: int, appeler, alerter) -> list:
    evenements = [e for e in appeler(demande) if est_reel(e)]
    if nb_mots >= SEUIL_MOTS and not evenements:
        evenements = [e for e in appeler(demande) if est_reel(e)]   # a single rerun
        if not evenements:
            alerter(f"tranche vide pour {nb_mots} mots prononcés")   # in production: a “⚠” line picked up by the hourly script
    return evenements

9The proof

Proving that a fix breaks nothing

Fixing is good. Proving that nothing else was broken is better. We first wrote a test that reproduces the problem, and checked that it failed with the old program.

Then we compared the travel log before and after, on a frozen copy of the data: only the fake moments disappeared, everything else is identical.

Every fix follows the same method: a test that reproduces the problem and fails on the old code; the same test passing on the new code; and, on a frozen copy of the real data, the travel log export before and after, where only the fake events disappear, everything else being identical byte for byte.

The third step is the one most often forgotten. Yet it is the only one that answers the question that matters: what have I broken elsewhere without seeing it?

9The instructions

Instructions written like a contract

The AI fills gaps with whatever seems plausible. So our instructions tell it who is who, and how each first name is spelt. They remind it that a project being discussed is not a place that has been reached.

They ask it to state what is certain and stay silent about the rest, and to stay neutral about people met along the way, who did not choose to appear in a public travel log.

Four rules joined the instructions, each after a real problem. Who is who: a single glossary of recurring people, their roles and spellings, shared by the instructions for moments, blocks and days. Doing or talking: “discussion about Morocco” is not “arrival in Morocco”.

State or stay silent: write the facts without “according to the moderators” or “according to a clip”, but only when a sufficient source supports them. Neutrality: do not report compromising remarks about the people met. Each rule is tested on real cases: the one about stating had an unexpected effect (step 7).

9Correcting

Correcting without rewriting

Hundreds of already published texts had to be corrected: times off by two hours, roles mixed up, over-cautious sentences. Having them rewritten entirely would have changed correct texts, with nobody rereading them.

So we asked the AI to change only what was strictly necessary, then a program checked that nothing else had moved: no quotes, no numbers, no names. A human reread every change before it went online.

Instruction: “change only this, keep the rest word for word”. The checker verifies invariants: identical quotes, identical numbers, no proper noun gone, almost no new word (three tolerated, see the next step). A before/after page highlights each change for human review. We correct a copy, never the published data.

Three campaigns: times and roles (76 passages modified, 129 moments touched up, 4 filler blocks removed); moments recovered (60 added, 3 duplicates discarded above 0.75 similarity); state or stay silent (143 texts corrected, 12 moments removed as purely speculative).

9The tolerance

“0 anomalies” said more than it measured

Our checker let through up to three new words per text, for small grammatical agreements. It showed “0 anomalies”.

On rereading afterwards, we saw that in some texts, those few words had turned a simple clip title, written by a viewer, into an established fact. The lesson: a tolerance threshold must be written in black and white, and a rule must say which source a fact may rest on.

The third campaign's checker tolerated up to three new words per text. After publication, 20 texts out of 143 contained between one and three. Some were down to grammar; the others had changed in nature: “an extract titled X suggests that…” had become an assertion, a clip's title passing for a fact.

Two lessons: a tolerance threshold must appear in the report, otherwise “0 anomalies” says more than it measures; and “state or stay silent” must specify which sources are sufficient. The instructions now say so: a moderator's note or a clear clip can be stated; what remains uncertain, like a clip title you don't understand, is not written.

texts with 1 to 3 new words, under the threshold

20 / 143

some had turned a clip title into a fact.

9In summary

What to remember

  • A well-formed text can say nothing: you have to check the substance, not just the form.
  • Compare what you give the AI with what it returns: that is how we found 5 hours 20 minutes that had been lost.
  • Precise instructions: who is who, doing or talking, state or stay silent, neutrality.
  • Correct without rewriting, check what must not move, and write your thresholds down in black and white.
  • The schema guarantees the form; a separate check verifies the substance.
  • Rerun once, then alert; never filter out a symptom without measuring it.
  • Prove every fix: test red then green, identical export on frozen data.
  • Minimal correction, invariants verified by program, human review on a before/after.
Episode 10 of 10 Time, days and the review

13:24 or 15:24? Time zones, the end of a day, and what all this cost.

An AI already in place, writing on your behalf?

We can measure what it lets through, and correct it without rewriting everything. Write to me: we will look together at what is feasible.

Let's talk about your project