Answers.Body: <p>There a couple of &quot;rules of thumb&quot; you might apply to decide whether a Q table is large enough that some kind of approximation would help:</p>
  <ul>
  <li><p>Does it fit into memory?</p>
  </li>
  <li><p>Does the rate of gathering experience mean that the agent can reasonably sample enough from each relevant state/action pair to assess policies?</p>
  </li>
  </ul>
  <p>For a state/action space of 2500, it should trivially fit into memory on any modern device, even if you need to use some kind of string description of the states and actions, using them as keys to a dictionary lookup of value. Even if you are short of space in some embedded device, the space required by code for approximation is probably larger than the table.</p>
  <p>In my experience I would rate the state/action space of 2500 as very small. If you can simulate the environment on a computer, then you could reasonably expect to find the optimal policy in under a second. For fast simulations, or with full models using value iteration, Q tables with millions of values to calculate may be feasible.</p>
  <p>However, you have not stated what it takes to sample a time step (measuring start state, action, reward, next state) in your environment, or how long you have to run the training process. This could still make a difference in how you want to represent the action value function.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-20T07:13:48.233Z
Answers.LastActivityDate: 2022-06-20T07:13:48.233Z
Answers.UserDisplayName: Neil Slater
Body: <p>I never saw any rule of thumb as to what size is said as large for a q-table but <strong>I have a Q-table with like 2500 entries. Is it considered large for a tabular approach?</strong> Anyone from experience can answer maybe. I assume I can visit all state-action pairs enough times but is it efficient in terms of space complexity/memory? Or is a deep neural network required?</p>
  <p><em>I asked <a href="https://ai.stackexchange.com/q/35986/2444">a related connected question</a>, in case anyone wants to answer this current question better w.r.t that question context.</em></p>
  
Tags: <reinforcement-learning><deep-learning><q-learning><hyper-parameters><state-spaces>
Title: Is the described Q-table considered large?
UserDisplayName: knowledge_seeker
ThreadText: # Is the described Q-table considered large?
  
  (Asked by: username_0 on 2022-06-20)
  
  I never saw any rule of thumb as to what size is said as large for a q-table but **I have a Q-table with like 2500 entries. Is it considered large for a tabular approach?** Anyone from experience can answer maybe. I assume I can visit all state-action pairs enough times but is it efficient in terms of space complexity/memory? Or is a deep neural network required?
  
  *I asked [a related connected question](https://ai.stackexchange.com/q/35986/2444), in case anyone wants to answer this current question better w.r.t that question context.*
  
  **Tags:** reinforcement-learning, deep-learning, q-learning, hyper-parameters, state-spaces
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-06-20. Score: 2
  
  There a couple of "rules of thumb" you might apply to decide whether a Q table is large enough that some kind of approximation would help:
  
  * Does it fit into memory?
  * Does the rate of gathering experience mean that the agent can reasonably sample enough from each relevant state/action pair to assess policies?
  
  For a state/action space of 2500, it should trivially fit into memory on any modern device, even if you need to use some kind of string description of the states and actions, using them as keys to a dictionary lookup of value. Even if you are short of space in some embedded device, the space required by code for approximation is probably larger than the table.
  
  In my experience I would rate the state/action space of 2500 as very small. If you can simulate the environment on a computer, then you could reasonably expect to find the optimal policy in under a second. For fast simulations, or with full models using value iteration, Q tables with millions of values to calculate may be feasible.
  
  However, you have not stated what it takes to sample a time step (measuring start state, action, reward, next state) in your environment, or how long you have to run the training process. This could still make a difference in how you want to represent the action value function.
  
  
  ---
  
  