## 2 Materials and Methods
### MTL Model Construction  
In this study, we employed the Neural Factorization Machine (NFM) [28] as the core deep learning architecture to model the intricate interactions between patients and their clinical characteristics for the outcome prediction, i.e., frailty status, length of hospital stay and mortality. NFM is a powerful ML framework that integrates the strengths of Factorization Machines (FMs) and deep neural networks to capture nonlinear, high-order interactions among features in a high-dimensional space [28; 34]. Building upon the traditional FM model, which is capable of learning second-order feature interactions by enumerating all pairwise cross-feature terms, NFM enhances the model's representational capacity by introducing a neural network layer to process the learned feature embeddings. This architecture allows NFM to go beyond linear and pairwise relationships, making it well-suited for capturing the complex dependencies commonly found in clinical datasets. The foundational equation for the FM component is presented below:  
\[F(X)=w_{0}+\sum_{i=1}^{n}w_{i}x_{i}+f_{FM}(X) \tag{2}\]  
where \(f_{FM}(X)=\sum_{i=1}^{n}\sum_{j=i+1}^{n}v_{i}x_{i}\odot v_{j}x_{j}\) and \(v_{i}x_{i}\odot v_{j}x_{j}\), i.e., \(V_{i}\odot V_{j}\), denotes the element-wise product of two representations. If we remove the \(f_{FM}(X)\) part, then the Formula (2) becomes a first-order calculation, which is equivalent to linear regression. However, FM does not consider higher-order interactions, and due to the limitation of combinatorial explosion, the model is not easily extendable to third-order feature interactions. NFM addresses this problem by using a DL model [28]. The equations are shown below:  
\[F(X)=w_{0}+\sum_{i=1}^{n}w_{i}x_{i}+f_{NFM}(X) \tag{3}\]  
\[f_{NFM}(X)=W_{n}\ldots\left(W_{2}(W_{1}f_{FM}(X)+b_{1})+b_{2}\right)\ldots+b_{n} \tag{4}\]  
where \(W_{n}\) is the neuron weights of \(n\)-th layers, and \(b_{n}\) denotes the corresponding bias. Structurally, the NFM architecture closely resembles that of the traditional FM. If no hidden layers are added to the \(f_{NFM}(X)\), the NFM model can be effectively reduced to the standard FM model. Here, we include NFM as a STL baseline to evaluate and compare its performance against our proposed multi-task learning (MTL) models. Traditional machine learning models are typically trained independently for individual tasks, a paradigm known as STL. In STL, a separate model is designed, trained, and optimized for each specific predictive task, without leveraging information from related tasks. In contrast, MTL is designed to simultaneously learn multiple related tasks, allowing shared knowledge to be transferred across tasks to improve generalization and performance. In this work, we adopted the hard parameter sharing framework [13], a widely used MTL strategy in which the model's parameters are partitioned into shared components and task-specific components, which are independently optimized for each task. The overall architecture of our proposed framework is illustrated in Figure 2. Following the embedding layer, each task is assigned a distinct output layer to capture first-order feature interactions, with task-specific weights applied to balance each feature field. To capture higher-order interactions, a shared layer is employed, allowing the model to learn common latent structures across tasks. This design helps mitigate task-specific bias while enabling the model to strike a balance between specialization and generalization. The formulation of our model MTL framework based on NFM is shown as follows:  
\[F_{t}(X)=w_{0}^{t}+\sum_{i=1}^{n}w_{i}^{t}x_{i}+h^{t}(f_{\mathit{shared}}(X))+ b^{t} \tag{5}\]  
\[f_{\mathit{shared}}(X)=f_{NFM}(X) \tag{6}\]  
Here, \(t\) represents an individual task, \(w_{0}^{t}\) and \(w_{i}^{t}\) are the learned weights for the first order. Each task is not only fed with the learned embeddings from the shared layer, but also the embeddings from the task-specific final layer for the first-order and high-order interactions, respectively.