Inferensys

Glossary

Concept Vector Arithmetic

Performing linear operations, such as addition and subtraction, on concept vectors in the activation space to create new, semantically meaningful composite concepts.
Developer reviewing semantic search engine results on laptop, relevance scores visible, technical search demo.
SEMANTIC ALGEBRA IN LATENT SPACE

What is Concept Vector Arithmetic?

Concept Vector Arithmetic is the technique of performing linear algebraic operations, such as addition and subtraction, on concept vectors within a neural network's activation space to construct new, semantically composite representations.

Concept Vector Arithmetic is the process of applying linear operations to concept vectors in a model's activation space to synthesize novel semantic meanings. By adding the vector for "smiling" to the vector for "woman" and subtracting the vector for "man," one can navigate the latent space to a region encoding the composite concept of a "smiling woman," demonstrating that high-level abstractions are encoded as directional forces.

This technique relies on the empirical property that concept directions learned by linear probes are semantically decomposable. The resulting composite vector is not merely a mathematical artifact; its validity is tested by measuring the model's sensitivity to the new direction using methods like TCAV. This arithmetic enables the controlled generation of counterfactual explanations and the systematic auditing of a model's internal conceptual alignment.

SEMANTIC ALGEBRA IN LATENT SPACE

Key Characteristics of Concept Vector Arithmetic

Concept vector arithmetic enables the composition and decomposition of high-level semantic abstractions by performing linear operations on their learned representations within a neural network's activation space.

01

Linear Semantic Composition

The foundational principle that concepts encoded as vectors can be meaningfully combined using standard linear algebra operations. Because concept vectors capture directional semantics in activation space, vector addition produces a new direction representing the composite concept. For example, adding a vector for 'stripes' to a vector for 'horse' yields a direction associated with 'zebra'. This property emerges from the linear representation hypothesis, which posits that high-level features are encoded as linear directions in a model's latent space. The resulting composite vector can be used to steer generation or probe model understanding without retraining.

02

Concept Subtraction and Analogy

Subtracting one concept vector from another isolates differentiating semantic attributes, enabling analogical reasoning in activation space. The classic example follows the form: king - man + woman ≈ queen. This operation removes the 'male' semantic component from 'king' and adds the 'female' component, arriving at the vector for 'queen'. This demonstrates that concept vectors encode disentangled attributes that can be independently manipulated. In practice, subtraction is used for concept erasure—projecting activations orthogonal to a sensitive attribute vector to remove unwanted bias from representations.

03

Directional Steering via Scalar Multiplication

Multiplying a concept vector by a scalar coefficient and adding it to an activation controls the intensity of that concept's influence on model behavior. A positive coefficient amplifies the concept's presence; a negative coefficient suppresses it. This technique, known as activation steering, allows precise, continuous control over generated outputs. For instance, scaling a 'formality' vector can shift language model outputs from casual to professional register without altering the underlying prompt. The linearity of this operation makes it computationally efficient and compatible with real-time inference pipelines.

04

Orthogonal Decomposition for Concept Isolation

Any activation vector can be decomposed into components that are parallel and orthogonal to a concept direction using vector projection. The parallel component represents the degree to which the concept is present; the orthogonal component captures all other information. This decomposition enables:

  • Concept removal: discarding the parallel component to erase a concept
  • Concept measurement: computing the scalar projection length as a quantitative sensitivity score
  • Disentanglement analysis: verifying that manipulating one concept does not corrupt orthogonal semantic dimensions This mathematical property underpins techniques like Concept Erasure and TCAV sensitivity calculations.
05

Semantic Interpolation and Blending

Linear interpolation between two concept vectors creates a continuous spectrum of intermediate semantic states. By computing v_interp = (1-α)v_concept_A + αv_concept_B for α in [0,1], models can generate outputs that smoothly transition between concepts. This enables:

  • Morphological blending: generating hybrid visual concepts like a 'tiger-lion' blend
  • Style transfer: interpolating between artistic style vectors
  • Attribute dials: creating user-facing sliders that adjust specific semantic dimensions in real time The smoothness of the interpolation validates that concepts form a continuous semantic manifold rather than discrete clusters.
06

Algebraic Validation via Counterfactual Testing

The validity of concept vector arithmetic is empirically verified through counterfactual intervention. After performing an operation—such as adding a 'smiling' vector to a neutral face encoding—the resulting activation is decoded or passed through the remainder of the network. The output is inspected to confirm that the intended semantic change occurred without unintended side effects. Statistical tests compare the effect against random direction vectors to ensure the result is not an artifact. This validation loop is essential for building trustworthy concept-based explanations and ensuring that discovered concept directions are causally meaningful rather than correlational.

CONCEPT VECTOR ARITHMETIC

Frequently Asked Questions

Explore the mechanics of performing linear operations on concept vectors to compose, decompose, and manipulate semantic representations within neural network activation spaces.

Concept vector arithmetic is the process of performing linear algebraic operations—primarily addition and subtraction—on concept vectors within a neural network's activation space to construct new, semantically composite representations. It works by leveraging the empirical property that directions in a model's latent space often encode meaningful, human-interpretable attributes in a linearly separable manner. For example, if you have a vector for king, subtract the vector for man, and add the vector for woman, the resulting vector points near the representation of queen. This technique, popularized by word embeddings like Word2Vec, extends to deep neural networks where a Concept Activation Vector (CAV) defines a direction for a high-level concept. Arithmetic on these CAVs allows for controlled semantic manipulation, such as adding a smiling vector to a face encoding or subtracting a noise concept from an audio signal. The operation is purely geometric: it shifts the model's internal representation along a specific conceptual axis, enabling the synthesis of novel concepts without retraining.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.