A Module is a self-contained, reusable unit of software or system design that encapsulates a discrete set of related functions, data structures, or responsibilities behind a well-defined interface, enabling independent development, testing, deployment, and composition within larger systems. Modules promote separation of concerns, reduce coupling between system components, and support both horizontal reuse across different systems and vertical composition within a single system architecture. In AI contexts, a module may refer to a functional unit within a model architecture (e.g., an attention module, an adapter module) or a deployable component in an AI pipeline.
A Module is a self-contained, reusable unit of software or system design that encapsulates a discrete set of related functions, data structures, or responsibilities behind a well-defined interface, enabling independent development, testing, deployment, and composition within larger systems. Modules promote separation of concerns, reduce coupling between system components, and support both horizontal reuse across different systems and vertical composition within a single system architecture. In AI contexts, a module may refer to a functional unit within a model architecture (e.g., an attention module, an adapter module) or a deployable component in an AI pipeline.
Semantic Classification
Content
The concept of a module is foundational across software engineering, systems design, and AI architecture. In classical software engineering, modular design emerged as a response to the complexity crisis of the 1960s and 1970s: Parnas’s principle of information hiding (1972) established that modules should conceal their implementation decisions from clients, exposing only a stable, minimal interface. This enables independent evolution of module internals without rippling changes to dependent components.
In modern distributed systems, modules manifest as microservices, serverless functions, container images, or library packages, each with versioned interfaces enforced by contracts or API schemas. The degree of coupling between modules — measured through afferent/efferent coupling ratios — determines system brittleness. Low coupling, high cohesion remains the canonical module design goal.
In AI systems, the term module takes on additional meanings. Within neural network architectures, a module is a differentiable computation graph unit: PyTorch’s nn.Module and JAX’s flax.linen.Module are the canonical implementations, enabling automatic differentiation, parameter management, and compositional model construction. Attention modules, feed-forward modules, normalisation layers, and embedding tables are composed hierarchically into transformer architectures.
At a higher level of abstraction, AI pipeline modules encapsulate preprocessing, feature extraction, model inference, and post-processing as deployable units that can be independently scaled, replaced, or monitored. Adapter modules represent a specialised case — lightweight modules inserted into a frozen pre-trained model that are the only components trained during fine-tuning. This modular approach to model adaptation is central to parameter-efficient fine-tuning techniques such as LoRA and adapter-based transfer learning.