## 3 Methodology
### Co Hoc Explainability Framework  
In contrast to the pre hoc framework, the Co Hoc Explainability Framework jointly optimizes both the predictor model \(f_{\theta}\) and the explainer model \(g_{\phi}\) during training. This approach allows the explainer to adapt to the predictor and vice versa, resulting in a more coherent and interpretable system.  
The loss function for the co hoc framework is given by the following:  
\[\begin{split}&\mathcal{L}_{\text{Co hoc}}(\theta,\phi,X,y)= \underbrace{\frac{1}{N}\sum_{i=1}^{N}-y_{i}\log(\hat{y}_{\theta,i})-(1-y_{i}) \log(1-\hat{y}_{\theta,i})}_{\text{Predictor Accuracy}}\\ &+\underbrace{\frac{1}{N}\sum_{i=1}^{N}-y_{i}\log(\hat{y}_{ \phi,i})-(1-y_{i})\log(1-\hat{y}_{\phi,i})}_{\text{Explainer Accuracy}}\\ &+\underbrace{\lambda_{1}\frac{1}{2}(\sum_{i=1}^{N}\ln\left( \frac{\hat{y}_{\phi,i}}{\hat{y}_{\phi,i}}\right)\hat{y}_{\phi,i}+\sum_{i=1}^{N }\ln\left(\frac{\hat{y}_{\theta,i}}{\hat{y}_{\phi,i}}\right)\hat{y}_{\phi,i} \right)}_{\text{Fidelity}}\\ &+\underbrace{\lambda_{2}\sum_{j}\theta_{j}^{2}}_{\text{Predictor Regularization}}+\underbrace{\lambda_{3}\sum_{j}\phi_{j}^{2}}_{\text{Explainer Regularization}},\end{split} \tag{15}\]  
The primary distinction between the co hoc and pre hoc frameworks lies in the joint optimization of the predictor \(f_{\theta}\) and explainer \(g_{\phi}\) through simultaneous stochastic gradient descent with mini-batches. In the co hoc framework, both models are trained to minimize the combined loss function \(\mathcal{L}_{\text{Co hoc}}\), which includes accuracy terms for both models, a fidelity term, and regularization terms.  
The optimization procedure for the co hoc framework is as follows:  
1. Initialize the parameters \(\theta\) of the predictor model and \(\phi\) of the explainer model.
2. For each mini-batch of training data: 1. Compute the predictions of both models: \(\hat{y}_{\theta}\) and \(\hat{y}_{\phi}\). 2. Calculate the combined loss function \(\mathcal{L}_{\text{Co hoc}}\). 3. Update both sets of parameters \(\theta\) and \(\phi\) using gradient descent.  
Comparison of Pre Hoc and Co Hoc Frameworks  
While both frameworks aim to improve model explainability through in-training integration, they differ in their practical implementation and computational requirements:  
Training Complexity: The pre hoc framework requires sequential training--first the explainer model \(g_{\phi}\), then the predictor model \(f_{\theta}\). This results in approximately \(1.2\times\) the standard training time. In contrast, the co hoc framework performs joint optimization, requiring approximately \(1.5\times\) the standard training time due to the need to compute gradients for both models simultaneously.  
Model Coupling: Pre hoc uses a fixed explainer model to guide the predictor, making it suitable when a well-established interpretable model exists. Co hoc allows both models to adapt to each other, potentially achieving better alignment but requiring careful hyperparameter tuning to balance the competing objectives.  
Use Case Recommendations: Pre hoc is recommended when computational resources are limited or when a pre-trained interpretable model is available. Co hoc is preferred when maximum fidelity is required and computational overhead is acceptable, as evidenced by its consistently higher fidelity scores (Table 1).