Improving Role Consistency in Multi-Agent Collaboration via Quantitative Role Clarity
Authors: Guoling Zhou, Wenpei Han, Fengqin Yang, Li Wang, Yingcong Zhou, Zhiguo Fu
Organizations: School of Information Science and Technology, Northeast Normal University, Changchun, Jilin · School of Computer Science and Engineering, Guangxi Normal University, Guilin, Guangxi
In large language model (LLM)-driven multi-agent systems, disobey role specification (failure to adhere to the defined responsibilities and constraints of an assigned role, potentially leading to an agent behaving like another) is a major failure mode \cite{DBLP:journals/corr/abs-2503-13657}. To address this issue, in the present paper, we propose a quantitative role clarity to improve role consistency. Firstly, we construct a role assignment matrix S(φ)=[sij(φ)], where sij(φ) is the semantic similarity between the i-th agent's behavior trajectory and the j-th agent's role description. Then we define role clarity matrix M(φ) as softmax(S(φ))−I, where softmax(S(φ)) is a row-wise softmax of S(φ) and I is the identity matrix. The Frobenius norm of M(φ) quantifies the alignment between agents' role descriptions and their behaviors trajectory. Moreover, we employ the role clarity matrix as a regularizer during lightweight fine-tuning to improve role consistency, thereby improving end-to-end task performance. Experiments on the ChatDev multi-agent system show that our method substantially improves role consistency and task performance: with Qwen and Llama, the role overstepping rate decreases from 46.4% to 8.4% and from 43.4% to 0.2%, respectively, and the role clarity score increases from 0.5328 to 0.9097 and from 0.5007 to 0.8530, respectively, the task success rate increases from 0.6769 to 0.6909 and from 0.6174 to 0.6763, respectively.
Figures & tables
Figure 1: Overview of the LoRA - tuning framework with role clarity regularization. The framework comprises four stages: (I) collecting high - quality multi - turn interaction trajectories via rejection sampling, (II) extracting embeddings and computing role assignment matrix based on similarity, (III) role clarity - regularized fine tuning using LoRA, and (IV) evaluating role consistency and end-to-end task performance in multi - agent interactions.
Figure 2: Role overstepping rates for DeepSeek Chat, Qwen2.5 7B, and Llama3.1 8B on SWE - Dev under ChatDev. Lower temperature T yields more deterministic output, whereas higher temperature increases diversity.
Algorithm 1 LoRA Fine Tuning for Agent Ai with Role Clarity Regularization
CEO
CPO
Overstepping Rate ( <INFO>/INFO)
Total Overstepping Rate( <INFO>/INFO )
easy
Δ(%)
hard
Δ(%)
total
Δ(%)
Base
Base
43.0/65.8
–
49.7/68.2
–
46.4/67.0
–
FT
Base
37.2/37.6
-5.8/-28.2
44.0/44.0
-5.7/-24.2
40.6/40.8
-5.8/-26.2
Base
FT
19.2/34.4
-23.8/-31.4
16.8/30.4
-32.9/-37.8
18.0/32.4
-28.4/-34.6
FT
FT
10.0/10.4
-33.0/-55.4
6.8/7.6
-42.9/-60.6
8.4/9.0
-38.0/-58.0
Table 1: Role overstepping rate (%) on the SWE-Dev evaluation set for the ChatDev system with Qwen as the backbone (with role clarity regularization). Results are reported for the easy and hard subsets (250 cases each) and for the full set (500 cases; total).
CEO
CPO
Overstepping Rate ( <INFO>/INFO)
Total Overstepping Rate( <INFO>/INFO )
easy
Δ(%)
hard
Δ(%)
total
Δ(%)
Base
Base
45.2/46.4
–
41.6/42.8
–
43.4/44.6
–
FT
Base
0.8/0.8
-44.4/-45.6
0.5/0.5
-41.1/-42.3
0.65/0.65
-42.75/-43.95
Base
FT
16.8/16.8
-28.4/-29.6
14.4/15.6
-27.2/-27.2
15.6/16.2
-27.8/-28.4
FT
FT
0.4/0.4
-44.8/-46.0
0.0/0.0
-41.6/-42.8
0.2/0.2
-43.2/-44.4
Table 2: Role overstepping rate (%) on the SWE-Dev evaluation set for the ChatDev system with Llama as the backbone (with role clarity regularization). Results are reported for the easy and hard subsets (250 cases each) and for the full set (500 cases; total).
CEO
CPO
Role clarity score
Total role clarity score
easy
Δ
hard
Δ
total
Δ
Base
Base
0.5360
–
0.5295
–
0.5328
–
FT
Base
0.6583
+0.1223
0.6440
+0.1145
0.6511
0.1183
Base
FT
0.6014
+0.0654
0.6044
+0.0749
0.6029
+0.0701
FT
FT
0.9081
+0.3721
0.9076
+0.3781
0.9079
+0.3751
Table 3: Role clarity score on the SWE-Dev evaluation set for the ChatDev system with Qwen as the backbone (with role clarity regularization). Results are reported for the easy and hard subsets (250 cases each) and for the full set (500 cases; total).
CEO
CPO
Role clarity score
Total role clarity score
easy
Δ
hard
Δ
total
Δ
Base
Base
0.5000
–
0.5012
–
0.5007
–
FT
Base
0.5975
+0.0975
0.5496
+0.0484
0.5735
+0.0728
Base
FT
0.5635
+0.0635
0.5655
+0.0643
0.5645
+0.0638
FT
FT
0.8525
+0.3525
0.8535
+0.3523
0.8530
+0.3523
Table 4: Role clarity score on the SWE-Dev evaluation set for the ChatDev system with Llama as the backbone (with role clarity regularization). Results are reported for the easy and hard subsets (250 cases each) and for the full set (500 cases; total).
CEO
CPO
Overstepping Rate ( <INFO>/INFO)
Total Overstepping Rate( <INFO>/INFO )
easy
Δ(%)
hard
Δ(%)
total
Δ(%)
Base
Base
43.0/65.8
–
49.7/68.2
–
46.4/67.0
–
FT
Base
36.4/36.4
-6.6/-29.4
45.6/46.0
-4.1/-22.2
41.0/41.2
-5.4/-25.8
Base
FT
24.4/37.2
-18.8/-28.8
21.6/34.4
-28.1/-33.8
23.0/35.8
-23.4/-31.2
FT
FT
12.0/12.0
-31.0/-53.8
9.2/9.2
-40.5/-59.0
10.6/10.6
-35.8/-56.4
Table 5: Role overreach rate (%) on the SWE-Dev evaluation set for the ChatDev system with Qwen as the backbone, with role clarity regularization disabled. Results are reported for the easy and hard subsets (250 cases each) and for the full set (500 cases; total).
CEO
CPO
Overstepping Rate ( <INFO>/INFO)
Total Overstepping Rate( <INFO>/INFO )
easy
Δ(%)
hard
Δ(%)
total
Δ(%)
Base
Base
45.2/46.4
–
41.6/42.8
–
43.4/44.6
–
FT
Base
1.0/1.0
-44.2/-45.4
0.8/0.8
-40.8/-42.0
0.9/0.9
-42.5/-43.7
Base
FT
16.4/16.8
-28.8/-29.6
16.0/16.0
-25.6/-26.8
16.2/16.4
-27.2/-28.2
FT
FT
0.0/0.0
-45.2/-46.4
0.0/0.0
-41.6/-42.8
0.0/0.0
-43.4/-44.6
Table 6: Role overreach rate (%) on the SWE-Dev evaluation set for the ChatDev system with Llama as the backbone, with role clarity regularization disabled. Results are reported for the easy and hard subsets (250 cases each) and for the full set (500 cases; total).
CEO
CPO
Role clarity score
Total role clarity score
easy
Δ
hard
Δ
total
Δ
Base
Base
0.5360
–
0.5295
–
0.5328
–
FT
Base
0.5694
+0.0334
0.5622
+0.0327
0.5658
0.0330
Base
FT
0.5086
-0.0274
0.5067
-0.0219
0.5077
-0.0251
FT
FT
0.5208
-0.0152
0.5208
-0.0087
0.5208
-0.012
Table 7: Role clarity score (%) on the SWE-Dev evaluation set for the ChatDev system with Qwen as the backbone, with role clarity regularization disabled. Results are reported for the easy and hard subsets (250 cases each) and for the full set (500 cases; total).
CEO
CPO
Role clarity score
Total role clarity score
easy
Δ
hard
Δ
total
Δ
Base
Base
0.5000
–
0.5012
–
0.5007
–
FT
Base
0.5579
+0.0579
0.5549
+0.0537
0.5564
+0.0557
Base
FT
0.5008
0.0008
0.4975
-0.0037
0.4992
-0.0015
FT
FT
0.5305
+0.0305
0.5287
+0.0275
0.5296
+0.0289
Table 8: Role clarity score (%) on the SWE-Dev evaluation set for the ChatDev system with Llama as the backbone, with role clarity regularization disabled. Results are reported for the easy and hard subsets (250 cases each) and for the full set (500 cases; total).
Completeness
Executability
Consistency
Quality
Overstepping
clarity score
Qwen
0.7002
0.9713
0.3593
0.6769
0.8133
0.5278
Qwen (FT)
0.7272 ↑2.70%
0.9561 ↓1.52%
0.3894 ↑3.01%
0.6909 ↑1.40%
0.1554 ↓65.79%
0.8817 ↑35.39%
Llama
0.7106
0.8243
0.3218
0.6174
0.6225
0.5003
Llama (FT)
0.7635 ↑5.29%
0.8716 ↑4.73%
0.3937 ↑7.19%
0.6763 ↑5.89%
0 ↓62.25%
0.8431 ↑34.28%
Table 9: SRDD end-to-end performance and role-consistency for Qwen and Llama. “FT” denotes fine-tuning both the CPO and CEO agents on SWE-Dev; non-FT uses the original base model. Lower is better for overstepping rate, and higher is better for the other metrics.