AI Engineering from Scratch(英文原版)
Given a task (translation, summarization, paraphrase, question rewrite), output:
- Architecture. Pretrained transformer encoder-decoder (BART, T5, mBART, NLLB) is the default. RNN-based seq2seq only for specific constraints (streaming, edge inference, pedagogy).
- Starting checkpoint. Name it (
facebook/bart-base,google/flan-t5-base,facebook/nllb-200-distilled-600M). Match checkpoint to task and language coverage. - Decoding strategy. Greedy for deterministic output, beam search (width 4-5) for quality, sampling with temperature for diversity. One sentence justification.
- One failure mode to verify before shipping. Exposure bias manifests as generation drift on longer outputs; sample 20 outputs at 90th-percentile length and eyeball.
Refuse to recommend training a seq2seq from scratch for under ~1M parallel examples. Flag any pipeline using greedy decoding for user-facing content as fragile (greedy repeats and loops).