Models and labs

What is a model card, and how do you read one?

· By Robert Scales · 4 min read

Short answer

A model card is a short document published with an AI model that explains what it is for, how it was trained, how it was tested and where it falls short. To read one, check five things in order: what the model is, what it is meant for, what it learned from, how it was evaluated, and what risks its authors list.

When you buy a medicine, the box comes with a leaflet: what it treats, how to take it, who should not take it and what side effects to expect. A model card does the same job for an AI model. It is written by the people who built the model and published alongside it, so that anyone thinking of using it can decide whether it fits their purpose.

The idea comes from a paper by Margaret Mitchell, Timnit Gebru and colleagues, presented at the FAT* conference on fairness, accountability and transparency in January 2019. They proposed that trained models be released with short documents reporting how well they perform, not just on average but across different groups of people and conditions, and stating the context they are intended for. Model cards are now a standard part of model pages on the Hugging Face Hub, and OpenAI published one for GPT-2 in 2019.

What a model card contains

The original paper suggests nine sections. Not every card uses these exact headings, but most cover the same ground:

SectionQuestion it answers
Model detailsWho built it, when, what type of model, which version and license?
Intended useWhat is it for, who should use it, and what is out of scope?
FactorsWhich groups or conditions might change how well it works?
MetricsHow is performance measured, and why those measures?
Evaluation dataWhat was it tested on?
Training dataWhat did it learn from?
Quantitative analysesWhat were the results, broken down by group or condition?
Ethical considerationsWhat risks did the authors think about?
Caveats and recommendationsWhat should users know or do?

The paper's own examples were small: a model that detects smiling faces in photos and one that flags toxic comments in text. The same structure now describes language models with billions of parameters.

A worked example: reading BLOOM's card

BLOOM, the 176-billion-parameter multilingual model released by the BigScience collaboration this month, has one of the most detailed cards so far. Open it at huggingface.co/bigscience/bloom and read it with five questions.

1. What is it? The model details say BLOOM is a Transformer-based language model that continues text from a prompt, in 46 natural languages and 13 programming languages. It lists the developers, funders (including the French government and Hugging Face), the version and the license, the BigScience RAIL License, which comes with use restrictions.

2. What is it for? Under intended use, the card says the model exists to support public research on large language models, for text generation or as a base for further training. It names out-of-scope uses plainly: high-stakes settings, biomedical, political, legal or financial domains, and scoring people for jobs, education or credit. It also lists misuses such as spam, disinformation and impersonation without consent.

3. What did it learn from? The training section reports 1.6 terabytes of preprocessed text, a chart of the share of each language, and links to cards for the individual datasets. This tells you which languages the model saw most and least, which predicts where it will be strongest.

4. How was it tested? The evaluation section lists its metrics and the factors that may cause big differences in behavior, such as language, domain and demographic characteristics. The results table is marked in red as intermediate results, because evaluation was still under way.

5. What could go wrong? The risks section is frank. It warns that the model may overrepresent some viewpoints, contain stereotypes and personal information, generate hateful or inappropriate content, state incorrect information as fact, repeat itself, and lead users to attribute human traits such as sentience to it.

GPT-2's card, published by OpenAI in 2019, follows a similar pattern in fewer words: it names AI researchers as its main intended users and warns against uses that require the text to be true, since the model does not distinguish fact from fiction.

Try it: Pick any model on the Hugging Face Hub that you might use, open its card, and answer the five questions above in one sentence each. If you cannot answer one of them from the card, write "not stated" and treat that as information too.

What warning signs should you look for?

The first warning sign is a missing or nearly empty card. Some models on public hubs come with only a line or two of description. That does not make them bad, but it means you are relying on testing everything yourself.

The second is a card with no intended-use or out-of-scope section. If the authors have not said what the model is for, you cannot know whether your use matches what they tested. Watch also for a mismatch: a model trained mainly on English news, offered without comment for medical advice in French, should make you pause.

Third, look at the evaluation. Results reported only as a single average can hide poor performance for some groups, which is exactly the problem Mitchell and her coauthors set out to address. Results that are marked preliminary, as BLOOM's honestly are, are not a red flag in themselves, but they mean the numbers may change.

Finally, check whether the training data is described at all, and whether the license allows what you plan to do. A card that is vague about data and silent on license leaves the most important questions unanswered. A good card does not guarantee a good model, but a thin one tells you how much checking is left to you.

Sources

  1. Model Cards for Model Reporting — arXiv (Mitchell et al., FAT* 2019), October 5, 2018
  2. BLOOM model card (version 1.3, revision of 21 July 2022) — BigScience / Hugging Face, July 6, 2022
  3. GPT-2 model card — OpenAI on GitHub, August 20, 2019

Get the free Guide to Artificial Intelligence

Sign up for the weekly newsletter and receive the free guide: what changed in AI this week, one lesson, one prompt to try. Unsubscribe in one click.

How we handle your address

Back to top

Display

Your choices are saved in this browser only. No data is sent.

Text size
100%
Colours
Reading
More settings
Accessibility statement