Skip to main content
Back

Google's Flan-T5-XXL Beats 62B Models at a Fraction of the Size

Google's 11B-parameter Flan-T5-XXL is back in the Hugging Face trending list, showcasing why instruction-tuned encoder-decoder models still matter.

Pro

  • Flan-T5-XXL is an 11B encoder-decoder T5 checkpoint fine-tuned on roughly 1,836 instruction tasks.
  • Uses Muffin, T0-SF, Natural Instructions v2, and chain-of-thought data with mixed zero, few-shot, and CoT prompts.
  • Matches or beats PaLM 62B on several few-shot benchmarks despite being roughly 6x smaller.
  • Apache 2.0 license, runs in INT8 on a single 24GB GPU via transformers.
  • Details in the Scaling Instruction-Finetuned Language Models paper.
  • Best for structured NLP tasks; weak at long open-ended chat and post-2022 knowledge.

Google's Flan-T5-XXL is climbing the Hugging Face trending charts again, with over 36,000 monthly downloads and 1,287 likes on the model card. The 11B-parameter encoder-decoder was built by taking the original T5 checkpoint and instruction-finetuning it on a massive collection of tasks, which turned a general text-to-text transformer into a model that follows instructions in zero-shot and few-shot settings without further tuning.

The one-line pitch

The Hugging Face model card puts it bluntly: if you already know T5, Flan-T5 is better at everything. For the same parameter count, the authors explored instruction finetuning with a focus on scaling the number of tasks, scaling model size, and finetuning on chain-of-thought data. That combination dramatically improved performance across model classes (PaLM, T5, U-PaLM), prompting setups (zero-shot, few-shot, CoT), and evaluation benchmarks (MMLU, BBH, TyDiQA, MGSM, open-ended generation).

The headline result from the Scaling Instruction-Finetuned Language Models paper: the publicly released Flan-T5 checkpoints achieve strong few-shot performance even compared to much larger models such as PaLM 62B. An 11B encoder-decoder is punching above a 62B decoder-only model on multiple reasoning tasks.

What is actually inside

Flan-T5-XXL is not a new pretraining run. There is one fine-tuned Flan model per T5 model size, trained on TPU v3 or TPU v4 pods using the t5x codebase together with jax. The base T5 weights stay the same. What changes is the finetuning mixture, which pulls together four large task families.

Taxonomy of Flan finetuning tasks including Muffin, T0-SF, Natural Instructions v2, and CoT reasoning, plus held-out benchmarks

The training data blends Muffin, T0-SF, Natural Instructions v2, and a chain-of-thought reasoning bundle covering roughly 1,836 tasks in total. Held-out evaluation is done on MMLU, BBH, TyDiQA, and MGSM, so the reported numbers reflect generalization rather than memorization. Held-in task evaluations peak around 200 total tasks and diminish as more are added, though larger models peak later and diminish less. Held-out task performance keeps climbing log-linearly with the number of tasks, hitting the best scores at the full 1,836.

Why the encoder-decoder shape still matters

Most of the models grabbing attention today are decoder-only, which makes Flan-T5-XXL a useful reminder that encoder-decoder architectures still have real strengths for structured input-to-output work: summarization, translation, question answering, classification framed as text, and short-form reasoning. Compared to Llama-class models at similar sizes, it uses far less memory at inference for many practical jobs because outputs tend to be short.

Key strengths reported in the paper and follow-up ablations:

  • Across three model sizes, multi-task instruction finetuning improved performance by a large margin compared to no finetuning, with gains ranging from 9.4% to 15.5%.
  • Including nine datasets with chain-of-thought annotations in the finetuning mixture improved reasoning ability, and CoT prompting of Flan-PaLM outperformed PaLM on the four held-out benchmarks.
  • Careful ablation on the Flan Collection shows Flan-T5 beats prior work by 3 to 17 percent across evaluation settings, and training with mixed prompt settings (zero-shot, few-shot, and chain-of-thought) yields stronger performance in every setting.
  • Only 0.2% of the pre-training compute is used to instruction-finetune Flan-PaLM 540B, so the finetuning cost is negligible relative to the original training run.

Multilingual and reasoning behavior

Flan-T5-XXL was evaluated across multiple languages on the MGSM math benchmark, which tests arithmetic reasoning in translated form. The comparison table below is from the model card and shows how the Flan-T5 variants stack up against davinci, PaLM, and vanilla T5 checkpoints across ten languages.

MGSM multilingual reasoning benchmark comparing davinci, T5, PaLM and Flan variants across ten languages

The declared languages on the model card are English, German, and French, though the training mixture touches many more. Expect solid quality on the declared three and treat everything else as best-effort.

Getting it running

The model is Apache 2.0 licensed and works out of the box with transformers. At 11B parameters, most people load it in 8-bit or fp16 on a single GPU.

from transformers import T5Tokenizer, T5ForConditionalGeneration
tok = T5Tokenizer.from_pretrained("google/flan-t5-xxl")
model = T5ForConditionalGeneration.from_pretrained(
    "google/flan-t5-xxl", device_map="auto", load_in_8bit=True
)
prompt = "Answer step by step: If a train travels 60km in 45 minutes, what is its speed in km/h?"
inputs = tok(prompt, return_tensors="pt").input_ids.to("cuda")
print(tok.decode(model.generate(inputs, max_new_tokens=64)[0]))

In INT8 the weights fit comfortably on a single 24GB card. FP16 needs closer to 40GB. The Hugging Face model card also documents CPU inference for smaller workloads, though generation is slow at that size.

Where it fits and where it breaks

Good default use cases: classification framed as text, extractive and abstractive summarization, translation between the supported languages, structured reasoning where you want short answers, and as a base for LoRA finetuning on a private domain. The model tree currently lists 20 adapter models, 11 finetunes, and several quantized variants derived from it.

Where it struggles: long-form open-ended generation, instruction following on prompts that resemble modern chat formats, code generation at the level of dedicated coder models, and anything that requires knowledge past its 2022 training cut. The authors are explicit that instruction finetuning improves the performance and usability of pretrained language models but does not substitute for RLHF-style alignment. The model card itself warns that Flan-T5 was not filtered for explicit content or bias in the underlying data, so it should not be deployed without a safety review.

Three years after release, Flan-T5-XXL still shows up because it hits a sweet spot: open weights, permissive license, small enough to finetune on a single node, and strong enough on structured NLP to serve as a workhorse for retrieval pipelines, evaluation harnesses, and dataset labeling. For teams that need a controllable text-to-text model without paying for a proprietary API, it remains one of the highest-value checkpoints on Hugging Face.