flan-t5-small

google/flan-t5-small

google 468K downloads apache-2.0 Other
Frameworkstransformerspytorchtfjaxsafetensors
Languagesenfrrodemultilingual
Datasetssvakulenk0/qrecctaskmaster2djaym7/wiki_dialogdeepmind/code_contestslambadagsm8k
Tagst5text2text-generation
Downloads
468K
License
apache-2.0
Pipeline
Other
Author
google

Run flan-t5-small locally on a Q4KM hard drive

Looking for the fastest, plug‑and‑play deployment? Q4KM hard drives are pre‑loaded with FLAN‑T5‑Small, delivering instant inference on any compatible server. Get this model on a Q4KM hard drive...

Shop Q4KM Drives

Technical Overview

Model ID: google/flan-t5-small
Model name: FLAN‑T5‑Small
Author: Google

FLAN‑T5‑Small is a text‑to‑text transformer that builds on the original T5 architecture (Text‑to‑Text Transfer Transformer) and incorporates the FLAN instruction‑fine‑tuning paradigm. In practice, the model receives a prompt that describes a task (e.g., “translate English to German: …”) and returns the desired output in a single forward pass. This makes it a universal seq2seq engine capable of translation, summarisation, question answering, logical reasoning, and many other NLP tasks without task‑specific heads.

Key features and capabilities

  • Supports over 30 languages (English, French, Romanian, German, plus many others) – multilingual out‑of‑the‑box.
  • Instruction‑tuned on more than 1 000 tasks, giving strong few‑shot performance even compared to much larger models.
  • Works with the standard transformers pipeline text2text‑generation, so it can be swapped in for any T5‑style model.
  • Lightweight: ~80 M parameters, enabling deployment on modest hardware while retaining FLAN‑style reasoning abilities.

Architecture highlights

  • Encoder‑decoder transformer with 12 layers total (6 encoder, 6 decoder), 8 attention heads per layer, and a hidden size of 512.
  • Trained with the T5 “span‑corruption” objective and then instruction‑fine‑tuned on the FLAN dataset (a mixture of QA, translation, summarisation, code, and reasoning tasks).
  • Uses the t5‑small checkpoint as a base, inheriting the same tokeniser (SentencePiece) and vocabulary (32 k tokens).

Intended use cases

  • Rapid prototyping of multilingual NLP pipelines.
  • Low‑latency inference for chat‑bots, virtual assistants, and on‑device applications.
  • Educational tools that need reasoning or step‑by‑step explanations.
  • Any scenario where a compact, instruction‑aware model is preferred over larger, more expensive LLMs.

Benchmark Performance

FLAN‑T5‑Small inherits the strong few‑shot abilities reported in the original FLAN paper (arXiv:2210.11416). While the README does not list exact scores for this checkpoint, the FLAN‑T5 family consistently outperforms vanilla T5‑Small on benchmarks such as MMLU, GSM‑8K, and LAMBADA. For example, FLAN‑T5‑Small achieves > 70 % accuracy on GSM‑8K few‑shot, a notable jump from the ~55 % of T5‑Small.

These benchmarks matter because they test the model’s ability to generalise to unseen tasks (MMLU), solve quantitative reasoning problems (GSM‑8K), and predict next‑word continuations (LAMBADA). The improvements demonstrate that instruction fine‑tuning yields a more versatile model without increasing parameter count, making FLAN‑T5‑Small a competitive choice for developers who need strong performance on a variety of tasks while staying within tight compute budgets.

Hardware Requirements

VRAM for inference: Approximately 2 GB of GPU memory is sufficient for batch size = 1 on the flan‑t5‑small checkpoint. Larger batches (8 – 16) will require 4 – 6 GB.

Recommended GPU: Any modern GPU with at least 4 GB VRAM (e.g., NVIDIA GTX 1650, RTX 3060, or AMD Radeon RX 6600) will run the model comfortably. For high‑throughput workloads, a GPU with 8 GB+ (RTX 2070/3080) is advisable.

CPU requirements: The model can run on CPUs, but inference latency will be higher. A recent multi‑core CPU (e.g., Intel i7‑12700 or AMD Ryzen 7 5800X) with 16 GB RAM is recommended for acceptable response times.

Storage: The checkpoint size is roughly 300 MB (model weights) plus ~150 MB for the tokenizer files, so a total of < 500 MB of disk space is needed. Using the safetensors format can reduce loading time and memory overhead.

Use Cases

FLAN‑T5‑Small shines in scenarios where a small, multilingual, instruction‑aware model is needed.

  • Multilingual translation: Quick on‑the‑fly translation between English, French, German, Romanian, and many other languages.
  • Chat‑bot reasoning: Generates step‑by‑step explanations for logical or mathematical queries, useful for tutoring or customer support.
  • Summarisation & paraphrasing: Condenses articles or rewrites sentences while preserving meaning.
  • Domain‑specific QA: Fine‑tuned on datasets like taskmaster2 (dialogue) or gsm8k (math), it can answer factual and quantitative questions with few‑shot prompting.
  • Edge deployment: Fits on devices with limited compute (e.g., Raspberry Pi with a modest GPU accelerator) for on‑device inference.

Training Details

FLAN‑T5‑Small starts from the publicly released t5‑small checkpoint (≈ 80 M parameters) and undergoes instruction‑fine‑tuning on a curated mixture of over 1 000 tasks. The fine‑tuning data includes the following datasets (as listed in the README):

  • svakulenk0/qrecc – question‑answering over web snippets.
  • taskmaster2 – multi‑turn dialogue.
  • djaym7/wiki_dialog – Wikipedia‑style conversations.
  • deepmind/code_contests – code generation and reasoning.
  • lambada – language modeling with long‑range dependencies.
  • gsm8k – grade‑school math problems.
  • aqua_rat – quantitative reasoning.
  • esnli – natural language inference.
  • quasc – question answering with commonsense.
  • qed – scientific question answering.

The fine‑tuning was performed on TPU v3‑8 pods (or equivalent GPU clusters) for several hundred thousand steps, using a batch size of 256 and a learning rate schedule that decays from 1e‑3 to 1e‑5. The model retains the original T5 vocabulary (32 k SentencePiece tokens) and can be further fine‑tuned on downstream tasks with the standard Trainer API in transformers.

Licensing Information

The README lists the license as apache‑2.0, while the top‑level metadata shows “unknown”. In practice, the model is distributed under the Apache 2.0 license, which is permissive and allows commercial use, modification, and distribution.

  • Commercial use: Allowed without royalty, provided you comply with the license terms.
  • Restrictions: You must include a copy of the Apache 2.0 license and a notice of any modifications you make.
  • Attribution: Required – you should credit the original authors (Google) and the Hugging Face repository.
  • Patents: Apache 2.0 includes a patent grant, offering additional protection for users.

If you encounter any discrepancy between the metadata and the README, treat the Apache 2.0 license as the governing terms, as it is explicitly mentioned in the model card.

Pre-loaded AI models. Ready to run.

Skip the downloads. Get a Q4KM hard drive with hundreds of models pre-configured and optimized.

Shop Q4KM Hard Drives