Abstract

Functional Atomic Decomposition (FAD) is an engineering discipline for building task-adaptive systems: complex behaviors are decomposed into small, single-purpose atomic functions, stored in a vector index for approximate-nearest-neighbor retrieval, and recombined at runtime by composition rather than by retraining a monolithic model. Two of its three mechanisms are established foundations FAD builds on — vector similarity search at scale is a solved systems problem [1], and function-level composition (compose, map, fold) is the standard vocabulary of functional programming [2, 3, 4]. The contribution is the third: applying that compositional vocabulary to runtime orchestration of cognitive primitives, indexed and retrieved by context. We describe the framework, give a worked Input–Process–Output (IPO) example, and isolate the question that decides it — whether context-driven retrieval selects the right primitives to compose. Fine-tuning [5] and retrieval-augmented generation [6] are the adaptation baselines FAD is positioned against.

1. Introduction

Adapting a general-purpose model to a specific task today usually means one of two things: fine-tuning, which specializes weights at the cost of catastrophic forgetting [7, 8] and the compute of full-parameter updates (mitigated but not eliminated by low-rank methods [9, 10]); or retrieval-augmented generation [6], which grounds output in retrieved context but inherits dependence on retrieval quality and does not close the hallucination gap [11].

FAD is a third organizing principle, orthogonal to both: instead of one large adapted model, maintain a library of small, well-scoped functions and select and compose the relevant ones per request. This is not a new claim about learning; it is a claim about software structure. Backus's Turing lecture argued for programs built by composing functions rather than by mutating state [2], Hughes showed that higher-order functions and lazy composition are what make functional programs modular [3], and functions as first-class, composable values trace to Strachey's foundational account [4]. FAD's wager is that this structure, applied to cognitive primitives that are retrieved by context rather than hard-wired, yields a system easier to reuse and reconfigure than a monolith. Whether it also runs cheaper or generalizes better is the empirical question the framework isolates.

2. Related Work

Vector-indexed retrieval of primitives. FAD stores atomic functions in a high-dimensional space and retrieves the most relevant by approximate nearest-neighbor (ANN) search — a mature, benchmarked systems technique. Billion-scale GPU similarity search is documented in FAISS [1], the reference point for retrieval at scale. Retrieval of content to condition generation is the RAG pattern [6]; FAD applies the same retrieval idea to functions rather than passages.

Compositional / functional programming. The vocabulary FAD uses — atomic functions, higher-order functions, map/fold/compose — is standard functional programming, formalized decades ago [2, 3, 4]. The vocabulary is prior art; the contribution is its application to runtime model orchestration.

Adaptation baselines. Fine-tuning [5, 12] and parameter-efficient variants [9, 10, 13] are the alternatives FAD is measured against on a shared task and dataset.

Attention. FAD's retrieval performs context-driven relevance weighting — selecting which functions matter for the current request. Its anchor is the transformer's attention mechanism [14], which weights inputs by learned relevance.

3. The FAD Framework

Design. Decompose a target capability — reasoning, decision-making, adaptation — into atomic functions that each perform one well-defined operation; index those functions in a vector space; and, per task, retrieve and compose the relevant subset.

4. Worked Example (Input–Process–Output)

Consider a decision task expressed in Input–Process–Output form. This illustrates the composition pattern [ILLUSTRATIVE]:

INPUT: a set of candidate options, each with observable features
PROCESS: retrieve(estimate-probability) ∘ retrieve(score-utility) ∘ retrieve(compare-threshold)
 where each retrieve(·) is an ANN lookup into the atomic-function index
OUTPUT: the selected option, or "abstain" if no option clears the threshold

The example makes a structural point: given the three primitives in the index and correct retrieval, the decision behavior is assembled by composition with no task-specific retraining. The variable that decides whether the composed behavior is accurate — and whether it costs less than a fine-tuned or RAG baseline — is retrieval: does context-driven ANN lookup select the right primitives. That is the measurable core of FAD, the point where the architecture meets a number.

5. Where This Is Useful

The compositional framing pays off where the same primitives recur across many tasks — language sub-operations such as parsing and contextual inference, control sub-operations such as intent detection and feedback generation — so the cost of building a primitive is amortized over reuse. This is engineering leverage from reuse [3], the intuition behind mixture-of-experts routing, and it is the ground on which FAD earns its keep: the more a primitive is reused, the more its one-time cost disperses across the tasks it serves.

Evidence & Scope

FAD is a design with an isolated, testable question. Its reusable substrate is prior art FAD stands on — ANN retrieval [1] and functional composition [2, 3, 4] — and its decomposition of a capability into specific atomic functions is a modeling choice, the object the framework exists to test rather than an assumption it hides. The measurement that settles FAD runs it against fine-tuning [5] and RAG [6] on a shared task, with retrieval accuracy as the variable that decides the outcome. The claim is a mechanism: generalizing across tasks by recomposing reusable atomic functions rather than scaling a single model.

References

  1. Jeff Johnson et al. (2019). Billion-Scale Similarity Search with GPUs. IEEE Transactions on Big Data. arXiv:1702.08734. [FAISS.]
  2. 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]
  3. John Hughes (1989). Why Functional Programming Matters. The Computer Journal.
  4. Christopher Strachey (2000). Fundamental Concepts in Programming Languages. Higher-Order and Symbolic Computation. [Reprint of 1967 lecture notes]
  5. 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]
  6. Patrick Lewis et al. (2020). Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks. Advances in Neural Information Processing Systems (NeurIPS). arXiv:2005.11401. [RAG]
  7. Michael McCloskey & Neal J. Cohen (1989). Catastrophic Interference in Connectionist Networks: The Sequential Learning Problem. Psychology of Learning and Motivation.
  8. 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)]
  9. Edward J. Hu et al. (2022). LoRA: Low-Rank Adaptation of Large Language Models. International Conference on Learning Representations (ICLR). arXiv:2106.09685.
  10. Qingru Zhang et al. (2023). AdaLoRA: Adaptive Budget Allocation for Parameter-Efficient Fine-Tuning. International Conference on Learning Representations (ICLR). arXiv:2303.10512.
  11. Ziwei Ji et al. (2023). Survey of Hallucination in Natural Language Generation. ACM Computing Surveys. arXiv:2202.03629.
  12. Jacob Devlin et al. (2019). BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. Proceedings of NAACL-HLT. arXiv:1810.04805.
  13. Neil Houlsby et al. (2019). Parameter-Efficient Transfer Learning for NLP. Proceedings of the 36th International Conference on Machine Learning (ICML). arXiv:1902.00751.
  14. Ashish Vaswani et al. (2017). Attention Is All You Need. Advances in Neural Information Processing Systems (NeurIPS). arXiv:1706.03762.