Source-linked AI summary
Software Engineering Challenges of Deep Learning
Anders Arpteg, Björn Brinne, Luka Crnkovic-Friis, Jan Bosch
TL;DR
Building production-ready deep learning systems remains difficult because existing software-engineering tools and practices do not adequately address challenges such as estimation, debugging, and data testing. This interpretive study examines seven projects, identifies 12 challenges across development, production, and organizational areas, and maps them to the projects.
Problem
Building high-quality production-ready deep learning systems remains difficult because estimating results, debugging models, and testing data present substantial challenges.
Method
The study uses an interpretive research approach grounded in existing research and empirical studies of selected projects, mapping identified challenges to seven projects.
Results
The study identifies 12 challenges and categorizes them into development, production, and organizational areas, with mappings showing their applicability across seven projects.
Takeaways & Limitations
Further research is needed because traditional software-engineering tools and practices are rarely sufficient for building production-ready systems containing deep learning components.
Takeaways & Limitations
The study includes resource-intensive examples involving many days of processing on hundreds of machines.
Abstract
from arXiv · showhide
Surprisingly promising results have been achieved by deep learning (DL) systems in recent years. Many of these achievements have been reached in academic settings, or by large technology companies with highly skilled research groups and advanced supporting infrastructure. For companies without large research groups or advanced infrastructure, building high-quality production-ready systems with DL components has proven challenging. There is a clear lack of well-functioning tools and best practices for building DL systems. It is the goal of this research to identify what the main challenges are, by applying an interpretive research approach in close collaboration with companies of varying size and type. A set of seven projects have been selected to describe the potential with this new technology and to identify associated main challenges. A set of 12 main challenges has been identified and categorized into the three areas of development, production, and organizational challenges. Furthermore, a mapping between the challenges and the projects is defined, together with selected motivating descriptions of how and why the challenges apply to specific projects. Compared to other areas such as software engineering or database technologies, it is clear that DL is still rather immature and in need of further work to facilitate development of high-quality systems. The challenges identified in this paper can be used to guide future research by the software engineering and DL communities. Together, we could enable a large number of companies to start taking advantage of the high potential of the DL technology.
I. INTRODUCTION … C. Technical Debt
Deep learning offers broad opportunities but introduces software-engineering challenges because system behavior depends on data, infrastructure, external models, and evolving dependencies. This paper presents seven example systems, identifies key challenges in building DL systems, and validates their relevance across those systems.
- I. INTRODUCTION: DL has achieved promising results in computer vision, natural language understanding, and strategic decision-making, driving growing industry adoption.Large technology companies apply DL to services including translation, voice recognition, Street View, search, and virtual assistants.
- A. Machine Learning and Software Engineering: ML systems differ from traditional software because data partly replaces code and their behavior depends heavily on the external world.This makes data testing important alongside testing of implementation and model correctness.
- B. Big Data and Deep Learning: DL combined with big data creates transformative opportunities in finance, healthcare, manufacturing, and educational services.These opportunities depend on infrastructure capable of handling large-scale data and DL workloads.
- B. Big Data and Deep Learning: Integrating images, video, text, audio, and tabular data complicates data pipelines, while velocity requirements may require streaming and low-latency processing.Multiple formats create challenges in integrating and transforming data sources.
- B. Big Data and Deep Learning: Big-data DL systems may require ETL processes, distributed training algorithms, and specialized infrastructure because DL techniques are not trivially parallelized.Supporting technologies can include Apache Spark, Apache Flink, and Google DataFlow.
- C. Technical Debt: ML systems incur technical debt through code, data, external-world, external-model, pipeline, infrastructure, and configuration dependencies.Transfer learning and composed models add dependencies on separately trained external models that may change over time.
- C. Technical Debt: 95% of the code in a mature ML system might consist of plumbing and glue code connecting libraries, packages, pipelines, and infrastructure.Maintaining production systems is difficult when pipelines change fields, languages, formats, or infrastructure, or become deprecated.
- C. Technical Debt: The paper contributes seven example ML systems, identifies key SE challenges in building DL systems, and validates them by mapping challenges to experienced systems.Experimental code paths and weak configuration management are additional sources of accumulated maintenance and performance risk.
II. RESEARCH APPROACH
The study uses an interpretive research approach to identify challenges at the intersection of software engineering practices and deep learning applications. Its findings draw on seven machine-learning projects conducted with companies of varying sizes and types.
- Research scope: Seven example machine-learning projects were carried out in close collaboration with companies ranging from startups to large multinationals.The participating companies included organizations with thousands of employees and many millions of active users.
- Research scope: The projects covered different machine-learning types, including systems in production for more than 10 years and systems still in the prototype stage.The production examples began in 2005 and onward.
- Research scope: The study examines challenges specifically at the intersection of software engineering practices and deep learning applications.The challenges are based on existing research and validated through empirical studies of selected example projects.
- Research approach: The research treats software development as an activity conducted by people in organizations with differing values, expectations, and strategies.This organizational framing is part of the study’s interpretive case-study approach.
III. REAL-WORLD ML PROJECTS … C. Project RET: Predicting User Retention
The paper examines diverse real-world machine-learning projects, including production real-estate valuation, oil-and-gas recovery prediction, and user-retention prediction. These projects span different data sources, team structures, and operational settings that exemplify software-engineering challenges in developing ML systems.
- III. REAL-WORLD ML PROJECTS: The research selected diverse real-world ML projects to represent different aspects of software-engineering challenges.A mapping between the selected projects and the challenges is presented later in the paper.
- A. Project EST: Real Estate Valuation: Project EST is a neural-network real-estate valuation system used in production by multiple Swedish banks for more than 10 years.The system supports assessing market values and collateral securities when banks issue loans.
- A. Project EST: Real Estate Valuation: Project EST uses historical sales, property information, demographics, and geography to estimate real-estate values.It was developed by two data scientists and two backend developers using an existing SQL database and legacy data-pipeline scripts.
- B. Project OIL: Predicting Oil and Gas Recovery Potential: Project OIL investigated deep learning to predict Estimated Ultimate Recovery from geological information in tight gas and oil reservoirs.The project was initiated by a US oil and gas exploration company.
- B. Project OIL: Predicting Oil and Gas Recovery Potential: Project OIL combined high-resolution geological maps with a small number of sufficiently mature wells to build a decision-support tool.Given coordinates in the Eagle Ford Shale, the tool predicts the EUR of an average multi-stage hydraulically fractured horizontal well; two senior data scientists/developers formed the team.
- C. Project RET: Predicting User Retention: Project RET comprises projects built by different teams for a media-streaming service to predict the percentage of users remaining active two weeks after registration.The problem is difficult because only a small amount of data is available per user.
D. Project WEA: Weather Forecasting … G. Project REC: Media Recommendations
The projects applied deep learning to weather forecasting, fraud detection, poker-bot identification, and media recommendations, using domain-specific data and hybrid or generalized modeling approaches. Their aims included improving prediction and detection, addressing novel-content recommendation, and confronting production uncertainty.
- D. Project WEA: Weather Forecasting: Project WEA sought to use deep learning for weather forecasts, ultimately aiming to build better wind turbine generator predictions.The project was conducted with a national meteorological agency.
- D. Project WEA: Weather Forecasting: WEA used more than 1 TB of data spanning 12 years, including satellite images, meteorological observations, and topological maps.The team included three data scientists, two developers, and meteorologists.
- E. Project CCF: Credit Card Fraud Detection: Project CCF aimed to build a generalized model for detecting fraudulent deposits by combining payment details with customer and activity histories.The project addressed fraud risks in gaming, including money laundering through stolen credit cards.
- E. Project CCF: Credit Card Fraud Detection: CCF focused on improving fraud-detection efficiency while reducing risky payments blocked by hand-crafted rule sets.Its data included payment request attributes and customer details such as payment history and activity history.
- F. Project BOT: Poker Bot Identification: Project BOT used gameplay activity and client technical details to identify automated poker players.Models were developed by a small consultancy team with internal experts.
- F. Project BOT: Poker Bot Identification: Despite promising results, BOT was cancelled before completion because the finished product’s efficiency was unpredictable.The project used statistics on player actions, connection IPs, hardware fingerprints, and clicking or timing behavior.
- G. Project REC: Media Recommendations: Project REC addressed recommending new media content when collaborative filtering lacks sufficient user or content data.The recommendation setting was motivated by media-streaming services and the importance of understanding user preferences and contexts.
- G. Project REC: Media Recommendations: REC used deep convolutional networks to learn preferences from raw media data and proposed a hybrid system combining collaborative filtering with deep learning.Deep learning supported recommendations for novel content without user usage data.
IV. SELECTED CHALLENGES · A. Development Challenges · 1) Experiment Management:
The paper groups machine-learning software-engineering challenges into development, production, and organizational categories, with experiment management focusing on reproducibility, version control, and long-term maintenance. ML development is difficult to plan and estimate because data, models, configurations, and execution environments strongly affect system behavior.
- IV. SELECTED CHALLENGES: The identified challenges are organized into development, production, and organizational categories.
- A. Development Challenges: ML systems are difficult to plan because data programs them automatically and performance remains unknown until testing with given data.
- A. Development Challenges: Opaque, complex models and lazy-execution libraries make debugging difficult and hinder effort estimation.
- 1) Experiment Management:: Reproducible experiments require tracking the exact hardware, platform, source code, configuration, training data, and model state.These dependencies make experiment management more demanding than conventional software version control.
- 1) Experiment Management:: Different data versions can produce different results, while heterogeneous data sources complicate version control for ML systems.
- 1) Experiment Management:: Training creates model versions with distinct parameters and metrics, and data dependencies plus configuration parameters complicate long-term maintenance.Hyperparameter tuning and automated meta-optimization can generate hundreds of model variants.
- 1) Experiment Management:: DL systems automatically form abstractions, but developers cannot reliably predict the resulting abstraction layers or isolate specific functionality.
2) Limited Transparency: · 3) Troubleshooting: · 4) Resource Limitations:
Deep learning systems trade transparency for accuracy, making outcomes difficult to predict and models difficult to debug. Troubleshooting and resource limitations are compounded by non-imperative execution, massive parameter spaces, distributed infrastructure, and inadequate data-testing tools.
- 2) Limited Transparency:: End-to-end neural networks trade transparency for accuracy, making complex-system behavior inherently difficult to explain.This tradeoff accompanies advances in computer vision and speech recognition.
- 2) Limited Transparency:: Deep learning systems are difficult to evaluate before training and testing, while limited understanding of neural-network internals complicates traditional debugging.Neural networks combine functional components with memory and may distribute their structure across multiple machines.
- 3) Troubleshooting:: Lazy execution graphs in TensorFlow and Apache Spark make code troubleshooting and debugging difficult with traditional software-engineering tools.PyTorch avoids the lazy-execution-graph issue but has a lower adoption rate in the AI community.
- 3) Troubleshooting:: Manual evaluation is often impossible because inspecting millions of parameters is impractical, while small source-code bugs may escape compile-time and run-time detection.During training, developers or data scientists may receive only a global error estimate.
- 3) Troubleshooting:: Distributed data processing, model training, evaluation, and serving add complexity, while limited GPU memory can require splitting models across multiple GPUs.The added complexity arises from both data volume and computational requirements.
- 4) Resource Limitations:: Distributed systems for data processing and deep-learning training require additional expertise, operating time, hardware, software management, and cost.Examples include Apache Spark, Distributed TensorFlow, and TensorFlowOnSpark.
- 4) Resource Limitations:: ML systems require testing of pipeline, training, serving, and data components, but few data-testing tools exist compared with software-testing tools.Small dataset samples may omit edge cases present in the full dataset.
5) Testing: … 2) Monitoring and Logging:
Deep learning systems are difficult to test and operate because training can be nondeterministic, production behavior can diverge from training, dependencies and hardware evolve rapidly, and external data can change system performance. Consequently, production systems require extensive maintenance, monitoring, and safeguards beyond conventional testing.
- 5) Testing:: Nondeterministic training algorithms and training-serving skew make model testing especially challenging, making appropriate tests crucial.Data processing and model serving may use implementations that differ from training or testing.
- 1) Dependency Management:: DL software platforms update weekly or daily, creating production issues despite noticeable improvements and motivating systems to track hardware development.Long training times, typically days to several weeks, strengthen the incentive to maximize performance.
- 1) Dependency Management:: Changing hardware and software can undermine reproducibility and impose significant engineering costs for keeping systems up to date.DL systems are primarily trained on GPUs, which provide a 40-100x speedup over classic CPUs.
- 1) Dependency Management:: Production-ready ML systems require far more work than toy examples or offline prototypes, including handling deployment edge cases and ongoing maintenance.People commonly fail to recognize the effort needed to maintain a deployed ML system over time.
- 2) Monitoring and Logging:: Frequent retraining and changes in the external world can autonomously alter system behavior, making unit and integration tests insufficient and invalidating old thresholds.Data drift can render manually assigned thresholds no longer valid.
- 2) Monitoring and Logging:: Live performance monitoring can help detect problems, but selecting appropriate metrics to monitor is challenging.Monitoring must account for behavior changes caused by modified dependencies and data sources.
- 2) Monitoring and Logging:: Because ML systems are open-ended and driven by external data, final performance remains heavily dependent on that data and may introduce hidden feedback loops.When models are used directly by end-users, their outputs can change the reality they attempt to understand.
3) Unintended Feedback Loops: · 4) Glue Code and Supporting Systems: · C. Organizational Challenges
The sections identify instability from unintended feedback, the disproportionate role of glue code and supporting systems, and organizational difficulty in coordinating and estimating ML production work. ML projects also require uncertain iterations before learned models achieve acceptable results.
- 3) Unintended Feedback Loops:: Widely used ML systems can create unintended feedback loops in which real-world systems adapt to model predictions rather than models adapting to reality.A real-estate price predictor could make its predictions self-fulfilling; positive feedback loops are inherently unstable except in controlled special cases.
- 4) Glue Code and Supporting Systems:: In a production-ready DL system, only 5% of the code may handle the model, while the rest is glue code connecting supporting systems and libraries.
- 4) Glue Code and Supporting Systems:: Cloud services can accelerate development and reduce maintenance, but updating glue code and adapting to external service changes can create production challenges.
- C. Organizational Challenges: Putting an ML model into production usually requires collaboration among teams with differing ideas, priorities, and cultural values.This creates cultural challenges and makes it difficult to estimate the effort required from different teams.
- C. Organizational Challenges: Compared with non-ML projects, ML projects make time and resource estimation harder because learned-model performance remains uncertain despite a defined goal.Non-ML projects benefit from reductionist modular design, whereas ML projects may require an unknown number of iterations before results become acceptable.
- C. Organizational Challenges: ML projects resemble research projects because an unknown number of iterations may be needed before model results reach acceptable levels.This uncertainty can make it difficult to reduce scope and run the project in a time-based setting.
1) Effort Estimation: … V. PROJECT CHALLENGE MAPPINGS
Deep learning systems are difficult to develop and manage because complex models limit transparency, privacy and data-safety requirements complicate engineering work, and collaboration across differing roles can require substantial effort. The paper maps identified challenges to selected projects, marking clearly experienced challenges with “X” and non-applicable ones with “-”.
- 1) Effort Estimation:: Complex and poorly understood deep learning models make it difficult to understand how they work or how to modify them for better results.Their lack of transparency is inherent in many machine-learning models, especially powerful DL systems.
- 1) Effort Estimation:: Distributed knowledge in neural-network weights makes it difficult to control where and how information is stored, complicating performance, data exploration, and troubleshooting.The internal mechanism of specialization in specific network regions remains poorly understood.
- 2) Privacy and Data Safety:: Privacy and data-safety regulations add significant challenges to developing and managing machine-learning systems.The passage specifically connects these challenges to efforts such as the European General Data Protection Regulation.
- 2) Privacy and Data Safety:: More work is needed to protect sensitive datasets while preserving efficient data exploration, model development, and troubleshooting.Existing approaches include differential privacy, k-anonymity, and encrypted networks using homomorphic encryption.
- 2) Privacy and Data Safety:: Transforming a prototype into a production-ready ML system that integrates with existing backend and frontend systems usually requires significantly larger effort.Data scientists may prioritize results in controlled environments, while engineering teams emphasize maintainability and stability.
- 3) Cultural Differences:: Differences in culture, skills, and interests among data scientists, software engineers, and UX designers can hinder collaboration on production-ready ML systems.Data scientists may lack software-engineering skills and understanding of good engineering practices, while UX designers may work in different ways.
- V. PROJECT CHALLENGE MAPPINGS: The project mapping uses “X” for challenges clearly experienced by a project and “-” when a challenge is not applicable, such as when a project was never deployed.Table I lists three-letter project acronyms in its top row, with further explanations provided afterward.
A. Experiment Management … D. Resource Limitations
The projects exposed recurring challenges in managing experiments, explaining model decisions, troubleshooting failures, and meeting substantial computational-resource demands. These difficulties caused lost work, extensive experimentation, prolonged debugging, and processing across hundreds of machines.
- A. Experiment Management: A code refactoring accidentally enabled data shuffling, significantly reducing model performance and costing several days to identify and resolve.The incident illustrates how difficult it is to understand whether code modifications influenced model behavior across experiments.
- B. Limited Transparency: Engineers struggled to understand why the OIL neural network made decisions because the model was virtually a black box.Sensitivity analysis estimated geological-parameter impacts but could not fully account for when those parameters affected decisions.
- C. Troubleshooting: Hundreds of experiments over two weeks were needed to investigate poor reconstructed-output resolution in the weather prediction system.The autoencoder’s low-quality output had no immediately obvious explanation during early testing.
- C. Troubleshooting: A lack of easy-to-use debugging tools prolonged identification of the weather system’s error.The cause was an overly aggressive pooling operation that lost resolution before encoding.
- D. Resource Limitations: Resource limitations included insufficient CPU or GPU memory, long training times, and low-latency serving requirements.Distributed data processing was one reason special techniques were needed before model training.
- D. Resource Limitations: The media recommendations service combined collaborative filtering with deep learning to recommend novel media seen only a few times by a user.Its deep-learning component created both data-processing and resource-management demands.
- D. Resource Limitations: The resource demands involved many days of processing on hundreds of machines, creating both big-data processing and distributed deep-learning training challenges.This example demonstrates the scale of infrastructure required for some production deep-learning workloads.
E. Effort Estimation … VI. RELATED WORK
The paper describes practical challenges in estimating effort, protecting privacy, and coordinating stakeholders in DL projects, while related work highlights technical debt, production-readiness, and engineering issues at the intersection of ML, databases, and big data.
- E. Effort Estimation: Uncertain effort estimates and the difficulty of setting a final delivery date can cause DL projects to be cancelled despite promising progress.Project BOT was cancelled by business owners even though the ML team considered its development to be proceeding well.
- F. Privacy and Safety: Privacy requirements to anonymize and encrypt personal data can prevent useful information from being readily used for model training and system development.The affected information may include gender, age, and city, even though it could improve model performance.
- G. Cultural Differences and Logging: Product owners may resist implementing sufficient logging because it takes time, leaving data scientists without enough data for accurate second-week retention predictions.The resulting disagreements can arise between data scientists and product owners.
- VI. RELATED WORK: Related work identifies hidden technical debt risks in ML systems, including boundary erosion, entanglement, hidden feedback loops, undeclared consumers, data dependencies, configuration issues, and external-world changes.These risks were explored as multiple dimensions of ML-system challenges.
- VI. RELATED WORK: Complex ML models can erode abstraction boundaries and entangle signals with parameters, so changing one element can affect the entire system.The CACE principle is summarized as “Changing Anything Changes Everything,” including changes to external data and hyperparameters.
- VI. RELATED WORK: Transfer learning can create correction cascades in which a small improvement in a dependency decreases the performance of the consuming system.This occurs when complex models are composed of submodels.
- VI. RELATED WORK: A production-readiness scoring system ranges from 0 points for a research prototype to 12+ points for exceptional automated testing and monitoring, covering tests for features and data, model development, infrastructure, and monitoring.The scoring approach focuses on ML-specific tests needed for production-ready systems.
- VI. RELATED WORK: Database and big-data research offers relevant engineering perspectives for DL, including distributed computing, memory management, system optimization, and recognition that big data adds significant engineering challenges.Database techniques may help accelerate training speed, while big-data research reviews challenges and opportunities at the fields’ intersection.
VII. CONCLUSIONS
The research identifies software engineering challenges in building production-ready systems with deep learning components, especially for companies lacking large research groups and advanced infrastructure. It describes seven projects and 12 challenges across development, production, and organizational areas, while concluding that further research and better tools and practices are needed.
- Conclusions: Production-ready deep learning systems remain difficult to build, particularly for companies without large research groups and highly developed supporting infrastructure.The paper contrasts deep learning’s promising results with the practical challenges of integrating deep learning components into production systems.
- Conclusions: 12 challenges were identified across development, production, and organizational areas from seven projects illustrating the potential of machine learning and deep learning.The projects were used to identify problematic areas and challenges in building systems with deep learning components.
- Conclusions: Traditional software engineering tools and practices for reviewing, testing, and debugging code are rarely sufficient for production-ready systems containing deep learning components.The conclusion calls for further research and development to make high-quality production-ready deep learning systems easier and more efficient to build.