# A single centralized critic for multiple actor agents

**URL:** <https://discuss.ray.io/t/a-single-centralized-critic-for-multiple-actor-agents/1092>\
**Category:** RLlib\
**Created:** [March 3, 2021, 7:57am UTC](https://discuss.ray.io/t/a-single-centralized-critic-for-multiple-actor-agents/1092 "2021-03-03T07:57:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![51616](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/51616/32/247_2.png) [@51616](https://discuss.ray.io/u/51616)\
**Post date:** [March 3, 2021, 7:57am UTC](https://discuss.ray.io/t/a-single-centralized-critic-for-multiple-actor-agents/1092/1 "2021-03-03T07:57:58Z")

</div>

I wonder if this is possible using RLlib because, as I understand, in centralized critic example ([ray/centralized\_critic\_2.py at master · ray-project/ray · GitHub](https://github.com/ray-project/ray/blob/master/rllib/examples/centralized_critic_2.py)) each of the agent has its own centralized critic.

Can I implement a custom algorithm that has a single centralized critic that gives a value for all agents given current state and all agents’ action? What options do I have if I want to implement this?

---

<div class="post-metadata">

**Author:** ![arturn](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/arturn/32/2096_2.png) [@arturn](https://discuss.ray.io/u/arturn)\
**Post date:** [July 19, 2021, 7:26pm UTC](https://discuss.ray.io/t/a-single-centralized-critic-for-multiple-actor-agents/1092/2 "2021-07-19T19:26:22Z")

</div>

Hi,  
Have you had a look at [variable sharing between policies](https://docs.ray.io/en/master/rllib-env.html#variable-sharing-between-policies)?

> With [ModelV2](https://docs.ray.io/en/master/rllib-models.html#tensorflow-models), you can put layers in global variables and straightforwardly share those layer objects between models instead of using variable scopes.

Cheers
