Method and system for assessing the trustworthiness of an artificial intelligence model
A method and a system for assessing trustworthiness of an artificial intelligence (AI) model are provided. The method includes: accessing an explainable artificial intelligence (XAI) asset that relates to the AI model; accessing a document that relates to the AI model; separating the XAI asset into XAI asset chunks; separating the document into document chunks; generating, via a pre-trained model, a plurality of chunk embeddings that includes respective embeddings for the XAI asset chunks and the document chunks; accessing a query that relates to the trustworthiness of the AI model; generating, via the pre-trained model, a query embedding for the query; calculating an embedding similarity score for each chunk embedding; selecting a chunk embedding having the highest embedding similarity score; generating a context embedding by aggregating the query embedding with the selected chunk embedding; and generating a response to the query based on the context embedding.
1 . A method for assessing trustworthiness of an artificial intelligence (AI) model, the method being implemented by at least one processor, the method comprising:
accessing, by the at least one processor, at least one explainable artificial intelligence (XAI) asset that relates to the AI model;
accessing, by the at least one processor, a document that relates to the AI model;
separating, by the at least one processor, the at least one XAI asset into at least one XAI asset chunk;
separating, by the at least one processor, the document into at least one document chunk, wherein the separating of the document is based on a predetermined word count;
generating, by the at least one processor via a pre-trained model, a plurality of chunk embeddings that includes a respective embedding for each respective XAI asset chunk of the at least one XAI asset chunk and each respective document chunk of the at least one document chunk;
accessing, by the at least one processor, a query that relates to the trustworthiness of the AI model;
generating, by the at least one processor via the pre-trained model, a query embedding for the query;
calculating, by the at least one processor, a respective embedding similarity score for each respective chunk embedding of the plurality of chunk embeddings, wherein each respective similarity score is computed by applying a predetermined algorithm to each of the corresponding respective chunk embedding and the query embedding;
selecting, by the at least one processor, a respective chunk embedding from the plurality of chunk embeddings having a highest corresponding embedding similarity score;
generating, by the at least one processor, a context embedding by aggregating the query embedding with the selected chunk embedding; and
generating, by the at least one processor via a large language model (LLM), a response to the query based on the context embedding.
2 . The method of claim 1 , wherein the response includes an answer to the query and a rationale relating to how the answer was generated.
3 . The method of claim 1 , wherein the trustworthiness relates to at least one from among an explainability of the model and a potential risk associated with the model.
4 . The method of claim 1 , further comprising:
assigning, by the at least one processor, a respective weight to each respective chunk embedding of the plurality of chunk embeddings, wherein each respective weight is used for the calculating of each corresponding respective embedding similarity score, and wherein each respective weight falls within a range from 0.0 to 1.0.
5 . The method of claim 4 , wherein each respective chunk embedding corresponding to a respective XAI asset chunk is assigned a corresponding respective weight that is greater than a corresponding respective weight assigned to each respective chunk embedding corresponding to a respective document chunk.
6 . The method of claim 1 , wherein the separating of the at least one XAI asset is based on spatial orientation of information contained within the at least one XAI asset.
7 . The method of claim 1 , wherein each respective embedding similarity score represents a degree to which a context of the corresponding respective chunk embedding matches a context of the query embedding.
8 . The method of claim 1 , wherein the accessing of the query comprises generating, by the at least one processor, the query, wherein the query relates to an explainability of the AI model.
9 . The method of claim 8 , wherein the generated query relates to a regulatory requirement associated with the AI model.
10 . A computing device configured for assessing trustworthiness of an artificial intelligence (AI) model, the computing device comprising:
a processor;
a memory; and
a communication interface coupled to each of the processor and the memory, wherein the processor is configured to:
access at least one explainable artificial intelligence (XAI) asset that relates to the AI model;
access a document that relates to the AI model;
separate the at least one XAI asset into at least one XAI asset chunk;
separate the document into at least one document chunk, wherein the separating of the document is based on a predetermined word count;
generate, via a pre-trained model, a plurality of chunk embeddings that includes a respective embedding for each respective XAI asset chunk of the at least one XAI asset chunk and each respective document chunk of the at least one document chunk;
access a query that relates to the trustworthiness of the AI model;
generate, via the pre-trained model, a query embedding for the query;
calculate a respective embedding similarity score for each respective chunk embedding of the plurality of chunk embeddings, wherein each respective similarity score is computed by applying a predetermined algorithm to each of the corresponding respective chunk embedding and the query embedding;
select a respective chunk embedding from the plurality of chunk embeddings having a highest corresponding embedding similarity score;
generate a context embedding by aggregating the query embedding with the selected chunk embedding; and
generate, via a large language model (LLM), a response to the query based on the context embedding.
11 . The computing device of claim 10 , wherein the response includes an answer to the query and a rationale relating to how the answer was generated.
12 . The computing device of claim 10 , wherein the trustworthiness relates to at least one from among an explainability of the model and a potential risk associated with the model.
13 . The computing device of claim 10 , wherein the processor is further configured to assign a respective weight to each respective chunk embedding of the plurality of chunk embeddings, wherein each respective weight is used for the calculating of each corresponding respective embedding similarity score, and wherein each respective weight falls within a range from 0.0 to 1.0.
14 . The computing device of claim 13 , wherein each respective chunk embedding corresponding to a respective XAI asset chunk is assigned a corresponding respective weight that is greater than a corresponding respective weight assigned to each respective chunk embedding corresponding to a respective document chunk.
15 . The computing device of claim 10 , wherein the separating of the at least one XAI asset is based on spatial orientation of information contained within the at least one XAI asset.
16 . The computing device of claim 10 , wherein each respective embedding similarity score represents a degree to which a context of the corresponding respective chunk embedding matches a context of the query embedding.
17 . The computing device of claim 10 , wherein the accessing of the query comprises generating the query, wherein the query relates to an explainability of the AI model.
18 . The computing device of claim 17 , wherein the generated query relates to a regulatory requirement associated with the AI model.
19 . A non-transitory computer readable storage medium storing instructions for assessing trustworthiness of an artificial intelligence (AI) model, the storage medium comprising executable code which, when executed by a processor, causes the processor to:
access at least one explainable artificial intelligence (XAI) asset that relates to the AI model;
access a document that relates to the AI model;
separate the at least one XAI asset into at least one XAI asset chunk;
separate the document into at least one document chunk, wherein the separating of the document is based on a predetermined word count;
generate, via a pre-trained model, a plurality of chunk embeddings that includes a respective embedding for each respective XAI asset chunk of the at least one XAI asset chunk and each respective document chunk of the at least one document chunk;
access a query that relates to the trustworthiness of the AI model;
generate, via the pre-trained model, a query embedding for the query;
calculate a respective embedding similarity score for each respective chunk embedding of the plurality of chunk embeddings, wherein each respective similarity score is computed by applying a predetermined algorithm to each of the corresponding respective chunk embedding and the query embedding;
select a respective chunk embedding from the plurality of chunk embeddings having a highest corresponding embedding similarity score;
generate a context embedding by aggregating the query embedding with the selected chunk embedding; and
generate, via a large language model (LLM), a response to the query based on the context embedding.
20 . The storage medium of claim 19 , wherein the response includes an answer to the query and a rationale relating to how the answer was generated.