Haku Lab

Experiment

Resolving natural-language dates with a tiny specialist model

Large language models are surprisingly unreliable at dates — "next tuesday at 6pm," "end of the quarter," "in three weeks" quietly turn into the wrong day. So don't ask the model to do calendar arithmetic. A tiny (14M) specialist maps the phrase to a small structured grammar (e.g. wd next fri 15 00), and a few lines of ordinary code resolve that against the current time. The model only has to learn language → structure; the arithmetic is exact and deterministic.

Note. A compact, focused specialist (14M) — it handles relative offsets, weekdays, named days, and most everyday phrasings reliably. A few constructions still trip it (some spelled-out numbers, unusual idioms); it’s a prototype scoped to date resolution, not a general parser.
WhatValue
Model size14.5M parameters
Layers × width × heads6 × 384 × 6
Training pairs (synthetic)100,000
NSDataDetector on typical phrases, for comparison~72%

Examples of the grammar it emits: off hr +2 for “in two hours”, wd next fri for “next friday”, bnd eom for “end of the month”.

No live demo. This page used to call a hosted copy of the model. That host is off, so the numbers above stand in for it.

Method

The model is a ~14M-parameter decoder that reads now=<ISO> | <phrase> and emits a compact grammar — relative offsets (off hr +2), weekdays (wd next fri), boundaries (bnd eom), named days (nm christmas), and so on. A deterministic resolver turns that grammar into an exact ISO datetime with the current time as reference. Keeping the arithmetic out of the network is the whole point: the model never has to count days or carry months, so a tiny specialist can be both fast and reliable at the part it is good at — understanding the phrase.

Get new experiments

Occasional notes when we publish. No spam.