ZHANGYUXUAN-zR commited on
Commit
6dbd63d
·
verified ·
1 Parent(s): e28aa4a

Add files using upload-large-folder tool

Browse files
parse/dev/1W8UwXAQubL/1W8UwXAQubL.md CHANGED
@@ -78,7 +78,7 @@ where $\mathbf { r } ( \pi ^ { i _ { m } } ) = \pi ^ { i _ { m } } ( \mathbf { a
78
 
79
  # 2.4 The Transformer Model
80
 
81
- Transformer [40] was originally designed for machine translation tasks (e.g., input English, output French). It maintains an encoder-decoder structure, where the encoder maps an input sequence of tokens to latent representations and then the decoder generates a sequence of desired outputs in an auto-regressive manner wherein at each step of inference, the Transformer takes all previously generated tokens as the input. One of the most essential component in Transformer is the scaled dot-product attention, which captures the interrelationship of input sequences. The attention function is written as Attention $\begin{array} { r } { \mathrm { \mathrm { \Omega } } _ { ^ { 1 } } ( \mathbf { Q } , \mathbf { K } , \mathbf { V } ) = \operatorname { s o f t m a x } \big ( \frac { \mathbf { Q } \mathbf { K } ^ { T } } { \sqrt { d _ { k } } } \big ) \mathbf { V } } \end{array}$ V, where the Q, K, V corresponds to the vector of queries, keys and values, which can be learned during training, and the $d _ { k }$ represent the dimension of $\mathbf { Q }$ and $\mathbf { K }$ . Self-attentions refer to cases when $\mathbf { Q } , \mathbf { K } , \mathbf { V }$ share the same set of parameters.
82
 
83
  ![](images/44c48541656c918c52b627f3e9d5d3661d597e84653999bdf5d132f8ba8df7a9.jpg)
84
  Figure 1: Conventional multi-agent learning paradigm (left) wherein all agents take actions simultaneously vs. the multi-agent sequential decision paradigm (right) where agents take actions by following a sequential order, each agent accounts for decisions from preceding agents as red arrows suggest.
@@ -89,7 +89,7 @@ Inspired by the attention mechanism, UPDeT [13] handles various observation size
89
 
90
  To establish the connection between MARL and sequence models, Theorem (1) provides a new angle of understanding the MARL problem from a SM perspective. If each agent knows its predecessors’ actions with an arbitrary decision order, the sum of agents’ local advantages $A _ { \pi } ^ { i _ { j } } \left( o , \pmb { a } ^ { i _ { 1 : m - 1 } } , a ^ { i _ { m } } \right)$ will be exactly equal to the joint advantages $A _ { \pi } ^ { i _ { 1 : n } } ( o , \pmb { a } ^ { i _ { 1 : n } } )$ . This orderly decision setting across agents simplifies the update of their joint policy, where maximizing each agent’s own local advantage is equivalent to maximizing the joint advantage. As such, agents do not need to worry about interference from other agents anymore during the policy update; the local advantage functions have already captured the relationship between agents. This property revealed by Theorem (1) inspires us to propose a multi-agent sequential decision paradigm for MARL problems as show in Figure (1), where we assign agents with an arbitrary decision order (one permutation for each iteration); each agent can access its predecessors’ behaviors, based on which it then takes the optimal decision. This sequential paradigm motivates us to leverage a sequential model, e.g., Transformer, to explicitly capture the sequential relationship between agents described in Theorem (1).
91
 
92
- Underpinned by Theorem (1), sequence modeling reduces the complexity growth of MARL problems with the number of agents from multiplicative to additive, thus rendering linear complexity. With the help of the Transformer architecture, we can model policies of heterogeneous agents with an unified network but treat each agent discriminatively with different position, and thus ensuring high sample efficiency while avoiding the exponentially-worse outcome that MAPPO is facing. Besides, in order to guarantee the monotonic improvement of joint policies, HAPPO has to update each policy one-by-one during training, by leveraging previous update results of $\pi ^ { i _ { 1 } } , . . . , \pi ^ { i _ { m - 1 } }$ to improve $\pi ^ { i _ { m } }$ , which becomes critical in computational efficiency at large size of agents. By contramechanism of Transformer architectures allows for batching the ground truth actions $a _ { t } ^ { i _ { 0 } } , . . . , a _ { t } ^ { i _ { n - 1 } }$ ain1 onin the buffer to predict $a _ { t } ^ { i _ { 1 } } , . . . , a _ { t } ^ { i _ { n } }$ and update policies simultaneously, which significantly improves the training speed and makes it feasible for large size of agents. Furthermore, in cases that the number and the type of agents are different, SM can incorporates them into an unified solution through its capability on modeling sequences with flexible sequence length, rather than treat different agent numbers as different tasks. To realize the above idea, we introduce a practical architecture named Multi-Agent Transformer in the next section.
93
 
94
  ![](images/7d48b9cbf47618a759b37dc1e10c48b8ef89fed8192a3d059497153e41e166e1.jpg)
95
  Figure 2: The encoder-decoder architecture of MAT. At each time step, the encoder takes in a sequence of agents’ observations and encodes them into a sequence of latent representations, which is then passed into the decoder. The decoder generate each agent’s optimal action in a sequential and auto-regressive manner. The masked attention blocks ensures agents can only access its preceding agents’ actions during training. We list the full pseudocode of MAT in Appendix A and a video that shows the dynamic data flow of MAT in https://sites.google.com/view/multi-agent-transformer.
 
78
 
79
  # 2.4 The Transformer Model
80
 
81
+ Transformer [40] was originally designed for machine translation tasks (e.g., input English, output French). It maintains an encoder-decoder structure, where the encoder maps an input sequence of tokens to latent representations and then the decoder generates a sequence of desired outputs in an auto-regressive manner wherein at each step of inference, the Transformer takes all previously generated tokens as the input. One of the most essential component in Transformer is the scaled dot-product attention, which captures the interrelationship of input sequences. The attention function is written as Attention $\begin{array} { r } { \mathrm { \mathrm { \Omega } } _ { ^ { 1 } } ( \mathbf { Q } , \mathbf { K } , \mathbf { V } ) = \operatorname { s o f t m a x } \big ( \frac { \mathbf { Q } \mathbf { K } ^ { T } } { \sqrt { d _ { k } } } \big ) \mathbf { V } } \end{array}$ V, where the Q, K, V corresponds to the vector of queries, keys and values, which can be learned during training, and the $d _ { k }$ represent the dimension of $\mathbf { Q }$ and $\mathbf { K }$ . Self-attentions refer to cases when $\mathbf { Q } , \mathbf { K } , \mathbf { V }$ share the same set of parameters.
82
 
83
  ![](images/44c48541656c918c52b627f3e9d5d3661d597e84653999bdf5d132f8ba8df7a9.jpg)
84
  Figure 1: Conventional multi-agent learning paradigm (left) wherein all agents take actions simultaneously vs. the multi-agent sequential decision paradigm (right) where agents take actions by following a sequential order, each agent accounts for decisions from preceding agents as red arrows suggest.
 
89
 
90
  To establish the connection between MARL and sequence models, Theorem (1) provides a new angle of understanding the MARL problem from a SM perspective. If each agent knows its predecessors’ actions with an arbitrary decision order, the sum of agents’ local advantages $A _ { \pi } ^ { i _ { j } } \left( o , \pmb { a } ^ { i _ { 1 : m - 1 } } , a ^ { i _ { m } } \right)$ will be exactly equal to the joint advantages $A _ { \pi } ^ { i _ { 1 : n } } ( o , \pmb { a } ^ { i _ { 1 : n } } )$ . This orderly decision setting across agents simplifies the update of their joint policy, where maximizing each agent’s own local advantage is equivalent to maximizing the joint advantage. As such, agents do not need to worry about interference from other agents anymore during the policy update; the local advantage functions have already captured the relationship between agents. This property revealed by Theorem (1) inspires us to propose a multi-agent sequential decision paradigm for MARL problems as show in Figure (1), where we assign agents with an arbitrary decision order (one permutation for each iteration); each agent can access its predecessors’ behaviors, based on which it then takes the optimal decision. This sequential paradigm motivates us to leverage a sequential model, e.g., Transformer, to explicitly capture the sequential relationship between agents described in Theorem (1).
91
 
92
+ Underpinned by Theorem (1), sequence modeling reduces the complexity growth of MARL problems with the number of agents from multiplicative to additive, thus rendering linear complexity. With the help of the Transformer architecture, we can model policies of heterogeneous agents with an unified network but treat each agent discriminatively with different position, and thus ensuring high sample efficiency while avoiding the exponentially-worse outcome that MAPPO is facing. Besides, in order to guarantee the monotonic improvement of joint policies, HAPPO has to update each policy one-by-one during training, by leveraging previous update results of $\pi ^ { i _ { 1 } } , . . . , \pi ^ { i _ { m - 1 } }$ to improve $\pi ^ { i _ { m } }$ , which becomes critical in computational efficiency at large size of agents. By contramechanism of Transformer architectures allows for batching the ground truth actions $a _ { t } ^ { i _ { 0 } } , . . . , a _ { t } ^ { i _ { n - 1 } }$ ain1 onin the buffer to predict $a _ { t } ^ { i _ { 1 } } , . . . , a _ { t } ^ { i _ { n } }$ and update policies simultaneously, which significantly improves the training speed and makes it feasible for large size of agents. Furthermore, in cases that the number and the type of agents are different, SM can incorporates them into an unified solution through its capability on modeling sequences with flexible sequence length, rather than treat different agent numbers as different tasks. To realize the above idea, we introduce a practical architecture named Multi-Agent Transformer in the next section.
93
 
94
  ![](images/7d48b9cbf47618a759b37dc1e10c48b8ef89fed8192a3d059497153e41e166e1.jpg)
95
  Figure 2: The encoder-decoder architecture of MAT. At each time step, the encoder takes in a sequence of agents’ observations and encodes them into a sequence of latent representations, which is then passed into the decoder. The decoder generate each agent’s optimal action in a sequential and auto-regressive manner. The masked attention blocks ensures agents can only access its preceding agents’ actions during training. We list the full pseudocode of MAT in Appendix A and a video that shows the dynamic data flow of MAT in https://sites.google.com/view/multi-agent-transformer.