DEV Community

Multigrid
Multigrid

Posted on • Originally published at multigrid.ai

Getting British Spelling Instead of American Spelling From AI

You put “use British English spelling” in the system prompt. The first three paragraphs are fine. By paragraph nine there is a color, and by the end there is an organization. The instruction was not ignored; it was outvoted.

The symptom

The characteristic pattern is not uniform failure. It is a document that starts correct and degrades — and the degradation is usually inconsistent within the document, so you get colour in one paragraph and color two paragraphs later, sometimes in the same sentence as behaviour. Long outputs are worse than short ones, and a long conversation is worse than a single call.

A second symptom is domain-specific: the spelling holds in ordinary prose and fails in technical contexts. Code comments, API field names, CSS properties and library names are American by convention (color is a CSS property; serialize is what the method is called), and text near them pulls the surrounding prose across.

Both patterns point at the same cause, and it is not that the model did not read the instruction.

Why it drifts back

Each token is sampled from a distribution conditioned on everything in the context. The system prompt is part of that context, but so are the two thousand tokens the model has generated since, and so is the enormous prior from training data in which American spelling outnumbers British by a wide margin in almost every technical domain.

At the start of a response the instruction is close by and there is little else in the context, so it dominates. As the response grows, the local statistics of the text being generated carry more weight relative to a single instruction several thousand tokens back. And the drift is self-reinforcing in exactly the way described in mid-answer code-switching: once one American spelling is in the context, the conditional probability of the next one rises.

The key insight for fixing it is that spelling is not a mode the model is in. There is no British-English state that gets set and then holds. Each word is an independent draw, influenced by context, and a single instruction cannot beat a strong prior across two thousand independent draws. That is why “ask more firmly”, “put it in capitals” and “repeat the instruction three times” all produce marginal improvements and none of them produces reliability.

Every class of word that differs

The differences are systematic, which is what makes a deterministic fix possible. There are seven productive classes plus a list of one-offs.

  • -our / -or. colour, behaviour, favour, honour, labour, neighbour, humour, rumour, vapour, flavour, harbour, endeavour. Note the exceptions that keep -or in both: horror, error, mirror, terror. Note also that the -our is dropped in some derived forms even in British English: humorous, laborious, vigorous.
  • -re / -er. centre, metre, theatre, litre, fibre, sombre, calibre, spectre. Careful: meter is correct British English for a measuring device, and metre only for the unit of length.
  • -ce / -se noun-verb pairs. British distinguishes the noun licence from the verb license, the noun practice from the verb practise, the noun defence from American defense. American collapses the first two. This class is the hardest to fix mechanically, because it needs the part of speech.
  • Doubled consonants before a suffix. travelled, cancelled, modelling, labelled, marvellous, counsellor, jeweller, signalling. American uses a single l. Running the other way, British has a single l in skilful, fulfil, enrol where American doubles it.
  • -ogue / -og. catalogue, dialogue, analogue, monologue. American allows the short forms.
  • ae / oe digraphs. paediatric, anaemia, encyclopaedia, foetus, oesophagus, manoeuvre. Mostly medical, and they matter disproportionately because medical writing is where a wrong spelling is most conspicuous.
  • -yse / -yze. analyse, paralyse, catalyse. This one is not optional in British English — unlike -ise/-ize, discussed below, there is no British tradition of -yze.
  • One-offs. aluminium/aluminum, tyre/tire, kerb/curb, cheque/check, grey/gray, storey/story (a floor), plough/plow, draught/draft, programme/program (though program is correct British English for the computing sense), speciality/specialty, whilst/while.

The -ize trap

The most common mistake in a spelling instruction is asserting that British English uses -ise and American uses -ize. It is not that simple, and getting it wrong makes your instruction incoherent.

Oxford University Press house style, used by the Oxford English Dictionary and by a number of British academic publishers, uses -ize in British English on etymological grounds — organize, realize, recognize. Most other British publishing, including most newspapers and the Cambridge house style, uses -ise. Both are correct British English. The OED documents its own -ize convention.

Two consequences. First, decide which convention you want and say so by name — “British English with -ise spellings” or “Oxford spelling” — rather than saying “British spelling” and hoping. Second, if you choose -ise, note that a set of verbs takes -ise in both conventions because the ending is not the Greek suffix: advertise, advise, comprise, compromise, despise, devise, exercise, improvise, revise, supervise, surmise, surprise, televise. A blind ize → ise substitution is safe; the reverse is not, because it produces advertize and surprize.

The fix that holds

Prompting reduces the rate; it does not eliminate it. The reliable approach is layered.

  1. Name the convention precisely in the system prompt. “British English, Cambridge/Guardian style: -ise not -ize, -our, -re, -yse, doubled l before suffixes, licence as a noun and license as a verb.” Naming the classes gives the model something specific to condition on.
  2. Generate in sections rather than one long pass. Drift is a function of distance from the instruction, so several 600-word calls with the instruction fresh in each beat one 4,000-word call. This is the single most effective prompt-side change.
  3. Repeat the convention at the end of the user turn. The last tokens before generation have the most local influence on the first tokens produced.
  4. Run a deterministic post-pass. A substitution list over the classes above, applied with word boundaries, fixes everything except the -ce/-se pairs and the one-offs that need sense disambiguation. This is the step that turns “usually right” into “right”, and it costs nothing per call. Existing spell-check dictionaries with a British locale do most of the work.
  5. Exclude code, identifiers and quotations from the pass. A CSS color property, a serialize method name and a quoted American source must not be “corrected”. This is the step people skip, and it breaks builds.

The general principle generalises past spelling: any output constraint that can be checked mechanically should be checked mechanically rather than trusted to an instruction. That applies to variety selection in Portuguese and Spanish for exactly the same reason, and to the broader case of output that ignores a language instruction.

One thing worth knowing before you tune prompts: the baseline drift rate differs noticeably between model families, because their post-training data differs in how much non-American English it contains. If you can run the same document through two or three models behind one key and count the substitutions your post-pass has to make, that comparison is cheap and it tells you more than prompt iteration on a single model will.

Related

Top comments (0)