title generation (text2text-generation) · text · WASM · ~80 MB
Give it a paragraph or a whole article and this model writes a headline for it — not a summary of every point, a single short line meant to make you click. Because writing a title is generation, there is no one right answer: ask for the one best line and you get beam search; turn on sampling and the same model on the same article proposes a whole set of different candidate headlines to choose from. Nothing leaves your device.
| Model | ldenoue/Title_Generation_T5Small_Model |
|---|---|
| Task / pipeline | text2text-generation (seq2seq) — article in, headline out |
| Input convention | the article text, prepended with T5's summarize: task prefix (this fine-tune's training format) |
| Architecture | T5 (encoder–decoder) fine-tuned on the 190k Medium-articles title dataset |
| Quantization | q8 (8-bit) ONNX |
| Backend | WebAssembly (runs anywhere; no WebGPU needed) |
| Download | ~80 MB (quantized encoder + merged decoder), cached after first load |
| License | MIT |
| Web APIs | WebAssembly, Web Workers — all Baseline widely available |
This is title generation, a distinct text-to-text job from summarisation: it emits one short catchy line, not a shrunk-down version of the text. It's also distinct from the instruction-tuned FLAN-T5 and the prefix-driven T5-base demos.
Paste an article or a paragraph. Pick Best for one beam-search headline, or Candidates to sample several different options with the temperature / top-k controls.
Best headline
Sampled candidates — same model, same article, different draws
The model never sees your article as words — it sees the exact string below (its summarize:
prefix highlighted) split into SentencePiece sub-word tokens. The best headline is then decoded one token
at a time; the timeline shows how long each output token took. Sampling doesn't change the input — it
changes which token the decoder picks at each step, which is why the candidates above diverge.
Exact string fed to the model (prefix highlighted):
Input tokens
Best-headline decode timeline (ms per output token)
Every article, product, email and video needs a title, and a good one is the difference between being read and being scrolled past. A title model turns that from a blank-page problem into a pick-from-a-list problem — generate a handful of options in a tab, on-device, for free, and choose. At ~80 MB it runs entirely in the browser, so a CMS, an email tool, or a note-taking app can offer headline suggestions with no server, no per-call cost, and nothing about the draft ever leaving the writer's machine.
One article in, one headline out — the fundamental article→title job.
A/B headline generator: sample a batch of candidates a copywriter can choose between.
Clickbait vs. neutral: contrast low- and high-temperature headlines from the same article.
Summarise a long article first, then headline the summary — a two-model pipeline.
Pairs naturally with the DistilBART summariser for the multi-model summarise-then-title pipeline.
It's an ordinary text2text-generation pipeline; the only trick is the training prefix and the
choice of decoding strategy:
import { pipeline } from "@huggingface/transformers";
const generate = await pipeline(
"text2text-generation",
"ldenoue/Title_Generation_T5Small_Model",
{ device: "wasm", dtype: "q8" },
);
const input = "summarize: " + article; // this fine-tune's input convention
// One "best" headline — beam search, deterministic:
const [best] = await generate(input, { max_new_tokens: 24, num_beams: 4, no_repeat_ngram_size: 2 });
// A spread of candidates — sampling, different every call:
const [draw] = await generate(input, { max_new_tokens: 24, do_sample: true, temperature: 1.0, top_k: 50 });
All inference runs in a Web Worker so generating a batch of candidates never janks the page. The best
headline is streamed token-by-token via a TextStreamer for the decode timeline.