AI Glossary / Prompting and human-AI interaction / Advanced
Generalized Few-shot Learning
Definition
Generalized few-shot learning is a classification setting in which a model must recognize both previously learned base classes and new classes introduced through only a few labeled examples. Predictions are made over the combined set of classes, without being told whether an input belongs to the old or new group.
What it means
Conventional few-shot evaluations often restrict each test episode to a small set of novel classes. That makes the decision easier than a deployment where familiar classes remain possible answers.
The generalized setting keeps those familiar alternatives in play. A system adding two new packaging types must still recognize its established catalog while considering every catalog label.
This is a learning and evaluation problem, not one universally specified neural-network architecture. Preserving old knowledge and balancing class scores are goals to measure, not guarantees implied by the name.
How it works
A model first learns representations or classifiers from a base dataset with many examples. It then receives a small labeled support set for novel classes. An adaptation method incorporates those classes while retaining the ability to recognize the base classes.
At prediction time, all relevant old and new labels compete. Methods must address sparse new-class data, possible degradation of old-class knowledge and differences in score scale between classifiers trained under unequal data conditions.
The source paper associated with the supplied ontology explicitly separates learning novel classes, preserving base knowledge and calibrating their joint classifier. Other methods differ. Evaluation should distinguish base-only and novel-only recognition from recognition over the combined label space.
Three practical examples
- A retail catalog adds a few labeled images for a new product family while continuing to recognize the much larger existing catalog.
- A document-routing team introduces two new form categories but still needs incoming documents classified among all established and new categories.
- A video-analysis project adds uncommon activity classes from limited demonstrations while retaining recognition of activities covered extensively during initial training.
Think of it this way
Think of a librarian adding a small new subject section to a mature catalog. A returned book could belong to the new section or any existing section; the librarian is not told which group to consider first.
The analogy captures joint competition between labels. It does not imply that a few examples are sufficient to define every new category or that old knowledge remains unchanged automatically.
Worked example
Suppose a classifier has two base classes, A and B, and two novel classes, C and D. For a query whose true label is C, the raw scores are A = 8, B = 7, C = 6 and D = 2.
If an evaluator restricts the decision to novel classes, C wins over D and the prediction is correct. In the generalized setting, A has the highest score, so the same query is misclassified. The novel classifier distinguishes C from D but loses against base labels.
For illustration only, subtract three from each base score. The adjusted scores become 5, 4, 6 and 2, so C now wins. This is not a recommended universal correction: it could damage predictions on genuine base-class queries and would need independent validation.
Consider an evaluation with 900 base-class queries and 100 novel-class queries. Suppose 810 base queries and 20 novel queries are correct in the combined label space. Overall accuracy is 830/1000 = 83%, but novel-class accuracy is only 20%.
The two group accuracies are 90% and 20%. Their arithmetic mean is 55%; their harmonic mean is 2 times 0.90 times 0.20 divided by 1.10, approximately 32.7%. Report both group results and evaluation composition rather than one favorable number.
Illustrative case study
Fictional case: a facilities supplier adds new equipment categories to an image-recognition catalog. Its initial pilot tests only the new categories and appears promising. Reviewers then add ordinary catalog items to the same evaluation and find that old and new labels interfere.
The team checks whether the cause is degraded representations, poorly comparable scores or visually overlapping categories. It separates those questions before changing the adaptation procedure.
A revised evaluation reports base and novel accuracy in the joint label space, along with errors between particular categories. This case asserts no achieved improvement.
Common misconceptions and mistakes
- Strong novel-only accuracy proves generalized performance: base classes may outscore the correct novel label.
- Generalized means unlimited general intelligence: it refers here to the expanded classification setting.
- The name guarantees no forgetting: preservation must be assessed after adaptation.
- Calibration always means perfect probability calibration: in this context it often concerns comparability and balance of base and novel class scores.
- Adding labels automatically detects completely unknown categories: open-set rejection is a separate requirement.
Business use
This setting is relevant when businesses extend an existing classifier incrementally but cannot suspend its original responsibilities. New categories should be evaluated alongside the operating catalog, not in an isolated demonstration.
Specify the number of base and novel classes, labeled examples per novel class and access to old training data during adaptation. Preserve a representative base-class evaluation set. Track old-to-new and new-to-old errors separately, because they may cause different operational problems. Compare methods under the same memory and data constraints before attributing improvements to the learning algorithm.
People also ask
How does this differ from generalized zero-shot learning?
Both include base and novel labels, but few-shot learning provides labeled examples of the novel classes. Zero-shot approaches rely on other information without those task-specific labeled examples.
How does it differ from incremental few-shot learning?
Incremental settings commonly introduce successive groups of new classes. A generalized evaluation asks about joint recognition of base and novel classes and can form part of that sequence.
Must a system fine-tune its feature encoder?
No. Some approaches preserve an encoder and adapt classifiers or prototypes; the evaluation setting does not prescribe one mechanism.
Check your understanding
A test tells the classifier that every query belongs to one of the novel classes and removes base labels. Does it measure joint generalized recognition?
Answer: No. That restriction removes competition from the base classes and measures a different, easier decision setting.
Related terms
- Few-shot learning
- base class
- novel class
- catastrophic forgetting
- classifier calibration
- class imbalance
- incremental learning
- generalized zero-shot learning
- joint label space
Learn next
Construct separate base and novel test groups but classify both over the full label set. Compare those results with restricted-label tests. Then investigate whether failures come from representation changes, ambiguous categories or score imbalance before choosing a remedy.
More in Prompting and human-AI interaction
- Chain-of-thought prompting - Chain-of-thought prompting is a prompting approach that uses intermediate explanations or worked solution steps to help a language model produce an answer.
- Few-shot prompting - Few-shot prompting means including a small number of example inputs and desired outputs in a prompt before asking a model to handle a new input.
- Human-in-the-loop - Human-in-the-loop describes an AI workflow in which people provide input, judgment, correction or approval at defined points that influence the system's...
- Incremental Few-shot Learning - Incremental few-shot learning is learning new categories or capabilities in successive stages from small labeled datasets while retaining useful performance...
- Instruction tuning - Instruction tuning is additional training that teaches a language model to respond to tasks expressed as instructions.
- Least-to-most prompting - Least-to-most prompting is a language-model prompting strategy that first decomposes a problem into simpler subproblems and then solves them in sequence...
Sources
Kukleva, Kuehne and Schiele, Generalized and Incremental Few-Shot Learning by Explicit Learning and Calibration without Forgetting, ICCV 2021, setting and evaluation distinctions: https://arxiv.org/pdf/2108.08165
Supplied-list terminology provenance, Artificial Intelligence Ontology: https://raw.githubusercontent.com/berkeleybop/artificial-intelligence-ontology/main/aio.owl
The score comparison, accuracy calculations and supplier case are original illustrations. The primary paper defines a learning setting, despite the ontology's architecture-like wording.
Previous: Generalized expectation maximization Next: Generalized Gauss - Newton method