Abstract
The transformer's "Attention Is All You Need" [1] located capability in a single mechanism. This paper locates it one level up: in higher-order-function (HOF) composition — treating cognitive operations as first-class functions that are selected by context and combined at runtime. The thesis is that organizing AI systems around composition, rather than around any one mechanism, is the productive way to address the three problems that dominate deployment: integrating heterogeneous sub-behaviors, adapting with little supervision, and managing which context is active. Composition is established functional-programming structure [2, 3, 4]; the contribution is the position that it belongs at the orchestration layer, above the model — and that the field's alternatives, fine-tuning [5] and retrieval-augmented generation [6], are things composition arranges rather than competes with.
1. Introduction
The transformer replaced recurrence and convolution with attention, and the "…Is All You Need" title became a genre [1]. This paper takes the genre at its word and moves the claim up a level. The proposal is that many of the open problems in deploying language models — integrating heterogeneous sub-behaviors, adapting with little supervision, and managing which context is active — are one problem: composing the right functions at the right time.
A higher-order function takes or returns functions [4]; building systems by composing them is the functional-programming argument for modularity [2, 3]. HOF cognition lifts that structure to the runtime orchestration of model behaviors, and holds that the orchestration layer — not any single mechanism inside it — is where the organizing principle of a capable system lives.
2. Related Work
Attention and the genre. The transformer and its title are the direct reference [1]. HOF cognition adopts the same frame and relocates the sufficiency claim from a mechanism to the composition layer that arranges mechanisms.
Functional composition. Higher-order functions and function-level programming are established [2, 3, 4]. HOF cognition builds directly on that foundation, lifting function-level composition to the runtime orchestration of model behaviors.
Adaptation and grounding. The problems the position addresses are the field's live baselines: supervised adaptation and its forgetting cost [5, 7, 8], parameter-efficient adaptation [9, 10], and retrieval grounding with its residual hallucination [6, 11]. Composition is the layer that arranges these, not a replacement for any one of them.
3. The Position
The thesis. Framing cognition as context-selected composition of first-class functions is the right engineering stance for three recurring problems:
- Integration. Treating each sub-behavior as a first-class function makes combining them a composition problem rather than a bespoke-glue problem [3].
- Unsupervised adaptation. Recomposing existing functions to fit new inputs is adaptation without weight updates — composition where fine-tuning [5] and parameter-efficient methods [9, 10] change parameters, and without the forgetting cost supervised updates carry [7, 8].
- Context management. Selecting which functions are active per task is how the active context is controlled; retrieval brings the right functions into play [6].
The ambition is general: to generalize across integration, unsupervised-learning, and context-management challenges by composing higher-order functions rather than by scaling self-attention — generalizing intelligence one function at a time.
Internal systems in this lineage — ESP and ECO — are engineering artifacts of this author that instantiate the stance. They illustrate the architecture composition produces.
Evidence & Scope
HOF cognition is a position with an argument. Its foundation is the functional-programming tradition [2, 3, 4], lifted to runtime orchestration; its baselines are the field's live alternatives — fine-tuning [5], parameter-efficient adaptation [9, 10], and retrieval-augmented generation [6] — which composition arranges rather than discards. The internal systems named here, ESP and ECO, instantiate the stance and illustrate the architecture. The claim is precise: composition at the orchestration layer, above any single mechanism, is the organizing principle for systems that integrate behaviors, adapt without supervision, and manage their own context.
References
- Ashish Vaswani et al. (2017). Attention Is All You Need. Advances in Neural Information Processing Systems (NeurIPS). arXiv:1706.03762.
- 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]
- Jeremy Howard & Sebastian Ruder (2018). Universal Language Model Fine-tuning for Text Classification. Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (ACL). arXiv:1801.06146. [ULMFiT]
- Patrick Lewis et al. (2020). Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks. Advances in Neural Information Processing Systems (NeurIPS). arXiv:2005.11401. [RAG]
- Michael McCloskey & Neal J. Cohen (1989). Catastrophic Interference in Connectionist Networks: The Sequential Learning Problem. Psychology of Learning and Motivation.
- James Kirkpatrick et al. (2017). Overcoming Catastrophic Forgetting in Neural Networks. Proceedings of the National Academy of Sciences (PNAS). arXiv:1612.00796. [Elastic Weight Consolidation (EWC)]
- Edward J. Hu et al. (2022). LoRA: Low-Rank Adaptation of Large Language Models. International Conference on Learning Representations (ICLR). arXiv:2106.09685.
- Qingru Zhang et al. (2023). AdaLoRA: Adaptive Budget Allocation for Parameter-Efficient Fine-Tuning. International Conference on Learning Representations (ICLR). arXiv:2303.10512.
- Ziwei Ji et al. (2023). Survey of Hallucination in Natural Language Generation. ACM Computing Surveys. arXiv:2202.03629.