Computing system and method for fairness-aware quantization of deep-learning AI models
Disclosed herein is a computing platform configured to (i) for a deep-learning AI model, determine a respective fairness-importance score of a respective parameter for at least a subset of the deep-learning AI model's parameters that quantifies how much the respective parameter influences generating fair predictions across a plurality of demographic groups, (ii) carry out an optimization process that produces and evaluates different quantized versions of the deep-learning AI model, (iii) based on the optimization process, select a given quantized version of the deep-learning AI model for deployment, (iv) fine-tune the given quantized version of the deep-learning AI model, and after fine-tuning the given quantized version of the deep-learning AI model, deploying the given quantized version of the deep-learning AI model.
1 . A computing platform comprising:
at least one processor;
at least one non-transitory computer-readable medium; and
program instructions stored on the at least one non-transitory computer-readable medium that, when executed by the at least one processor, cause the computing platform to:
for a deep-learning artificial intelligence (AI) model:
determine a baseline group-specific fairness metric for each individual demographic group of a plurality of demographic groups that quantifies a performance of the deep-learning AI model in predicting outcomes for the individual demographic group;
determine fairness-importance scores for at least a subset of the deep-learning AI model's parameters by, for each respective parameter in the subset:
perturbing the respective parameter;
determining, for each individual demographic group of the plurality of demographic groups, a group-specific fairness-metric differential that quantifies an extent to which perturbing the respective parameter changes the performance of the deep-learning AI model in predicting outcomes for the individual demographic group relative to the baseline group-specific fairness metric for the individual demographic group; and
determining a respective fairness-importance score of the respective parameter based on the group-specific fairness-metric differentials that are determined for the individual demographic groups of the plurality of demographic groups;
carry out an optimization process that produces and evaluates different quantized versions of the deep-learning AI model that each differ from one another with respect to one or both of (i) which group of the deep-learning AI model's parameters have their precision frozen during quantization, wherein the group of the deep-learning AI model's parameters that have their precision frozen during quantization is determined based on the fairness-importance scores that are determined for at least the subset of the deep-learning AI model's parameters, and (ii) which quantization strategy was utilized to reduce a precision of the deep-learning AI model's parameters that did not have their precision frozen during quantization;
based on the optimization process, select a given quantized version of the deep-learning AI model for deployment;
fine-tune the given quantized version of the deep-learning AI model; and
after fine-tuning the given quantized version of the deep-learning AI model, deploy the given quantized version of the deep-learning AI model.
2 . The computing platform of claim 1 , further comprising program instructions stored on the at least one non-transitory computer-readable medium that, when executed by the at least one processor, cause the computing platform to:
receive data defining configuration settings that are input via a given client device associated with a user, wherein the configuration settings define strategies for one or more of (i) carrying out the optimization process, or (ii) fine-tuning the given quantized version of the deep-learning AI model.
3 . The computing platform of claim 2 , wherein the configuration settings comprise one or more of (i) group-level fairness settings that comprise constraints for maintaining a group-specific fairness metric above a given threshold for each of the plurality of demographic groups, (ii) fairness-analysis settings for establishing the baseline group-specific fairness metric for each of the plurality of demographic groups, (iii) quantization settings, or (iv) fine-tuning settings.
4 . The computing platform of claim 1 , wherein:
the baseline group-specific fairness metric for each individual demographic group of the plurality of demographic groups comprises a true positive prediction rate, false positive prediction rate, or a false negative prediction rate; and
for each respective parameter in the subset of the deep-learning AI model's parameters, determining the respective fairness-importance score of the respective parameter based on the group-specific fairness-metric differentials that are determined for the individual demographic groups of the plurality of demographic groups comprises determining a maximum absolute difference in group-specific fairness-metric differentials between any two of the plurality of demographic groups.
5 . The computing platform of claim 1 :
wherein the different quantized versions of the deep-learning AI model that are produced and evaluated comprise a first quantized version of the deep-learning AI model, and a second quantized version of the deep-learning AI model; and
wherein selecting the given quantized version of the deep-learning AI model for deployment comprises:
determining whether the first quantized version of the deep-learning AI model satisfies a set of one or more optimization constraints that is applicable to any quantized version of the deep-learning AI model;
based on the determination that the first quantized version of the deep-learning AI model satisfies the set of one or more optimization constraints, determining an objective value for the first quantized version of the deep-learning AI model;
determining whether the second quantized version of the deep-learning AI model satisfies the set of one or more optimization constraints; and
based on the determination that the second quantized version of the deep-learning AI model satisfies the set of one or more optimization constraints:
determining an objective value for the second quantized version of the deep-learning AI model;
comparing the objective value for the first quantized version of the deep-learning AI model with the objective value for the second quantized version of the deep-learning AI model; and
based on the comparison, retaining one of the first or second quantized version of the deep-learning AI model with a better objective value and discarding the other,
wherein the objective value for each quantized version of the deep-learning AI model is determined based at least on (i) a prediction error of the quantized version of the deep-learning AI model, (ii) a fairness error of the quantized version of the deep-learning AI model, and (iii) a fairness-balancing coefficient applied to the fairness error.
6 . The computing platform of claim 5 , wherein the set of one or more optimization constraints for any quantized version of the deep-learning AI model comprises a model size constraint, a predictive accuracy constraint, or a prediction time constraint.
7 . The computing platform of claim 5 , wherein selecting the given quantized version of the deep-learning AI model for deployment further comprises:
based on the determination that the second quantized version of the deep-learning AI model does not satisfy the set of one or more optimization constraints, discarding the second quantized version of the deep-learning AI model.
8 . The computing platform of claim 1 , wherein fine-tuning the given quantized version of the deep-learning AI model comprises:
applying a Low-Rank Adaptation (LoRA) technique to fine-tune the given quantized version of the deep-learning AI model.
9 . The computing platform of claim 8 , wherein applying the LoRA technique to fine-tune the given quantized version of the deep-learning AI model comprises:
inserting one or more low-rank matrices into selected layers of the given quantized version of the deep-learning AI model; and
updating the one or more low-rank matrices while keeping quantized parameters of the given quantized version of the deep-learning AI model frozen to minimize an overall loss function comprising (i) a task loss component that measures predictive accuracy of the given quantized version of the deep-learning AI model, (ii) a penalty loss component that measures the extent to which the given quantized version of the deep-learning AI model violates fairness objectives aimed at reducing disparities across the plurality of demographic groups, and (iii) a penalty coefficient applied to the penalty loss component.
10 . The computing platform of claim 1 , wherein the deep-learning AI model is configured to generate predictions related to whether a financial institution should extend a particular type of service to individuals from the plurality of demographic groups, wherein the particular type of service comprises one of a loan, a credit card account, a bank account, or a mortgage service.
11 . The computing platform of claim 1 , further comprising program instructions stored on the at least one non-transitory computer-readable medium that, when executed by the at least one processor, cause the computing platform to:
after deploying the given quantized version of the deep-learning AI model, determine a group-specific fairness metric for each individual demographic group of the plurality of demographic groups based on predictions output by the given quantized version of the deep-learning AI model.
12 . The computing platform of claim 11 , further comprising program instructions stored on the at least one non-transitory computer-readable medium that, when executed by the at least one processor, cause the computing platform to:
generate an alert if a given group-specific fairness metric determined for a given demographic group in the plurality of demographic groups violates a predefined threshold.
13 . A non-transitory computer-readable medium, wherein the non-transitory computer-readable medium is provisioned with program instructions that, when executed by at least one processor, cause a computing platform to:
for a deep-learning artificial intelligence (AI) model:
determine a baseline group-specific fairness metric for each individual demographic group of a plurality of demographic groups that quantifies a performance of the deep-learning AI model in predicting outcomes for the individual demographic group;
determine fairness-importance scores for at least a subset of the deep-learning AI model's parameters by, for each respective parameter in the subset:
perturbing the respective parameter;
determining, for each individual demographic group of the plurality of demographic groups, a group-specific fairness-metric differential that quantifies an extent to which perturbing the respective parameter changes the performance of the deep-learning AI model in predicting outcomes for the individual demographic group relative to the baseline group-specific fairness metric for the individual demographic group; and
determining a respective fairness-importance score of the respective parameter based on the group-specific fairness-metric differentials that are determined for the individual demographic groups of the plurality of demographic groups;
carry out an optimization process that produces and evaluates different quantized versions of the deep-learning AI model that each differ from one another with respect to one or both of (i) which group of the deep-learning AI model's parameters have their precision frozen during quantization, wherein the group of the deep-learning AI model's parameters that have their precision frozen during quantization is determined based on the fairness-importance scores that are determined for at least the subset of the deep-learning AI model's parameters, and (ii) which quantization strategy was utilized to reduce a precision of the deep-learning AI model's parameters that did not have their precision frozen during quantization;
based on the optimization process, select a given quantized version of the deep-learning AI model for deployment;
fine-tune the given quantized version of the deep-learning AI model; and
after fine-tuning the given quantized version of the deep-learning AI model, deploy the given quantized version of the deep-learning AI model.
14 . The non-transitory computer-readable medium of claim 13 , wherein the non-transitory computer-readable medium is also provisioned with program instructions that, when executed by the at least one processor, cause the computing platform to:
receive data defining configuration settings that are input via a given client device associated with a user, wherein the configuration settings define strategies for one or more of (i) carrying out the optimization process, or (ii) fine-tuning the given quantized version of the deep-learning AI model.
15 . The non-transitory computer-readable medium of claim 13 , wherein:
the baseline group-specific fairness metric for each individual demographic group of the plurality of demographic groups comprises a true positive prediction rate, false positive prediction rate, or a false negative prediction rate; and
for each respective parameter in the subset of the deep-learning AI model's parameters, determining the respective fairness-importance score of the respective parameter based on the group-specific fairness-metric differentials that are determined for the individual demographic groups of the plurality of demographic groups comprises determining a maximum absolute difference in group-specific fairness-metric differentials between any two of the plurality of demographic groups.
16 . The non-transitory computer-readable medium of claim 13 :
wherein the different quantized versions of the deep-learning AI model that are produced and evaluated comprise a first quantized version of the deep-learning AI model, and a second quantized version of the deep-learning AI model; and
wherein selecting the given quantized version of the deep-learning AI model for deployment comprises:
determining whether the first quantized version of the deep-learning AI model satisfies a set of one or more optimization constraints that is applicable to any quantized version of the deep-learning AI model;
based on the determination that the first quantized version of the deep-learning AI model satisfies the set of one or more optimization constraints, determining an objective value for the first quantized version of the deep-learning AI model;
determining whether the second quantized version of the deep-learning AI model satisfies the set of one or more optimization constraints; and
based on the determination that the second quantized version of the deep-learning AI model satisfies the set of one or more optimization constraints:
determining an objective value for the second quantized version of the deep-learning AI model;
comparing the objective value for the first quantized version of the deep-learning AI model with the objective value for the second quantized version of the deep-learning AI model; and
based on the comparison, retaining one of the first or second quantized version of the deep-learning AI model with a better objective value and discarding the other,
wherein the objective value for each quantized version of the deep-learning AI model is determined based at least on (i) a prediction error of the quantized version of the deep-learning AI model, (ii) a fairness error of the quantized version of the deep-learning AI model, and (iii) a fairness-balancing coefficient applied to the fairness error.
17 . The non-transitory computer-readable medium of claim 16 , wherein selecting the given quantized version of the deep-learning AI model for deployment further comprises:
based on the determination that the second quantized version of the deep-learning AI model does not satisfy the set of one or more optimization constraints, discarding the second quantized version of the deep-learning AI model.
18 . The non-transitory computer-readable medium of claim 13 , wherein fine-tuning the given quantized version of the deep-learning AI model comprises:
applying a Low-Rank Adaptation (LoRA) technique to fine-tune the given quantized version of the deep-learning AI model.
19 . The non-transitory computer-readable medium of claim 13 , wherein the deep-learning AI model is configured to generate predictions related to whether a financial institution should extend a particular type of service to individuals from the plurality of demographic groups, wherein the particular type of service comprises one of a loan, a credit card account, a bank account, or a mortgage service.
20 . A method carried out by a computing platform, the method comprising:
for a deep-learning artificial intelligence (AI) model:
determining a baseline group-specific fairness metric for each individual demographic group of a plurality of demographic groups that quantifies a performance of the deep-learning AI model in predicting outcomes for the individual demographic group;
determining fairness-importance scores for at least a subset of the deep-learning AI model's parameters by, for each respective parameter in the subset:
perturbing the respective parameter;
determining, for each individual demographic group of the plurality of demographic groups, a group-specific fairness-metric differential that quantifies an extent to which perturbing the respective parameter changes the performance of the deep-learning AI model in predicting outcomes for the individual demographic group relative to the baseline group-specific fairness metric for the individual demographic group; and
determining a respective fairness-importance score of the respective parameter based on the group-specific fairness-metric differentials that are determined for the individual demographic groups of the plurality of demographic groups;
carrying out an optimization process that produces and evaluates different quantized versions of the deep-learning AI model that each differ from one another with respect to one or both of (i) which group of the deep-learning AI model's parameters have their precision frozen during quantization, wherein the group of the deep-learning AI model's parameters that have their precision frozen during quantization is determined based on the fairness-importance scores that are determined for at least the subset of the deep-learning AI model's parameters, and (ii) which quantization strategy was utilized to reduce a precision of the deep-learning AI model's parameters that did not have their precision frozen during quantization;
based on the optimization process, selecting a given quantized version of the deep-learning AI model for deployment;
fine-tuning the given quantized version of the deep-learning AI model; and
after fine-tuning the given quantized version of the deep-learning AI model, deploying the given quantized version of the deep-learning AI model.