A method, performed by an electronic apparatus (1000-2), of refining a first local artificial intelligence, Al, model stored in a memory of the electronic apparatus (1000-2), the method comprising: detecting, by at least one processor of the electronic apparatus (1000-2), a change of information about a context of the electronic apparatus (1000-2) determined as a relay apparatus among electronic apparatuses (1000-2, 1000-3, 1000-4) classified as a group (1000-1), wherein the information about the context being a basis for refining the first local AI model stored in the electronic apparatus (1000-2) comprises personal information of a user of the electronic apparatus (1000-2); determining, by the at least one processor, a first local gradient for refining the first local AI model based on the change of the information about the context; refining, by the at least one processor, the first local AI model based on the first local gradient; receiving, by a communicator of the electronic apparatus (1000-2), a second local gradient from one of the other electronic apparatuses (1000-3, 1000-4) included in the group (1000-1), used to refine a second local AI model stored on the one of the other electronic apparatuses (1000-3, 1000-4) included in the group (1000-1); refining, by the at least one processor, the first local AI model based on the second local gradient; transmitting, by the communicator, at least one of the first local gradient and the second local gradient to a server having a global AI model; receiving, by the communicator from the server , a global gradient of the global Al model refined based on at least one of the first local gradient and the second local gradient; and further refining, by the at least one processor, the refined first local AI model based on the received global gradient about the refined global AI model, wherein the first local AI model, the second local AI model, the global AI model and the refined first local AI model are neural network models. detecting, by at least one processor of the electronic apparatus (1000-2), a change of information about a context of the electronic apparatus (1000-2) determined as a relay apparatus among electronic apparatuses (1000-2, 1000-3, 1000-4) classified as a group (1000-1), wherein the information about the context being a basis for refining the first local AI model stored in the electronic apparatus (1000-2) comprises personal information of a user of the electronic apparatus (1000-2); determining, by the at least one processor, a first local gradient for refining the first local AI model based on the change of the information about the context; refining, by the at least one processor, the first local AI model based on the first local gradient; receiving, by a communicator of the electronic apparatus (1000-2), a second local gradient from one of the other electronic apparatuses (1000-3, 1000-4) included in the group (1000-1), used to refine a second local AI model stored on the one of the other electronic apparatuses (1000-3, 1000-4) included in the group (1000-1); refining, by the at least one processor, the first local AI model based on the second local gradient; transmitting, by the communicator, at least one of the first local gradient and the second local gradient to a server having a global AI model; receiving, by the communicator from the server , a global gradient of the global Al model refined based on at least one of the first local gradient and the second local gradient; and further refining, by the at least one processor, the refined first local AI model based on the received global gradient about the refined global AI model, wherein the first local AI model, the second local AI model, the global AI model and the refined first local AI model are neural network models. <EOS>