In-Run Data Shapley for Adam Optimizer

Learn how our Adam-aware In-Run Data Shapley achieves near-perfect fidelity to true contributions while maintaining throughput, outperforming SGD-based methods.

viernes, 24 de julio de 2026 • 5 min read • Q2BSTUDIO Team

Nuevo método de Shapley para optimizadores adaptativos

In the current machine learning ecosystem, data attribution has become a fundamental pillar for ensuring fair, efficient, and transparent models. When we talk about 'In-Run Data Shapley for the Adam Optimizer,' we delve into one of the most complex frontiers of modern artificial intelligence: how to correctly assign the merit of each training sample to the model's final performance. Traditionally, the Shapley value has been considered the theoretical gold standard for this task, but its calculation requires re-evaluating the model with every subset of data—a prohibitive process even for medium-sized datasets. This has led to 'in-run' methods that estimate contributions during training itself, though so far they have been limited to linear optimizers like stochastic gradient descent (SGD). With the advent of Adam and other adaptive optimizers, the need for specific approaches has become critical. At Q2BSTUDIO, as a company specializing in custom software and artificial intelligence solutions, we understand that accurate data attribution not only improves model transparency but also reduces computational waste and mitigates biases in production environments.

The reason classical methods fail with Adam lies in its adaptive nature. While SGD updates weights with a uniformly scaled gradient, Adam dynamically adjusts the learning rate for each parameter based on first and second moments. This breaks the linearity that traditional 'in-run' methods rely on to compute Shapley values. In fact, recent studies show that SGD-based proxies diverge significantly from actual contributions under Adam, with Pearson correlations as low as 0.11. In practice, this means that companies using Adam to train language models, recommendation systems, or computer vision models cannot trust existing attributions for debugging data or identifying harmful samples. To address this, research proposes a new approach: 'Adam-Aware In-Run Data Shapley.' This method redefines the utility function under a fixed-state assumption, enabling a closed-form approximation that restores the additivity needed for Shapley. It also introduces the 'Linearized Ghost Approximation,' a technique that linearizes the variance-dependent scaling term and computes pairwise gradient dot products without materializing per-sample gradients. The result is near-perfect fidelity (R > 0.99) to true marginal contributions while retaining approximately 95% of standard training throughput.

Why should a tech company care about this? Because data attribution is not an academic luxury; it is an operational necessity. For example, in a data pipeline for a recommendation system, identifying which users or interactions negatively contribute to the model allows filtering anomalies without losing valuable information. Similarly, in critical applications like cybersecurity, where models are trained to detect intrusions, knowing which training data biases the detector can prevent false positives that affect real operations. At Q2BSTUDIO we offer cybersecurity services that integrate these attribution techniques to ensure more robust models. Additionally, our cloud solutions—on both AWS and Azure—allow scaling of training and attribution processes without compromising performance, using container orchestration and optimized storage. The combination of an Adam optimizer with reliable attribution opens the door to a new generation of AI-based applications, from autonomous agents to Business Intelligence systems powered by Power BI that explain their predictions in real time.

From a technical perspective, implementing this new in-run data Shapley requires minimal changes to the training code. The key lies in the efficient calculation of the dot product between gradients, achieved through a linear approximation without storing the full vectors. This is especially relevant when working with large models, such as transformers or deep convolutional networks, where the memory cost of individual gradients is prohibitive. By avoiding materialization, the method becomes practical even in resource-constrained environments. On the other hand, redefining utility under a fixed state means that, during an update window, we consider the model weights unchanged, allowing the additive decomposition of Shapley. Although this introduces a small temporal bias, empirical results show that accuracy remains far above any existing alternative.

In a business context, adopting these techniques can make the difference between a model that works well in tests and one that delivers real value. For instance, a company developing custom software for logistics may need to train a demand prediction model using Adam. Without reliable attribution, it would be difficult to know if certain atypical historical sales data are biasing the model toward low-demand periods. With the new method, each sample can be audited and decisions made to keep, weight, or remove it. This not only improves accuracy but reduces retraining time and cloud resource consumption. At Q2BSTUDIO, as custom software developers, we integrate these capabilities into our clients' platforms, combining them with Power BI dashboards that visualize the contribution of each data source. Furthermore, our AI agents can use attribution to explain their decisions, increasing end-user trust.

For companies already migrating to the cloud, compatibility with AWS and Azure is crucial. Training pipelines on platforms like SageMaker or Azure ML can directly benefit from this technique, as it requires no specialized hardware or infrastructure changes. Simply adding a few lines of code to instantiate the Shapley estimator adapted to Adam yields an attribution trace that can be stored in databases or data warehouses like Redshift or Azure Synapse. Subsequently, that data can be consumed by BI tools to generate data quality reports or to feed self-learning systems that optimize sample selection in real time. In this sense, data attribution becomes a strategic asset, not only for data science but for the entire organization.

Finally, it is worth noting that the described approach is not a closed solution but a starting point for future extensions. For example, it can be adapted to other adaptive optimizers like RMSprop or Nadam, or even to variants of Adam such as AdamW. It is also possible to combine it with differential privacy techniques to ensure that attribution does not reveal sensitive information from samples. At Q2BSTUDIO, we are exploring these applied research lines to offer our clients artificial intelligence solutions that are not only powerful but also responsible and auditable. If your company seeks to implement models with reliable attribution or needs advice on how to integrate these techniques into your technology ecosystem, do not hesitate to contact us. Transparency in data is the first step toward truly useful and ethical artificial intelligence.

A BREAK?

Play for a moment before you go

OUR SERVICES

How we can help you

Do you have a project in mind?

Tell us your vision and we'll turn it into a software solution. Whatever the scope, we make your idea real.