Abstract
By treating data and models as the source code, Foundation Models (FMs) become a new type of software. Mirroring the concept of software crisis, the increasing complexity of FMs making FM crisis a tangible concern in the coming decade, appealing for new theories and methodologies from the field of software engineering. In this paper, we outline our vision of introducing Foundation Model (FM) engineering, a strategic response to the anticipated FM crisis with principled engineering methodologies. FM engineering aims to mitigate potential issues in FM development and application through the introduction of declarative, automated, and unified programming interfaces for both data and model management, reducing the complexities involved in working with FMs by providing a more structured and intuitive process for developers. Through the establishment of FM engineering, we aim to provide a robust, automated, and extensible framework that addresses the imminent challenges, and discovering new research opportunities for the software engineering field.
The Impending Foundation Model Crisis
As Foundation Models (FMs) explode in complexity and variety, we are approaching an "FM crisis" reminiscent of the software crisis of the 1960s. The current landscape of model development is often likened to the "wild west," driven by four major challenges:
- Exponential Complexity: Model parameters are growing at an exponential rate—a "Moore’s Law" for NLP—making data management and training increasingly unwieldy.
- Continuous Evolution: Rapid update cycles (e.g., GPT-4 updates every few weeks) create maintenance hurdles for downstream developers.
- Diverse Customization: The explosion of the Hugging Face ecosystem (over 250,000 models) highlights a massive demand for domain-specific "expert" models.
- Collaboration Friction: Disconnects between data scientists, domain experts, and engineers often lead to friction in the development pipeline.
To address these, we must stop treating FMs as black-box artifacts and start treating them as software assets requiring rigorous engineering principles.
The Foundation Model Engineering (FME) Framework
We propose Foundation Model Engineering (FME) as a new discipline where data and architectures are treated as source code, and training is viewed as a form of compilation. The FME environment is built on two primary pillars: Data Management and Model Management.
Data Management
Rather than relying on labor-intensive manual labeling, FME advocates for weak supervision and declarative data cleaning. Developers use high-level specifications to define desired data characteristics (e.g., "-Toxicity," "+Fairness"). The system then automatically filters and labels datasets, treating the data as the primary specification for the model's behavior.
Model Management
This pillar mirrors traditional DevOps practices for the AI era:
- Model Selection: Utilizing a "Composition of Experts" (CoE) approach to automatically identify the optimal model for specific tasks.
- Parameter-Efficient Fine-Tuning (PEFT): Methods like LoRA allow for updating only a tiny fraction of parameters, making model versions lighter and easier to track.
- Model Merging: Treating fine-tuned models like code branches that can be merged via "task arithmetic" to combine capabilities without full retraining.
- Resource-Efficient Deployment: Implementing dynamic adapter loading to serve multiple specialized tasks from a single base model, significantly reducing GPU overhead.
Key Insights: Data as Source Code
The core philosophy of FME is the "Data as Source Code" analogy. In this paradigm, the dataset serves as the software specification. If a developer wants the model to behave differently, they "edit" the data and "recompile" (retrain or fine-tune).
This vision includes Declarative Programming for AI, where developers use high-level APIs to set constraints (e.g., "ensure an MIT license," "forget data after 2030") rather than writing low-level training loops. Furthermore, it necessitates Version Control for Parameters—a "Git for models" capable of tracking parameter-level changes, handling branching, and resolving merge conflicts.
Limitations and Future Outlook
Transitioning to FME faces several hurdles. Unlike deterministic code, natural language instructions and datasets are semantically ambiguous, complicating version control. Additionally, despite PEFT, the computational cost of FMs remains a barrier to truly agile development.
Future research should explore blockchain-based decentralized access control for data and formal verification methods. These would provide mathematical proof that a synthesized model adheres to declarative constraints regarding safety, privacy, and licensing. By establishing FME, we aim to provide a robust, automated framework that transforms FM development from an art into a principled engineering discipline.
Summary updated