Answers.Body: <p>The paper in question is called <em>Dynamic Sample Selection for Federated Learning with Heterogeneous Data in Fog Computing</em>, by L. Cai, D. Lin, J. Zhang, and S. Yu. As the title suggests, the paper focuses on a machine learning methodology called <em>federated learning</em>.</p>
  <blockquote>
  <p><a href="https://i.sstatic.net/bGZKX.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/bGZKX.png" alt="enter image description here" /></a></p>
  </blockquote>
  <p>Downloading the paper in question and doing a search for all occurrences of the word 'accuracy', I get 6 results. Going through these 6 results, I don't see anything that details the methodology used to assess 'accuracy'; the authors seem to assume that the author already knows how 'accuracy' is being measured. However, it seems to me that this in itself might tell us something: if the paper is exploring the federated learning methodology, and if the authors do not detail the methodology used to assess 'accuracy', and instead write as if the reader is assumed to know how 'accuracy' is being measured, then it is likely that the methodology used to assess 'accuracy' is that which is typically used in federated learning, including the earlier and more fundamental papers on federated learning, which the authors are likely (and reasonably) assuming that readers of their paper are already familiar with and have already studied. Furthermore, it seems to me that, if we want to maximise the probability that the ('other' federated learning) paper is using the same methodology for 'accuracy' as the authors (of <em>this</em> paper), then, rather than searching through papers that the authors <em>haven't</em> referenced, we should search one of the papers that they <em>have</em>.</p>
  <p>Given what I said above, of the 6 occurrences of the word 'accuracy' in the paper, the second one, in section <em>I. Introduction</em>, seems to me to be the most promising:</p>
  <blockquote>
  <p>With the growing use of internet devices, federated learning becomes increasingly popular in machine learning, which is typically to train models using decentralized data residing on end devices. The learning task does not use the data required for the aggregation model training to perform centralized calculations, but rather distributes the computation of machine learning to the distributed computing of participation parties’ databases. It can solve the “data island” problem in the loT, and can ensure the data privacy of devices. Federated learning is a viable and emerging framework which pushes AI frontiers to the network edge and trains machine learning models for fog computing [17]. It provides several benefits for the edge big data processing, including energy efficiency, privacy protection, and communication cost. However, the data is distributed across millions of devices in a highly uneven manner <a href="https://i.sstatic.net/TidMH.png" rel="nofollow noreferrer">2</a>, <a href="https://stackoverflow.com/q/37668902/6828329">3</a>–<a href="https://stackoverflow.com/a/37670482/6828329">4</a>, [9]. In addition, these devices have higher latency, lower throughput connections, and can only be used intermittently for training. McMahan et al. <a href="https://i.sstatic.net/TidMH.png" rel="nofollow noreferrer">2</a> proposed a Federated Averaging Algorithm based on the optimization of synchronized stochastic gradient descent (SGD), which averaged the gradients updates by all users (or random parts) as the update parameters of the central model. It can effectively reduce communication rounds compared with SGD. Moreover, some performance optimization methods like structured updates and sketched updates aimed to improve communication efficiency and test <strong>accuracy</strong> in federated learning <strong>[9]</strong>.</p>
  </blockquote>
  <p>(Emphasis mine.)</p>
  <p>Reference 9 is for the paper <a href="https://arxiv.org/abs/1610.05492" rel="nofollow noreferrer"><em>Federated Learning: Strategies for Improving Communication Efficiency</em> by J. Konečný, H. B. McMahan, F. X. Yu, P. Richtárik, A. T. Suresh, and D. Bacon</a>. Downloading the paper in question and doing a search for all occurrences of the word 'accuracy', I get 13 results. Going through these 13 results, the only one that seems relevant is from section <em>4. Experiments</em>, under <em>4.2 LSTM Next-Word Prediction on Reddit Data</em>:</p>
  <blockquote>
  <p>We constructed the dataset for simulating Federated Learning based on the data containing publicly available posts/comments on Reddit (Google BigQuery), as described by Al-Rfou et al. (2016). Critically for our purposes, each post in the database is keyed by an author, so we can group the data by these keys, making the assumption of one client device per author. Some authors have a very large number of posts, but in each round of FedAvg we process at most 32 000 tokens per user. We omit authors with fewer than 1600 tokens, since there is constant overhead per client in the simulation, and users with little data don’t contribute much to training. This leaves a dataset of 763 430 users, with an average of 24 791 tokens per user. For evaluation, we use a relatively small test set of 75 122 tokens formed from random held-out posts.</p>
  <p><a href="https://i.sstatic.net/guiUO.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/guiUO.png" alt="enter image description here" /></a></p>
  <p>Based on this data, we train a LSTM next word prediction model. The model is trained to predict the next word given the current word and a state vector passed from the previous time step. The model works as follows: word <span class="math-container">$s_t$</span> is mapped to an embedding vector <span class="math-container">$e_t \in \mathbb{R}^{96}$</span>, by looking up the word in a dictionary of 10 017 words (tokens). <span class="math-container">$e_t$</span> is then composed with the state emitted by the model in the previous time step <span class="math-container">$s_{t1} \in \mathbb{R}^{256}$</span> to emit a new state vector <span class="math-container">$s_t$</span> and an “output embedding” <span class="math-container">$o_t \in \mathbf{R}^{96}$</span>. The output embedding is scored against the embedding of each item in the vocabulary via inner product, before being normalized via softmax to compute a probability distribution over the vocabulary. Like other standard language models, we treat every input sequence as beginning with an implicit “BOS” (beginning of sequence) token and ending with an implicit “EOS” (end of sequence) token. Unlike standard LSTM language models, our model uses the same learned embedding for both the embedding and softmax layers. This reduces the size of the model by about 40% for a small decrease in model quality, an advantageous tradeoff for mobile applications. Another change from many standard LSTM RNN approaches is that we train these models to restrict the word embeddings to have a fixed L2 norm of 1.0, a modification found to improve convergence time. In total the model has 1.35M parameters.</p>
  <p>In order to reduce the size of the update, we sketch all the model variables except some small variables (such as biases) which consume less than 0.01% of memory. We evaluate using <code>AccuracyTop1</code>, the probability that the word to which the model assigns highest probability is correct. We always count it as a mistake if the true next word is not in the dictionary, even if the model predicts ‘unknown’.</p>
  <p><a href="https://i.sstatic.net/MJ9et.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/MJ9et.png" alt="enter image description here" /></a></p>
  <p>In Figure 4, we run the Federated Averaging algorithm on Reddit data, with various parameters that specify the sketching. In every iteration, we randomly sample 50 users that compute update based on the data available locally, sketch it, and all the updates are averaged. Experiments with sampling 10, 20, and 100 clients in each round provided similar conclusions as the following.</p>
  </blockquote>
  <p>And later in the paper we have the following:</p>
  <blockquote>
  <p><a href="https://i.sstatic.net/B0yzE.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/B0yzE.png" alt="enter image description here" /></a></p>
  </blockquote>
  <p>Note the following:</p>
  <blockquote>
  <p>We evaluate using <code>AccuracyTop1</code>, the probability that the word to which the model assigns highest probability is correct.</p>
  </blockquote>
  <p>So it seems that <code>AccuracyTop1</code>, whatever that is, is how 'accuracy' is being calculated. Googling &quot;AccuracyTop1&quot;, we get <a href="https://stackoverflow.com/q/37668902/6828329">this</a> Stackoverflow question, and <a href="https://stackoverflow.com/a/37670482/6828329">this</a> answer to the question seems to explain how it works.</p>
  <hr />
  <p><strong>Disclaimer:</strong> This is all beyond my current knowledge and understanding, and I came to these conclusions purely through critical thinking and investigative research. It's totally possible that everything in my answer is nonsense, so feel free to correct me (or use my answer to find the correct answer).</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-06-14T07:09:38.683Z
Answers.LastActivityDate: 2021-06-19T12:29:29.717Z
Answers.LastEditDate: 2021-06-19T12:29:29.717Z
Answers.UserDisplayName: The Pointer
Body: <p>What is the difference between the definition of &quot;accuracy&quot; in machine learning and federated learning?</p>
  <p>In particular, how is the accuracy calculated in the following paper:</p>
  <blockquote>
  <p>Cai, Lingshuang, et al. &quot;Dynamic Sample Selection for Federated Learning with Heterogeneous Data in Fog Computing.&quot; ICC 2020-2020 IEEE International Conference on Communications (ICC). IEEE, 2020.</p>
  </blockquote>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-06-14T01:15:57.610Z
Comments.Text: Could you please at least quote the parts of the paper that define the "accuracy" in federated learning or simply in that paper/context? If you're asking this question, it's because you think that accuracy in FL is defined differently than in ML, so it would be a good idea to explain why that is the case.
Comments.UserDisplayName: nbro
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-06-14T07:20:02.650Z
Comments.Text: There isn't much to go on here. I did my best and posted an answer, but, as I stated in the disclaimer at the end, it's totally possible that it's wrong.
Comments.UserDisplayName: The Pointer
Tags: <machine-learning><terminology><papers><accuracy><federated-learning>
Title: What is the difference between the definition of "accuracy" in machine learning and federated learning?
UserDisplayName: Jared
ThreadText: # What is the difference between the definition of "accuracy" in machine learning and federated learning?
  
  (Asked by: username_0 on 2021-06-11)
  
  What is the difference between the definition of "accuracy" in machine learning and federated learning?
  
  In particular, how is the accuracy calculated in the following paper:
  
  > Cai, Lingshuang, et al. "Dynamic Sample Selection for Federated Learning with Heterogeneous Data in Fog Computing." ICC 2020-2020 IEEE International Conference on Communications (ICC). IEEE, 2020.
  
  **Tags:** machine-learning, terminology, papers, accuracy, federated-learning
  
  > **Comments:**
  > **username_1**: Could you please at least quote the parts of the paper that define the "accuracy" in federated learning or simply in that paper/context? If you're asking this question, it's because you think that accuracy in FL is defined differently than in ML, so it would be a good idea to explain why that is the case.  
  > **username_2**: There isn't much to go on here. I did my best and posted an answer, but, as I stated in the disclaimer at the end, it's totally possible that it's wrong.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2021-06-14. Score: 0 | Accepted answer
  
  The paper in question is called *Dynamic Sample Selection for Federated Learning with Heterogeneous Data in Fog Computing*, by L. Cai, D. Lin, J. Zhang, and S. Yu. As the title suggests, the paper focuses on a machine learning methodology called *federated learning*.
  
  > [![enter image description here](https://i.sstatic.net/bGZKX.png)](https://i.sstatic.net/bGZKX.png)
  
  Downloading the paper in question and doing a search for all occurrences of the word 'accuracy', I get 6 results. Going through these 6 results, I don't see anything that details the methodology used to assess 'accuracy'; the authors seem to assume that the author already knows how 'accuracy' is being measured. However, it seems to me that this in itself might tell us something: if the paper is exploring the federated learning methodology, and if the authors do not detail the methodology used to assess 'accuracy', and instead write as if the reader is assumed to know how 'accuracy' is being measured, then it is likely that the methodology used to assess 'accuracy' is that which is typically used in federated learning, including the earlier and more fundamental papers on federated learning, which the authors are likely (and reasonably) assuming that readers of their paper are already familiar with and have already studied. Furthermore, it seems to me that, if we want to maximise the probability that the ('other' federated learning) paper is using the same methodology for 'accuracy' as the authors (of *this* paper), then, rather than searching through papers that the authors *haven't* referenced, we should search one of the papers that they *have*.
  
  Given what I said above, of the 6 occurrences of the word 'accuracy' in the paper, the second one, in section *I. Introduction*, seems to me to be the most promising:
  
  > With the growing use of internet devices, federated learning becomes increasingly popular in machine learning, which is typically to train models using decentralized data residing on end devices. The learning task does not use the data required for the aggregation model training to perform centralized calculations, but rather distributes the computation of machine learning to the distributed computing of participation parties’ databases. It can solve the “data island” problem in the loT, and can ensure the data privacy of devices. Federated learning is a viable and emerging framework which pushes AI frontiers to the network edge and trains machine learning models for fog computing [17]. It provides several benefits for the edge big data processing, including energy efficiency, privacy protection, and communication cost. However, the data is distributed across millions of devices in a highly uneven manner [2](https://i.sstatic.net/TidMH.png), [3](https://stackoverflow.com/q/37668902/6828329)–[4](https://stackoverflow.com/a/37670482/6828329), [9]. In addition, these devices have higher latency, lower throughput connections, and can only be used intermittently for training. McMahan et al. [2](https://i.sstatic.net/TidMH.png) proposed a Federated Averaging Algorithm based on the optimization of synchronized stochastic gradient descent (SGD), which averaged the gradients updates by all users (or random parts) as the update parameters of the central model. It can effectively reduce communication rounds compared with SGD. Moreover, some performance optimization methods like structured updates and sketched updates aimed to improve communication efficiency and test **accuracy** in federated learning **[9]**.
  
  (Emphasis mine.)
  
  Reference 9 is for the paper [*Federated Learning: Strategies for Improving Communication Efficiency* by J. Konečný, H. B. McMahan, F. X. Yu, P. Richtárik, A. T. Suresh, and D. Bacon](https://arxiv.org/abs/1610.05492). Downloading the paper in question and doing a search for all occurrences of the word 'accuracy', I get 13 results. Going through these 13 results, the only one that seems relevant is from section *4. Experiments*, under *4.2 LSTM Next-Word Prediction on Reddit Data*:
  
  > We constructed the dataset for simulating Federated Learning based on the data containing publicly available posts/comments on Reddit (Google BigQuery), as described by Al-Rfou et al. (2016). Critically for our purposes, each post in the database is keyed by an author, so we can group the data by these keys, making the assumption of one client device per author. Some authors have a very large number of posts, but in each round of FedAvg we process at most 32 000 tokens per user. We omit authors with fewer than 1600 tokens, since there is constant overhead per client in the simulation, and users with little data don’t contribute much to training. This leaves a dataset of 763 430 users, with an average of 24 791 tokens per user. For evaluation, we use a relatively small test set of 75 122 tokens formed from random held-out posts.
  >
  > [![enter image description here](https://i.sstatic.net/guiUO.png)](https://i.sstatic.net/guiUO.png)
  >
  > Based on this data, we train a LSTM next word prediction model. The model is trained to predict the next word given the current word and a state vector passed from the previous time step. The model works as follows: word $s\_t$ is mapped to an embedding vector $e\_t \in \mathbb{R}^{96}$, by looking up the word in a dictionary of 10 017 words (tokens). $e\_t$ is then composed with the state emitted by the model in the previous time step $s\_{t1} \in \mathbb{R}^{256}$ to emit a new state vector $s\_t$ and an “output embedding” $o\_t \in \mathbf{R}^{96}$. The output embedding is scored against the embedding of each item in the vocabulary via inner product, before being normalized via softmax to compute a probability distribution over the vocabulary. Like other standard language models, we treat every input sequence as beginning with an implicit “BOS” (beginning of sequence) token and ending with an implicit “EOS” (end of sequence) token. Unlike standard LSTM language models, our model uses the same learned embedding for both the embedding and softmax layers. This reduces the size of the model by about 40% for a small decrease in model quality, an advantageous tradeoff for mobile applications. Another change from many standard LSTM RNN approaches is that we train these models to restrict the word embeddings to have a fixed L2 norm of 1.0, a modification found to improve convergence time. In total the model has 1.35M parameters.
  >
  > In order to reduce the size of the update, we sketch all the model variables except some small variables (such as biases) which consume less than 0.01% of memory. We evaluate using `AccuracyTop1`, the probability that the word to which the model assigns highest probability is correct. We always count it as a mistake if the true next word is not in the dictionary, even if the model predicts ‘unknown’.
  >
  > [![enter image description here](https://i.sstatic.net/MJ9et.png)](https://i.sstatic.net/MJ9et.png)
  >
  > In Figure 4, we run the Federated Averaging algorithm on Reddit data, with various parameters that specify the sketching. In every iteration, we randomly sample 50 users that compute update based on the data available locally, sketch it, and all the updates are averaged. Experiments with sampling 10, 20, and 100 clients in each round provided similar conclusions as the following.
  
  And later in the paper we have the following:
  
  > [![enter image description here](https://i.sstatic.net/B0yzE.png)](https://i.sstatic.net/B0yzE.png)
  
  Note the following:
  
  > We evaluate using `AccuracyTop1`, the probability that the word to which the model assigns highest probability is correct.
  
  So it seems that `AccuracyTop1`, whatever that is, is how 'accuracy' is being calculated. Googling "AccuracyTop1", we get [this](https://stackoverflow.com/q/37668902/6828329) Stackoverflow question, and [this](https://stackoverflow.com/a/37670482/6828329) answer to the question seems to explain how it works.
  
  ---
  
  **Disclaimer:** This is all beyond my current knowledge and understanding, and I came to these conclusions purely through critical thinking and investigative research. It's totally possible that everything in my answer is nonsense, so feel free to correct me (or use my answer to find the correct answer).
  
  
  ---
  
  