Frame · knowledge representation

Also known as: frame-based representation

On this page 7

A frame is a structured data record for knowledge representation that describes a stereotyped object, concept or situation as a named collection of slots and fillers, together with default values, constraints and attached procedures. In Symbolic AI & reasoning, frames are one of the classical ways to organize what a system knows, and frame-based representation remains the conceptual ancestor of modern object models, ontologies and description logics in artificial intelligence.

Marvin Minsky proposed frames in 1974 as a response to purely logical encodings, arguing that human reasoning relies on ready-made expectations rather than on deduction from first principles. When a frame for “restaurant visit” or “hotel room” is activated, the system immediately knows what to expect, which slots still need values and which defaults it may assume until evidence says otherwise.

How a frame organizes knowledge

A frame groups everything relevant about one concept in a single named unit. Each frame contains slots, which are named attributes, and each slot holds a filler, which may be a literal value, a pointer to another frame or a procedure that computes the value. Slots themselves carry facets, metadata that state the permitted type, cardinality, default and attached procedures.

The following table lists the standard components of a frame and the role each one plays in reasoning.

ComponentWhat it holdsRole in reasoning
Frame nameUnique identifier such as ElephantAnchors references from other frames
SlotNamed attribute such as color or legsDefines what can be known
FillerValue, frame pointer or procedureStates what is currently known
FacetType, range, cardinality, defaultConstrains and validates fillers
Default valueTypical filler, for example four legsSupports reasoning with incomplete data
Procedural attachmentIf-needed or if-added routineComputes or propagates values on demand
Components of a frame

Frames connect through is-a and instance-of links into a hierarchy. A frame for Elephant may be a subclass of Mammal, and Clyde may be an instance of Elephant. This structure lets the system answer questions by walking the hierarchy instead of storing every fact explicitly for every individual.

Inheritance, defaults and procedural attachment

Inheritance is the central inference mechanism of frame systems. When a slot of an instance is empty, the system looks upward through is-a links and uses the nearest ancestor’s filler. Because defaults can be overridden locally, frame inheritance is a form of non-monotonic reasoning: adding the fact that a particular penguin is a bird does not license the conclusion that it flies, once the Penguin frame overrides the Bird default.

Procedural attachments, often called demons, make frames active. An if-needed procedure runs when a value is requested but missing, for example computing age from a birth date. An if-added procedure runs when a value is stored, for example updating a total or checking a constraint. The table below compares the main inference mechanisms.

MechanismTriggerTypical useMain risk
Default inheritanceEmpty slot on an instanceAssume typical propertiesWrong conclusions for exceptions
Multiple inheritanceFrame with several parentsCombine roles or categoriesConflicting defaults
If-needed demonRead of a missing valueLazy computationHidden side effects
If-added demonWrite of a new valuePropagation and validationCascading updates
Frame matchingNew situation descriptionRecognize the best-fitting frameAmbiguous partial matches
Inference mechanisms in frame systems

Multiple inheritance creates the classic Nixon diamond problem: a person who is both a Quaker, by default a pacifist, and a Republican, by default not a pacifist, inherits contradictory defaults. Frame languages resolve such conflicts by ordering parents, by explicit precedence rules or by refusing to conclude anything, and the chosen policy must be documented because it changes answers.

Frames sit between semantic networks and formal logic. They add internal structure to network nodes, and they trade some of the precise semantics of logic for intuitive modeling and efficient retrieval. The comparison below positions frames against neighboring approaches in the same field.

ApproachUnit of knowledgeSemanticsStrength
FramesConcept with slotsProcedural, often informalIntuitive structure and defaults
Semantic networksNodes and labeled arcsInformal graphVisual associations
First-order logicFormulas and predicatesFormal model theorySound and complete deduction
Description logicConcepts and rolesFormal, decidable fragmentsAutomated classification
Production rulesIf-then rulesOperationalExplicit control of inference
ScriptsEvent sequencesProceduralStereotyped episodes over time
Frames and neighboring knowledge representation approaches

The lack of formal semantics in early frame languages such as FRL and KRL led to the KL-ONE family and eventually to description logic, which keeps the frame-like concept-and-role structure but gives it a precise, decidable meaning. The Web Ontology Language inherits this lineage, and its classes and properties are, in practice, frames with formal semantics.

Where frame-based representation is used

Frame-based representation powered many expert systems and expert system shells of the 1980s, including KEE and later CLIPS with its COOL object layer. Systems combined frames for domain structure with production rules for decision logic, so that rules matched against slot values while the hierarchy supplied defaults.

Frame ideas survive in ontology editors such as Protégé, whose original model was frame-based, in large knowledge bases such as Cyc, and in natural language processing, where semantic frames describe events and their participants. Object-oriented programming adopted the same intuition of classes, attributes and inheritance, although without default reasoning.

Choosing frames makes sense under specific conditions, which the following decision table summarizes.

SituationRecommended choiceReason
Typical cases with known exceptionsFrames with defaultsInheritance handles typicality cheaply
Need for guaranteed logical consistencyDescription logic or OWLFormal semantics and reasoners
Decision procedures dominateProduction rules over framesRules drive control, frames hold data
Stereotyped event sequencesScripts or event framesTemporal order matters
When to choose frames

Limitations and common mistakes

Frames are easy to build and hard to keep correct at scale. Their intuitive appeal hides several failure modes that experienced knowledge engineers watch for.

  • Ambiguous is-a links: mixing subclass, instance and part-of relations in one link type produces wrong inheritance.
  • Unchecked defaults: a default that is true for most cases silently produces false answers for exceptions.
  • Opaque demons: procedural attachments make behavior depend on execution order and are difficult to verify.
  • No formal semantics: two frame systems may interpret the same structure differently, which hinders knowledge sharing.
  • Knowledge acquisition cost: filling thousands of slots by hand reproduces the knowledge acquisition bottleneck.

The modern remedy is to separate structure from inference: model concepts in a formal ontology, keep defaults explicit and limited, and implement procedures as rules or services whose effects can be tested.

The idea in brief

A frame is like a form with labeled boxes. A form for “car” has boxes for make, color, wheels and owner. Some boxes come pre-filled with typical answers, such as four wheels.

When the computer meets a new car, it copies the form. It fills in what it learns and keeps the typical answers for the rest. If a car turns out to have three wheels, that one box changes. Forms can also inherit from more general forms, so a “sports car” form reuses everything from “car” and adds a few boxes of its own.

A practical scenario

A hospital builds a clinical decision support system for medication checks. Knowledge engineers define a Drug frame with slots for active ingredient, drug class, maximum daily dose and contraindications. A frame for NSAID inherits from Drug and sets a default contraindication of severe kidney impairment, and ibuprofen is an instance of NSAID with a maximum daily dose of 3,200 mg.

A Patient frame holds age, weight, kidney function and current prescriptions. An if-added procedure on the prescription slot runs whenever a doctor enters a new drug: it reads inherited contraindications and compares them with the patient’s kidney function slot. When a physician prescribes ibuprofen to a patient with an eGFR of 25, the system raises an alert within the order screen.

The team gains a compact model in which one change to the NSAID frame updates every related drug at once. It also learns the main risk: a new NSAID added with an incorrect is-a link would silently lose its warnings, so frame changes now go through clinical review.