# Multi agent partial parameter sharing

**URL:** <https://discuss.ray.io/t/multi-agent-partial-parameter-sharing/11449>\
**Category:** RLlib\
**Created:** [July 17, 2023, 3:09pm UTC](https://discuss.ray.io/t/multi-agent-partial-parameter-sharing/11449 "2023-07-17T15:09:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fady\_Ben](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/fady_ben/32/4769_2.png) [@Fady\_Ben](https://discuss.ray.io/u/Fady_Ben)\
**Post date:** [July 17, 2023, 3:09pm UTC](https://discuss.ray.io/t/multi-agent-partial-parameter-sharing/11449/1 "2023-07-17T15:09:39Z")

</div>

**How severe does this issue affect your experience of using Ray?**

- Medium: It contributes to significant difficulty to complete my task, but I can work around it.

I know it’s possible to implement parameter sharing with multi-agent by making the policy\_mapping\_fn map all agents to the same policy id. However, what if I want all my policies to share the network except say the last layer, how could this be done with RLlib (using TF)?

---

<div class="post-metadata">

**Author:** ![kourosh](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/kourosh/32/2130_2.png) [@kourosh](https://discuss.ray.io/u/kourosh)\
**Post date:** [July 17, 2023, 3:39pm UTC](https://discuss.ray.io/t/multi-agent-partial-parameter-sharing/11449/2 "2023-07-17T15:39:53Z")

</div>

Hey @Fady_Ben ,

This is one of the major reasons we have created a new stack for RLlib for model composition and training that we have just released in alpha mode. This is exactly one of the advanced use-cases of that API. Have you checked it out?

[https://docs.ray.io/en/latest/rllib/rllib-rlmodule.html#writing-custom-multi-agent-rl-modules-advanced](https://docs.ray.io/en/latest/rllib/rllib-rlmodule.html#writing-custom-multi-agent-rl-modules-advanced)

---

<div class="post-metadata">

**Author:** ![Fady\_B](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/fady_b/32/4949_2.png) [@Fady\_B](https://discuss.ray.io/u/Fady_B)\
**Post date:** [November 30, 2023, 8:23pm UTC](https://discuss.ray.io/t/multi-agent-partial-parameter-sharing/11449/3 "2023-11-30T20:23:41Z")

</div>

@kourosh Thanks looks like this is what I need. Is this compatible with the GTrXLNet as a shared encoder (or any RNN in general)?
