Abstract
SEMI-CAPS organizes machine perception into eight stages — Stimulus, Encoding,
Modality, Integration, Context, Attention, Prediction, Selection — each a named,
swappable unit a designer can build, inspect, and replace in isolation. The stages are expressed in the
compositional style of higher-order functions over atomic functions [1, 2, 3]: the pipeline is Selection ∘ Prediction ∘ Attention ∘ Context ∘ Integration ∘ Modality ∘ Encoding ∘ Stimulus, and each stage is placeable and testable on its own. Two stages sit directly on
mature computational foundations: Attention on the attention/transformer line [4] and its
IO-efficient exact variants [5], and Selection on Signal Detection Theory [6], which
turns "commit to an interpretation" into a measurable decision with sensitivity d′ and criterion β. The
threshold and adaptation behavior across Attention and Selection is set in psychophysical
coordinates — the just-noticeable difference (JND) and Weber–Fechner scaling [7], with
perceived-magnitude compression given by Stevens' power law [8] — so a stage's operating point
is a number, not a guess. The framework is presented as a design with an Input–Process–Output worked
example and a precise account of where each stage meets a measurement.
1. Introduction
Machine-perception systems are often assembled ad hoc. SEMI-CAPS fixes a vocabulary of eight stages so a designer can name, separate, and swap the parts of a perception pipeline. The value is organizational — the modularity argument that motivates higher-order composition [2] — plus a precise account of which stages already stand on measured foundations and how the rest are placed. The eight-stage decomposition is an engineering convention: it structures a pipeline so each stage carries one responsibility and one measurable operating point, and other decompositions are admissible for other purposes. What the framework buys is separability — the ability to build, test, and replace one stage without disturbing the others.
2. Related Work
Attention. The Attention stage corresponds to a concrete, well-established mechanism: scaled dot-product / self-attention [4], with IO-efficient exact implementations for the memory cost [5]. This stage is backed by a mature, benchmarked computational literature; SEMI-CAPS names it as a stage and adopts it directly.
Selection and decision under uncertainty. The Selection stage — resolving ambiguity into a committed interpretation — is the setting of Signal Detection Theory [6], which separates sensitivity (d′) from decision criterion (β). Selection is a detection decision, so SDT supplies its operating characteristic directly: the precision/recall trade-off is a criterion shift along an ROC curve, and stage quality separates into d′ versus threshold.
Context and prediction. Framing Context and Prediction as using prior experience to anticipate inputs follows Bayesian accounts of cognition [9] — the established formalism for expectation shaped by priors, which the two stages instantiate as their input-conditioning and next-input estimation.
Compositional structure. Treating the eight stages as swappable composed units is functional composition [1, 2, 3]; the citations ground the engineering style that makes each stage independently placeable and testable.
Psychophysics. Weber–Fechner scaling [7] and Stevens' power law [8] relate physical stimulus magnitude to perceived magnitude, and the just-noticeable difference (JND) is the resolution at which a change becomes detectable. SEMI-CAPS applies them as the quantitative basis for thresholding and adaptation in the Attention and Selection stages: attention weights and selection thresholds are set on the log-compressed scale these laws describe, and the JND fixes the step size below which a change carries no decision. This is measurement coordinates for a stage's operating point — the same coordinates in which Signal Detection Theory [6] states the decision rule — not borrowed vocabulary.
3. The Eight Stages
- Stimulus — detect and condition raw input (denoise, band-limit).
- Encoding — convert raw input into a structured representation (features, spectra, embeddings).
- Modality — apply modality-specific processing (vision vs audio pipelines).
- Integration — fuse across modalities into a joint representation.
- Context — condition the representation on prior state and history [9].
- Attention — weight and prioritize features [4, 5], on the JND-resolved, log-compressed scale of the psychophysical laws [7, 8].
- Prediction — anticipate likely next inputs from context [9].
- Selection — commit to an interpretation as a detection decision [6].
Each stage is a named unit with a defined input and output; separating them this way makes a perception pipeline easier to build, inspect, and modify [2], and gives each stage a single operating point to measure and tune.
4. Worked Example: The Eight Stages as an IPO Pipeline
The eight stages compose as an Input–Process–Output cognitive-DSL pipeline — atomic functions composed
into a perception higher-order function. This is the intended data flow: it names the operation at each
stage and the boundary each stage owns. In an implementation, each process is filled by a concrete
operator — a band-limiting filter at Stimulus, an embedding at Encoding, scaled dot-product attention at
Attention [4] — and each carries the operating point its stage is measured at.
semi_caps_pipeline:
description: "Eight-stage perception pipeline as composed atomic functions."
input: "raw_sensor_signal"
process:
- stimulus: { input: "raw_sensor_signal", process: "detect_and_condition_input", output: "clean_signal" }
- encoding: { input: "clean_signal", process: "encode_to_features", output: "features" }
- modality: { input: "features", process: "apply_modality_processing", output: "modal_features" }
- integration: { input: "modal_features", process: "fuse_across_modalities", output: "joint_repr" }
- context: { input: ["joint_repr","history"], process: "condition_on_priors", output: "contextual_repr" }
- attention: { input: "contextual_repr", process: "weight_and_prioritize", output: "attended_repr" }
- prediction: { input: "attended_repr", process: "anticipate_next_input", output: "prediction" }
- selection: { input: ["attended_repr","prediction"], process: "decide_interpretation", output: "percept" }
output: "percept" # committed interpretation (a detection decision, cf. SDT)
5. Where Validation Is Grounded
Two stages meet a number directly. Attention rests on a benchmarked computational literature [4, 5], and its weighting and thresholds are set in psychophysical coordinates — the JND step size and the log-compressed Weber–Fechner / Stevens scale [7, 8] — so its operating point is measurable rather than tuned by feel. Selection is a detection decision, and Signal Detection Theory [6] gives it structure: sensitivity d′ separates from criterion β, and the precision/recall trade-off is a criterion shift along an ROC curve. These are the points where the architecture meets a measurement, and they define the operating characteristic every other stage feeds.
Evidence & Scope
SEMI-CAPS is a design: eight named, swappable stages [2] with a defined data flow and a stated operating point per stage. Attention stands on a mature, benchmarked computational foundation [4, 5]; Selection stands on Signal Detection Theory [6]; and the thresholding and adaptation across both are stated in the measurable psychophysical coordinates — JND, Weber–Fechner [7], Stevens [8] — in which a perception pipeline's operating point is a number. The worked pipeline is the intended data flow, and the payoff the framework is built to deliver is separability: each stage can be instantiated, measured at its operating point, and replaced against a baseline without disturbing the rest.
References
- John Backus (1978). Can Programming Be Liberated from the von Neumann Style? A Functional Style and Its Algebra of Programs. Communications of the ACM. [1977 ACM Turing Award Lecture]
- John Hughes (1989). Why Functional Programming Matters. The Computer Journal.
- Christopher Strachey (2000). Fundamental Concepts in Programming Languages. Higher-Order and Symbolic Computation. [Reprint of 1967 lecture notes]
- Ashish Vaswani et al. (2017). Attention Is All You Need. Advances in Neural Information Processing Systems (NeurIPS). arXiv:1706.03762.
- Tri Dao et al. (2022). FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness. Advances in Neural Information Processing Systems (NeurIPS). arXiv:2205.14135.
- David M. Green & John A. Swets (1966). Signal Detection Theory and Psychophysics. Wiley.
- Gustav Theodor Fechner (1860). Elemente der Psychophysik. Breitkopf und Härtel.
- S. S. Stevens (1957). On the Psychophysical Law. Psychological Review.
- Thomas L. Griffiths et al. (2008). Bayesian Models of Cognition. The Cambridge Handbook of Computational Psychology.