Views
No views yet
2024-03-10 | the 3rd of July 2025 => 2025-07-03
2024-03-10 | Jun 12 2023 => 2023-06-12
2024-03-10 | next week => 2024-03-17
2024-03-10 | in 3 months => 2024-06-10today) at the start of the prompt, so
relative phrases ("tomorrow", "in 3 weeks") are computable from the input alone —
it never needs a wall clock.train.py / eval.py / data generator / tests).
Technical report (PDF): nano-dates-report.pdf — the
recipe, the data-leak bug, and where a 1M model's reasoning breaks.
| capability | category | accuracy |
|---|---|---|
| Parse absolute dates | 2023-06-12, June 12, 2023, Jun 12 2023, 12 June 2023, the 12th of June 2023 | 100% |
| Resolve simple relatives | today, tomorrow, yesterday, next/last week, next month, in N months | 98–100% |
| Variable-N day/week arithmetic | in N days, N days ago, in N weeks | 77–81% |
| Weekday resolution | next/last <weekday> | ~12% ❌ |
| Overall | mixed | 85.4% |
modeling_nano_dates.py)
— no training framework required, just torch and safetensors.modeling_nano_dates.py, model.safetensors,
config.json) and run:1pip install torch safetensors huggingface_hub
2python - <<'PY'
3from huggingface_hub import hf_hub_download
4for f in ["modeling_nano_dates.py", "model.safetensors", "config.json"]:
5 hf_hub_download("vukrosic/nano-dates", f, local_dir=".")
6PY
7python -c "from modeling_nano_dates import load, parse; m=load(); print(parse(m,'2024-03-10','next month'))"
8# -> 2024-04-101from modeling_nano_dates import load, parse
2
3model = load("model.safetensors", "config.json")
4print(parse(model, "2024-03-10", "the 3rd of July 2025")) # -> 2025-07-03
5print(parse(model, "2024-03-10", "next month")) # -> 2024-04-10python modeling_nano_dates.py.<reference ISO date> | <phrase> => <answer ISO date>parse() builds that prompt and greedily decodes exactly 10 characters.Set up the nano-dates model from Hugging Face (vukrosic/nano-dates) and run inference.
1. pip install torch safetensors huggingface_hub
2. Download three files with huggingface_hub.hf_hub_download("vukrosic/nano-dates", f)
for f in ["modeling_nano_dates.py", "model.safetensors", "config.json"].
3. The model is a single self-contained file exposing load() and
parse(model, today_iso, phrase) -> ISO-8601 string.
4. Run:
from modeling_nano_dates import load, parse
m = load()
for p in ["the 3rd of July 2025", "next month", "Jun 12 2023", "yesterday"]:
print(p, "->", parse(m, "2024-03-10", p))
5. Report outputs. Known limits: absolute dates + simple relatives ~100%,
variable-N day/week math ~77-81%, weekday phrases ("next friday") ~12% — a
1M-param capacity ceiling, not a bug. This is a capability demo, NOT a production
date parser; for production use dateutil/chrono.| Parameters | 1,016,960 |
| Architecture | decoder-only transformer (pre-norm) |
| Tokenizer | raw UTF-8 bytes (vocab 256, no vocab file) |
| dim / layers / heads | 128 / 4 / 4 (2 KV heads, GQA) |
| Norm / position / FFN | RMSNorm / RoPE / SwiGLU |
| Context | 64 bytes |
| Training | SFT, prompt-masked cross-entropy, 12k steps, AdamW, cosine LR 3e-3 |
| Data | 100k code-generated pairs, 17 surface renderers |
| Final val loss | 0.036 |
dateutil/chrono are
exact and free. This model's value is as a method demonstration and a study of
what a nano model can learn from synthetic data, not as a dependency.