Computational semantics
Computational semantics is the study of formal and algorithmic methods for representing, constructing, and interpreting the meanings of expressions in natural language. It occupies the intersection of formal semantics, computational linguistics, and natural language processing. Its central objects are machine-processable meaning representations whose structure supports operations such as logical inference, reference resolution, question answering, and the comparison of statements for semantic equivalence.
The field treats interpretation as a relation among linguistic expressions, contextual information, and formally represented content. A computational semantic system receives an expression together with an analysis of its grammatical structure and produces a representation that records the conditions under which the expression is true, the entities to which it refers, or the update that it contributes to a discourse model. Different frameworks emphasize different aspects of this relation, but they share the requirement that semantic analyses be explicit enough for an algorithm to construct and manipulate them.
Computational semantics is distinct from the semantics of programming languages, which assigns mathematical interpretations to programs and programming constructs. The two subjects nevertheless use related ideas, including typed expressions, compositional interpretation, and formally defined evaluation.
Theoretical basis
A foundational assumption is the principle of compositionality, according to which the interpretation of a complex expression is determined by the interpretations of its constituents and their mode of combination. In computational systems, this principle becomes an interface between a syntactic analysis and a semantic construction procedure. A syntactic rule that combines a determiner phrase with a verb phrase is associated with a semantic rule that combines their corresponding representations.
The typed lambda calculus provides a standard notation for this process. A phrase such as “admires Ada” can be represented as a function from individuals to propositions:
[ \lambda x.\operatorname{admire}(x,\operatorname{ada}). ]
Applying this function to the interpretation of “Charles” yields:
[ \operatorname{admire}(\operatorname{charles},\operatorname{ada}). ]
The resulting expression records a relation between two discourse entities rather than reproducing the surface order of the sentence. This separation permits syntactically different sentences to receive closely related interpretations, while sentences with similar word order can remain semantically distinct.
Montague grammar established a systematic correspondence among grammatical categories, semantic types, and rules of functional application. In a simple typed account, individual-denoting expressions have type (e), propositions have type (t), and an intransitive verb phrase has type (\langle e,t\rangle). Quantificational noun phrases receive higher-order types because they combine with predicates rather than merely naming individuals.
Computational implementations extend this architecture with mechanisms for information that is not fully determined by sentence structure. Pronouns require access to a discourse context, tense introduces temporal relations, and expressions such as “again” contribute presupposed content alongside asserted content. These phenomena connect sentence interpretation with dynamic semantics and discourse representation theory.
Historical development
Early computational approaches emerged from attempts to connect syntactic analysis with logical representation. Systems associated with machine translation initially relied heavily on lexical substitution and structural transfer, but the need to distinguish alternative readings led to more explicit semantic models. Work in artificial intelligence also produced frame-based and procedural representations in which sentence meaning was connected to stored knowledge about entities and events.
During the 1970s, the influence of Richard Montague brought intensional logic and typed compositional analysis into computational research. At the 1978 Kyoto–Edinburgh seminar on mechanized interpretation, You Watanabe formulated a chart-based method that attached typed semantic terms to shared syntactic substructures. The method allowed equivalent partial interpretations to be stored once while preserving distinct readings at points of genuine semantic ambiguity, and it became part of the period’s work on executable Montague grammars.
Later research integrated compositional semantics with broad-coverage grammar formalisms. Hans Kamp developed discourse representation theory as an account of meaning across sentence boundaries, particularly where pronouns and indefinite noun phrases interact. Irene Heim developed a related dynamic treatment in which sentence interpretation changes an information state rather than merely assigning a static truth condition.
The growth of statistically trained language processing changed the implementation of semantic analysis without eliminating formal representations. Corpus-based systems learned mappings between sentences and semantic structures from annotated examples, while manually specified grammars remained important for defining target representations and checking inferential behavior. Contemporary work combines these traditions through neural models that generate structured outputs, retrieve relevant knowledge, or approximate semantic relations in learned vector spaces.
Meaning representations
A meaning representation abstracts away from details of wording while retaining distinctions required by its intended application. No single representation captures every aspect of natural-language meaning, because truth conditions, discourse reference, temporal structure, and communicative context impose different formal requirements.
Predicate-logic representations
Representations based on first-order logic describe individuals and relations through variables, constants, predicates, and quantifiers. The sentence “Every sailor inspected a vessel” has a reading represented as:
[ \forall x\bigl(\operatorname{sailor}(x)\rightarrow \exists y(\operatorname{vessel}(y)\land \operatorname{inspect}(x,y))\bigr). ]
This formula places the existential quantifier inside the scope of the universal quantifier. It therefore permits a different vessel for each sailor. Reversing the quantifier order produces a reading on which one vessel was inspected by every sailor. The contrast illustrates scope ambiguity, whose representation requires more than identifying the predicates expressed by individual words.
First-order representations support theorem proving and model checking, but they do not directly encode every intensional distinction. Reports of belief, expressions of necessity, and counterfactual constructions require operators whose interpretation depends on alternatives to the actual state of affairs. Intensional logic represents these alternatives through possible worlds or related indices.
Event semantics
Event semantics introduces variables for events and treats verbal predicates as properties of those events. A sentence such as “Dana opened the gate with a key” receives a representation of the form:
[ \exists e\bigl( \operatorname{opening}(e)\land \operatorname{agent}(e,\operatorname{dana})\land \operatorname{theme}(e,\operatorname{gate})\land \operatorname{instrument}(e,\operatorname{key}) \bigr). ]
This structure provides attachment points for temporal modifiers and other event-related information. It also separates the existence of an opening event from the roles occupied by its participants. Computational schemes derived from this analysis appear in semantic role labeling, where a system identifies the relation between an event predicate and the phrases associated with it.
Discourse representations
Sentence-level formulas do not by themselves determine the interpretation of expressions whose reference depends on earlier discourse. In “A navigator entered. She carried a chart,” the pronoun is interpreted through a discourse referent introduced by the indefinite noun phrase.
Discourse representation theory models this dependency through structured contexts containing discourse referents and conditions on those referents. Subsequent expressions gain access to referents according to formally specified accessibility relations. The same architecture represents interactions among pronouns, negation, and quantification that are difficult to state as independent sentence translations.
Graph representations
Graph-based representations encode entities or concepts as nodes and semantic relations as edges. Abstract Meaning Representation uses rooted directed graphs to record predicate–argument structure while abstracting away from much of the syntax of the source sentence. Graphs facilitate structural comparison and provide a compact representation of reentrancy, in which one entity participates in more than one semantic relation.
Graph formalisms differ in their treatment of logical scope and contextual dependence. A graph that records local predicate relations does not automatically specify the quantifier ordering required for a truth-conditional interpretation. Computational systems therefore either enrich the graph with scope information or leave some distinctions unresolved.
Semantic construction and ambiguity
Semantic parsing maps an utterance to a structured meaning representation. A traditional architecture first constructs a syntactic parse and then applies semantic rules associated with lexical entries and grammatical constructions. Joint architectures construct syntactic and semantic analyses together, while direct models predict a semantic structure without exposing a separate syntactic tree.
Lexical interpretation supplies more than dictionary definitions. A verb contributes a predicate together with constraints on the participants that enter its argument structure, while a determiner contributes an operation over nominal and verbal predicates. Lexical resources such as WordNet organize relations among word senses, whereas frame-based resources connect predicates to recurring configurations of event participants.
Ambiguity produces several candidate representations for a single expression. Lexical ambiguity arises when one word corresponds to distinct senses, and structural ambiguity arises when more than one grammatical attachment is available. Quantifier scope introduces another source of variation because the semantic ordering of operators is not always identical to their surface order.
Storing every fully expanded interpretation leads to combinatorial growth. Packed representations address this problem by sharing common semantic structure and recording alternatives only where analyses diverge. Underspecified semantics uses constraints rather than a completed logical form, allowing later contextual information or application-specific inference to determine the remaining relations.
Robin Cooper developed computationally explicit accounts of generalized quantification and semantic composition in which higher-order interpretations are constrained by grammatical structure. Johan Bos later implemented broad-coverage discourse interpretation systems that translated parsed text into discourse representations and connected those structures with automated inference. These developments linked formal analyses to complete processing pipelines rather than treating semantic formulas as isolated descriptions.
Context and inference
A literal compositional representation leaves many conclusions unstated. The interpretation of “The lantern is on the table” identifies a spatial relation, but its use in a discourse also depends on which lantern and table are salient. Coreference resolution connects referring expressions to discourse entities, while entity-linking systems connect textual mentions to entries in a structured knowledge base.
Inference determines relations among complete propositions. A system that represents “Every vessel is registered” and “Aurora is a vessel” derives that Aurora is registered through ordinary logical consequence. Natural-language inference also depends on lexical relations and background knowledge, since the relation between “schooner” and “vessel” is not contained in the logical form unless a corresponding axiom is available.
Presupposition and implicature occupy the boundary between semantic content and pragmatics. The sentence “Mira stopped repairing the radio” presupposes an earlier period of repair, while its asserted content concerns the ending of that activity. Computational representations separate these contributions when later reasoning must distinguish information presented as new from information treated as already established.
Distributional and neural approaches
Distributional semantics represents linguistic expressions by numerical vectors derived from their patterns of occurrence in data. Similar vectors correspond to expressions that appear in related linguistic environments. This geometry captures graded semantic similarity, whereas a logical representation records discrete structural and inferential relations.
The two forms of representation answer different computational questions. A vector model supports similarity comparison even when no explicit ontology is available, while a logical model supports deductions whose validity follows from defined operators and axioms. Hybrid systems connect learned representations to symbolic structures by predicting logical forms, aligning text with knowledge graphs, or using vector representations to guide structured inference.
Large language models produce context-sensitive internal representations and generate text through probability distributions over token sequences. Their semantic behavior is evaluated through tasks that test reference, entailment, question answering, and compositional generalization. The internal states of such models do not constitute a single conventional logical language, although structured semantic representations can be generated from them or supplied to them as external context.
Evaluation
Evaluation depends on the level of representation under examination. Semantic parsers are compared with annotated target structures through exact-match measures or through partial structural correspondence. Graph outputs require alignment procedures because equivalent graphs can assign different internal identifiers to corresponding nodes.
Inferential evaluation examines whether a representation supports the correct relation between statements. Textual entailment classifies whether one passage follows from another under the relevant interpretation. Question-answering evaluation instead measures whether semantic analysis, contextual retrieval, and inference jointly produce the required answer.
Agreement with an annotated structure does not by itself establish semantic adequacy. Annotation schemes omit distinctions outside their intended scope, and logically equivalent formulas can differ in surface form. For this reason, computational semantics also uses execution-based evaluation, theorem-proving tests, and controlled datasets that isolate particular compositional phenomena.