Self-playing Adversarial Language Game Enhances LLM Reasoning

Authors: pengyu  cheng
tianhao  hu
han  xu
zhisong  zhang
yong  dai
lei  han
nan  du
xiaolong  li
tencent ai lab
Venue: NeurIPS_cc_2024_Conference
Published: 2024-05-13 10:55:34

Abstract: We explore the potential of self-play training for large language models (LLMs) in a two-player adversarial language game called Adversarial Taboo. In this game, an attacker and a defender communicate around a target word only visible to the attacker. The attacker aims to induce the defender to speak the target word unconsciously, while the defender tries to infer the target word from the attacker's utterances. To win the game, both players must have sufficient knowledge about the target word and high-level reasoning ability to infer and express in this information-reserved conversation. Hence, we are curious about whether LLMs' reasoning ability can be further enhanced by Self-Playing this Adversarial language Game (SPAG). With this goal, we select several open-source LLMs and let each act as the attacker and play with a copy of itself as the defender on an extensive range of target words. Through reinforcement learning on the game outcomes, we observe that the LLMs' performances uniformly improve on a broad range of reasoning benchmarks. Furthermore, iteratively adopting this self-play process can continuously promote LLMs' reasoning abilities. The code is available at https://github.com/Linear95/SPAG.

Main paper: 
 introduction: 
 Large language models (LLMs), such as GPT-4 [OpenAI, 2023b] and Gemini [Team et al., 2023] , have reformed the domain of artificial intelligence (AI) with astonishing language capacities, such as Figure 2 : Examples of Adversarial Taboo with the same target word "conversation". The left shows an attacker-winning game, in which the defender unconsciously speaks out the target word. The right is a defender-winning episode because the defender makes the correct inference from the dialogue. natural language understanding [Yang et al., 2023b , Touvron et al., 2023 ], text generation [Kocoń et al., 2023 , Anil et al., 2023] , machine translation [Jiao et al., 2023] , and programming [Surameery and Shakor, 2023, Tian et al., 2023] . However, the reasoning ability of LLMs, which is essential for complex problem-solving [Pan et al., 2023] and advanced intelligence-developing [Yao et al., 2021] , still retains being challenged by various criteria including correctness [Zhang et al., 2023a] and faithfulness [Turpin et al., 2024] .To address the reasoning challenge of LLMs, plenty of works have contributed in-depth efforts from the perspectives of Chain-of-Thought (CoT) prompt engineering [Wei et al., 2022 , Ding et al., 2023 , Yao et al., 2024] , and the usage of auxiliary reasoning tools [Pan et al., 2023] . However, both prompt-based and tool-calling methods require additional prompt designs, which are inconsistent and sensitive to different prompt patterns and LLM checkpoints [Turpin et al., 2024 , Chu et al., 2023] . More fundamental and consistent reasoning-improving approaches are post-pretraining [Azerbayev et al., 2023] and fine-tuning [Dong et al., 2023a] , which trains LLMs with additional reasoning-related text corpus. Nevertheless, these methods demand sufficient high-quality textual data, which are difficult to collect due to the massive costs of human annotation efforts [Singh et al., 2023] .To improve LLM reasoning more efficiently, self-improvement methods, which enhance LLMs with model-generated synthetic data, have recently attracted increasing research attention [Singh et al., 2023 , Huang et al., 2023 , Burns et al., 2023 , Chen et al., 2024] . Self-improvement methods usually utilize the intrinsic language capability of LLMs to judge [Huang et al., 2023] , filter [Yuan et al., 2024] , or revise [Yuan et al., 2024] self-generated samples to enhance their quality. However, most self-improvement methods rely on a broad range of high-quality question queries to prevent over-fitting into a sub-domain of reasoning tasks, which still requires additional data collection and cleaning. Besides, the judgments from LLMs are not guaranteed objective [Raina et al., 2024] . If an LLM already has an incorrect or biased recognition of a particular concept, the self-improvement process can reinforce and amplify the LLM's cognitive dissonance.Towards more general and objective self-reasoning-improvement methods, we are inspired by the advancement from AlphaGO [Silver et al., 2016] to AlphaGO Zero [Silver et al., 2017] , in which the game agents' intelligence continuously promotes via self-play without any human knowledge. Analogically, we expect to set up a language game where LLMs can improve their reasoning capacities via reinforcement learning (RL) during self-play. Although language games have attracted increasing attention in natural language processing [Lewis et al., 2017 , Hausknecht et al., 2020 , Xu et al., 2023 , Wu et al., 2024] , most of them are specially designed with customized game rules, in lack of the generalization to improve the general language capacities of LLMs. Among a few generaltarget language games including red-teaming [Ma et al., 2023] , negotiation [Lewis et al., 2017] , and bargain [Abdulhai et al., 2023] , additional human judgments or reward models are required for outcome determination, which posts challenges on the efficiency and effectiveness of large-scale self-play RL training. Recent studies have raised interest in entity-or word-based language games, such as 20-Question [Zhang et al., 2023b] and Guess-My-City [Abdulhai et al., 2023] , which provide not only straight-forward word-level outcomes but also language universality by traversing the game word from comprehensive vocabularies. However, unlike the GO game, these word-based games are out of the adversarial scheme, limiting the game intensity and self-play learning effectiveness.With the above consideration, we select an adversarial language game called Adversarial Taboo [Yao et al., 2021] , in which an attacker and a defender perform a conversation around a target word only visible to the attacker. The attacker aims to induce the defender to speak out the target word unconsciously; the defender tries to avoid unconscious utterance of the target word and guess the word from the dialogue history. To win the adversarial game in information-limited conversations, both players are required to have high-level language capacities in terms of expression, upstanding, and reasoning. Moreover, by collecting target words from a vast vocabulary, this game can cover a broad range of topics providing sufficient language versatility. Besides, the game outcomes can be automatically and explicitly judged: we only need to check whether the target word appears in the defender's utterances (attacker wins) or its inference patterns (defender wins). We conduct the self-play on this adversarial game using open-source LLMs, LLaMA-2-7B [Touvron et al., 2023] and Baichuan-2-13B [Yang et al., 2023a] , with target words selected from a 50K top-frequency vocabulary [Davies, 2020] . Next, we conduct offline reinforcement learning on the game outcomes and observe significant performance improvement on a broad range of LLM reasoning benchmarks. Furthermore, we iterate this sampling-learning process with three epochs, within which the LLMs' reasoning can continuously obtain improvement. We believe this novel training scheme, Self-Play of Adversarial Game (SPAG), has great potential for developing advanced LLM capacities. 
preliminary: 
 With the development of LLMs [OpenAI, 2023a,b] , reinforcement learning (RL) has played an increasingly important role in language model training [Ouyang et al., 2022 , Ramamurthy et al., 2023] . The prime application scenario for RL in LLM training is reinforcement learning from human feedback (RLHF) [Yuan et al., 2023 , Cheng et al., 2023b , Zeng et al., 2023] . RLHF first learns a reward model r(x, y) from the human feedback preference pairs [Cheng et al., 2023a] , and then optimizes the LLM policy π θ (y|x) to maximize the expected reward value [Dong et al., 2023b] :L RLHF (π θ ) = -E x∼D,y∼π θ (y|x) [r(x, y)].(1) To learn the above objective, proximal policy optimization (PPO) [Schulman et al., 2017] algorithm has been recognized as the mainstream solution. In each update to equation 1, PPO minimizes:EQUATIONwhere πθ is a copy of π θ before the update, Âπθ is the estimated advantage value [Schulman et al., 2016] with respect to the reference policy πθ, and KL[πθ∥π θ ] is the Kullback-Leibler (KL) [Kullback, 1997] divergence regularizing π θ with an appropriate updating step. However, PPO for LLMs has been continually challenged due to its inefficient natural-text online sampling and the unstable training processes [Baheti et al., 2024] . Among the improvements to PPO [Rafailov et al., 2023 , Yuan et al., 2023 , Dong et al., 2023b] , Baheti et al. [2024] adopts the PPO objective into an offline scheme by using importance sampling [Neal, 2001] , which is named Advantage-Leftover-Lunch (A-LoL):EQUATIONHere the sample y ∼ π ref (y|x) and advantage Âπref are both from the reference distribution π ref (y|x) and calculated offline. Besides, Gulcehre et al. [2023] proposed Reinforced Self-Training (ReST) to simplify the RLHF scheme. With a threshold τ ∈ R, ReST updates the LLM by the reinforcement on the selected samplesEQUATIONwhere L θ (x, y) could be any offline RL loss such as A-LoL or the vanilla language modeling loss. 
self-play of adversarial language games: 
 The game of Adversarial Taboo is first introduced by Yao et al. [2021] , in which an attacker µ and a defender ν involve a multi-turn conversation. At the beginning of the game, the attacker is assigned a target word w ∈ V target , which is not informed to the defender. The attacker's target is to induce the defender to speak the target word unconsciously. To achieve this goal, the attacker can talk about any topic related to w, except directly speaking out the target word. In contrast, the defender is required to infer the target word without any unconscious utterance of the word. If the defender has sufficient confidence to infer the word, it can yell "I know the word! It is {target word}!". Then the game terminates. If the guess is correct, the defender wins, otherwise the attacker wins. Besides, the game has a maximum number of turns T 0 . If nobody wins during T 0 turns, there is a tie. The examples of Adversarial Taboo are shown in Figure 2 .Algorithm 1 Data collection of LLM self-plays for the adversarial language game. Inputs: LLM policy π θ (y|x), target word w, attacker and defender prompts f attack , f defend .Set the initial state s 0 = (w). for t from 1 to T do Sample an attacker utteranceu t ∼ µ θ (u t |s t-1 ) = π θ (y = u t |x = f attack (s t-1 )). Update state s ′ t = (w, u 1 , v 1 , . . . , u t-1 , v t-1 , u t ). Sample a defender utterance v t ∼ ν θ (v t |s ′ t ) = π θ (y = v t |x = f defend (s ′ t )). Update state s t = (w, u 1 , v 1 , . . . , u t-1 , v t-1 , u t , v t ). end for Collect an episode τ = (s 0 , s ′ 1 , s 1 , . . . , s ′ T , s T )We view the Adversarial Taboo as a two-player zero-sum Markov game [Littman, 1994] , which can be described by a tuple as (S, A, F, r):• The state space S = {s t , s ′ t : 1 ≤ t ≤ T 0 } contains two types of states, s ′ t = (w, u 1 , v 1 , u 2 , . . . , u t ) and s t = (w, u 1 , v 1 , u 2 , . . . , u t , v t ), where {u i } t i=1 and {v i } t i=1 are the utterances of the attacker and defender, respectively. Games start at s 0 = (w) with a target word w ∈ V target and end with T 0 maximum turns. States s ′ t and s t end with utterances u t and v t for the defender and attacker to act, respectively. • The action space A is shared with both the attacker and defender, which is equivalent to the token sequence space of natural language N = {x = (x 1 , x 2 , . . . , x L )|x l ∈ V token , L ∈ N + }. • The transition function F : S × A → S deterministically appends the utterance u t or v t at the end of the dialogue, and converts s ′ t = F (s t-1 , u t ) and s t = F (s ′ t , v t ). • The reward r : S × A → R evaluates the actions u, v ∈ A based on their corresponding states s, s ′ ∈ S with rewards r(s, u) and r(s ′ , v), respectively. Given a game episode τ = (s 0 , s ′ 1 , s 1 , . . . , s ′ T , s T ), we denote the attacker's total reward R(τ ) = T t=1 r(s t-1 , u t ), so the defender's total reward is T t=1 r(s ′ t , v t ) = -R(τ ) to satisfy the zero-sum constraint. More detailed reward designs with heuristic rules for the Adversarial Taboo can be found in Appendix B.In the above game, we denote µ(u|s) and ν(v|s ′ ) as the attacker's and defender's policies, respectively. Then each episode τ can be regarded as a trajectory with the probability:EQUATIONwhere P (w) is the data distribution of target word w ∈ V target . Then we can write the self-play objective of the Adversarial Taboo as:EQUATIONin which the attacker tries to maximize its total reward R(τ ) by optimizing policy µ, and the defender seeks strategies ν to maximize the defender reward -R(τ ) (minimize R(τ )). To play the above adversarial game with an LLM generation policy π θ (y|x), we first design prompt templates f attack , f defend : S → N for the attacker and defender respectively to convert the game states into natural language task descriptions. Next, we introduce the game policies for the two players:EQUATIONThe detailed prompt templates for the game are demonstrated in Appendix A.Due to the limited capability of current open-source LLMs, the generation policy π θ (y|x) can not guarantee the strict instruction-following of the game rules in prompts f attack (s) and f defend (s ′ ).Therefore, before the self-play, we first conduct an imitation learning (behavior cloning) of GPT-4's behaviors to ensure that π θ (u|f attack (s)) and π θ (v|f defend (s ′ )) act consistently with the game rules.To collect the game episodes of GPT-4 [Achiam et al., 2023] , we use the data collection procedure described in Algorithm 1. Similar to the setups in equation 7, we also design attacker and defender prompts for GPT-4 to act as the game players, which can be found in Appendix A.1.After collecting a group of GPT-4 game episodes for imitation learning as T im , we divide it into an attacker-winning set T attack im = {τ ∈ T im : R(τ ) > 0} and a defender-winning set T defend im = {τ ∈ T im : R(τ ) < 0}. The imitation learning loss is to maximize the log-likelihood of winners' actions:EQUATIONEQUATIONwhere the re-weighting parameter β 1 > 0 and the regularizer KL[π θ ∥π ref ] prevents the model from over-fitting on the language game task and maintains the model's general language abilities. The reference model π ref is the initial checkpoint of the LLM before training. The overall imitation learning objective isL im (π θ ) = 1 2 L attack im (π θ ) + 1 2 L defend im (π θ ).3.3 Reinforcement Learning from Self-play Imitation learning enables LLM to behave consistently following the game rules. Next, we conduct self-play by letting the LLM π θ (y|x) play alternatively as the attacker µ θ (u|s) = π θ (u|f attack (s)) and the defender ν θ (v|s ′ ) = π θ (v|f defend (s ′ )). Note that the self-play sampling process involves massive multi-turn auto-regressive text generation of the LLM, which causes heavy computational complexity and makes the on-policy RL training intensively inefficient. Therefore, we use an offline learning scheme: (1) make a copy πθ of current LLM policy π θ ;(2) collect self-play episodes Tθ = {τ ∼ µθ × νθ} from games between attacker µθ and defender νθ; With a group of episodes Tθ, we first fix the defender policy νθ and consider updating the attacker policy µ θ with respect to the self-play objectiveL AG (µ θ , νθ) = E τ ∼µ θ ×νθ [R(τ )].We calculate the corresponding policy gradient for the attacker as:EQUATIONwhere A µ θ t = A µ θ (s t-1 , u t ) is the advantage of action u t for the attacker µ θ in the self-play of µ θ × νθ. Here we apply importance sampling to unbiasedly estimate the expectation w.r.t µ θ (u t |s t-1 ) with the sampled actions from µθ(u t |s t-1 ) in Tθ. Inspired by TRPO [Schulman et al., 2015] and PPO [Schulman et al., 2017] , we design the following loss to optimize L AG (µ θ , νθ):EQUATIONwhere the re-weighting parameter β 2 > 0, and regularizer KL(π θ ∥πθ) guarantees an appropriate policy update step size. Following TRPO [Schulman et al., 2015] , we use empirical estimation Âµθ t of policy µθ to approximate the advantage A µ θ t . More details of advantage estimation are described in Appendix D. Similarly, from the perspective of the defender, we propose the corresponding loss:EQUATIONIn practice, we find when negative advantage values exist, the above policy gradient method can cause training instability and damage the LLMs' general language performance. To mitigate the Algorithm 2 Self-play of adversarial language games (SPAG) Inputs: LLM policy π θ (y|x), target word set V target , attacker and defender prompts f attack , f defend .for self-play epoch iterations do Make a copy of π θ as πθ.Set µθ(u|s) = πθ(u|f attack (s)) and νθ(v|s ′ ) = πθ(v|f defend (s ′ )).For each w ∈ V target , sample a episode τ ∼ µθ × νθ. Collect Tθ = {τ ∼ µθ × νθ} Split the attacker-winning set T attack θ and the defender-winning set T defend θ . Update π θ with loss L SPAG (π θ ). end for issue and obtain more stable RL training, we utilize the methodology of ReST [Gulcehre et al., 2023] as in equation 4, which considers the offline learning with samples {τ : R(τ ) > ξ} selected by a reward threshold ξ. More specifically, we set the reward threshold ξ = 0 and select the attacker-winning episodes T attack θ = {τ ∈ Tθ : R(τ ) > 0} and the defender-winning episodes T defend θ = {τ ∈ Tθ : R(τ ) < 0} for the attacker and the defender training respectively. Similar techniques have also been studied in earlier RL literature to obtain stable policy updates, such as self-imitation learning [Oh et al., 2018] and the UPGO [Vinyals et al., 2019] methods. Therefore, the overall self-play of adversarial language games (SPAG) objective is:L SPAG (π θ ) = - 1 2 E T attack θ T t=1 π θ (u t |f attack (s t-1 )) πθ(u t |f attack (s t-1 )) Âµθ t -β 2 KL[π θ ∥πθ] (13) - 1 2 E T defend θ T t=1 π θ (v t |f defend (s ′ t )) πθ(v t |f defend (s ′ t )) Âνθ t -β 2 KL[π θ ∥πθ] -αE (x,y)∼DSFT [log π θ (y|x)],where α > 0 is a re-weighting hyper-parameter, and E DSFT [log π θ (y|x)] is the log-likelihood on a supervised fine-tuning (SFT) dataset D SFT to prevent LLMs from losing general language abilities. 
experiments: 
 To verify the effectiveness of SPAG, we select open-source pretrained LLMs of different sources and model sizes, particularly LLaMA-2-7B [Touvron et al., 2023] and Baichuan-2-13B [Yang et al., 2023a] . As introduced in Section 3, the training process includes two stages: imitation learning of GPT-4, and self-play learning on game episodes. For baseline comparison, we consider Chain-of-Thought (CoT) [Wei et al., 2022] and continuous supervised fine-tuning (SFT) methods. Besides, we also test another two keyword-based non-adversarial language games: 20-Question and Guess-My-City as described in Abdulhai et al. [2023] . More details about the two games are in Appendix E.The training data preparation consists of the following three parts. More data collection details are in Appendix A.• Target Words: We aim to play the adversarial game with an extensive range of target words so that diverse topics can be discussed during the self-play processes, which helps maintain the generalization ability of LLMs. Hence, we collect the 50K most frequently used words from the Corpus of Contemporary American (CoCA) [Davies, 2020] as the target word list V target . Besides, stop words defined in NLTK [Bird, 2006] , which are commonly used with insignificant semantic meaning, are filtered out of V target .• Imitation Learning Data: To enable the instruction-following ability of open-source LLMs on game rules, we use the same data collection process in Algorithm 1 via the GPT-4 [OpenAI, 2023b] API and play the Taboo game one episode per target word. The attacker and defender prompts are in Appendix A.1. Due to the resource limitation, we only collect the GPT-4 self-play samples with the top 30K words from V target . The maximum interaction turn is randomly selected in the range [3, 8] . The results are collected as T im for the imitation learning.• Supervised Funetuning (SFT) Data: We also prepare general query-response SFT data to prevent LLMs from being over-fitted on the adversarial game. We use Alpaca [Taori et al., 2023] as the SFT set, which contains 52K instruction-following data from GPT-3 [Brown et al., 2020] . Evaluation To evaluate the LLMs' performance, we consider the following two perspectives:• Reasoning Benchmarks: To test the reasoning ability, we consider the following commonly used benchmarks including BIG-Bench Hard (BBH) [Suzgun et al., 2022] , ARC easy (ARC-e) & challenge (ARC-c) [Clark et al., 2018] , Mutual [Cui et al., 2020] , WinoGrande [Sakaguchi et al., 2019] , LogiQA2 [Liu et al., 2023] , PIQA [Bisk et al., 2020] . BBH requires the exact match of the generated answers, the other benchmarks are all within the multiple-choice form.Besides reasoning metrics, we test MMLU [Hendrycks et al., 2020] as a general performance evaluation for LLMs. Additionally, we calculate the geometric mean of the numerical results of all benchmarks as an overall performance measurement. More details can be found in Appendix C.• Game Win Rates: Besides the general LLM capabilities, we report the win rates on a testing vocabulary V test to validate if the game skills of LLMs improve through self-play. Following Abdulhai et al. [2023] , we use the same keyword list in 20-Question as V test , which contains 168 typical words manually selected from diverse daily objects. We denote the number of winning episodes as N win , the number of losing episodes as N lose , and the number of tied games as N tie .Then, the player win rate is calculated as (N win + 0.5N tie )/(N win + N loss + N tie ). The invalid game episodes, where LLM players do not strictly follow the game rules, are ignored.Training Details Most of our LLM training setups follow Alpaca [Taori et al., 2023] . For imitation learning, the learning rate is 5e-6, and the KL-penalty coefficient β 1 = 0.1. For SPAG training, the learning rate is 2e-6, the KL-penalty coefficient β 2 = 0.2, and the SFT coefficient α = 0.5. For the Alpaca SFT baseline, we exactly follow the training setups of Alpaca and set the learning rate to 2e-6. Among all training stages, the batch size is 128 and the max sequence length is 2048. Each training process maintains one epoch over the offline collected trajectories. The the decay parameter γ is set to 0.8. The maximum turn of the Adversarial Taboo is 5. All our experiments are conducted using 32 NVIDIA A100-SXM4 GPUs with 40GB memory.The main results are shown in Figure 1 , where each axis is normalized by the maximum performance value, representing the reasoning performance on a particular benchmark. For notation simplification, we call the LLM obtained after imitating learning as the IM model, and the LLM trained after the i-th epoch of SPAG as SPAG-i (i = 1, 2, 3).Imitation Learning With imitation learning over the collected GPT-4 self-play episodes, both LLaMA-2-7B and Baichuan-2-13B have obtained uniform performance improvements on all the reasoning benchmarks. As shown in Figure 1 , both gray regions are completely wrapped by the blueline polygons. Besides, as for the general language capacity, the imitation-learned (IM) LLaMA-2 model achieves a better MMLU performance than the original LLaMA-2 base in Table 2 . Although the imitation result of Baichuan-2-13B on MMLU slightly underperforms the base model, the numerical difference is insignificant compared to the reasoning gains, which indicates the imitation learning of the GPT-4 game behaviors can improve LLM reasoning while preserving the general language capacity. In Table 1 , we also report the IM models on two keyword-based games within Compared to the improvements in the reasoning benchmarks, this language-understanding decline is still within an acceptable range, since the overall performance (GM score) maintains increasing significantly. For the baseline comparison, we report the continuous SFT on the IM models (IM+AlpacaSFT) and self-played models on non-adversarial games (SP-20Q and SP-GuessCity). On both LLaMA-2 and Baichuan-2, continuous SFT models have lower performance scores compared with the corresponding SPAG-1 models. For non-adversarial self-play, SP-GuessCity even performs worse than Imitation-GuessCity, which with a high probability is because the game Guess-My-City has a more narrow topic range, insufficient to comprehensively improve the general LLM capacity.Ablation Study Since the SPAG training loss includes the SFT data, we conduct an ablation study to test whether the performance gains on reasoning benchmarks come from the SFT data or the SPAG method. More specifically, we follow the training setups in Alpaca [Taori et al., 2023] and conduct SFT on LLaMA-2-7B and Baichuan-2-13B with three epochs. The checkpoint after the ith-epoch training is denoted as AlpacaSFT-i (i = 1, 2, 3) and tested on the same evaluation sets.The SFT models' performances are also reported in Figure 1 and Table 1 & 2. With the LLaMA base, our SPAG-3 model can uniformly defeat the SFT baselines with clear performance gaps on all benchmarks. With the Baichuan base, except the Mutual set, the SPAG models maintain noticeable advantages on other metrics. Considering the distinct surpass of overall performance, we claim that the major contribution to the reasoning improvements should be credited to the SPAG scheme.Moreover, we test the sample efficiency and hyper-parameter effectiveness of SPAG in Figure 3 . For sample efficiency during imitation learning, we vary the imitation data size by collecting the GPT-4 game episodes on target words with top-iK frequency (i = 1, 2, 3, 5, 10, 15, 20, 30) . The ablation results are shown in the first column of Figure 3 . When game episode size increases larger than 5K, imitation from GPT-4 cannot significantly provide additional reasoning gains. For the KL coefficient β 1 , we test values in range [0, 0.4]. In figure 3 second column, we found KL coefficients around β 1 = 0.1 have more satisfying performance regarding reasoning improvements. For self-play ablation in the most right column, we find that when the SFT coefficient α > 0.5, it cannot bring remarkable benefits for reasoning improvements. The KL coefficient of the SPAG loss reaches the best performance with values around β 2 = 0.2. As for sample efficiency (third column of Figure 3 ), we find the performance gain from the increasing episode number is not as significant as in the imitation learning stage. However, more self-play episodes still bring higher reasoning scores. Game-Play Performance Besides the evaluation of LLMs' natural language abilities, we review the models' game-play performance in terms of the win rates in the testing set V test . We first test our IM models and SPAG models with GPT-4 as the opponent. For each testing word in V test , we play the language game twice, once GPT-4 as the attacker, and GPT-4 as the defender for another time. The average win rates are reported in the left-hand-side plot of Figure 4 , in which one can observe uniform and continuous win rate improvement of SPAG models playing with GPT-4. We also let SPAG models play the game against each other and report the attacker win rate in the right-hand-side plot of Figure 4 , in which we find the defender's performance continuously enhanced along with the SPAG epoch increasing. Besides, we also provide the self-play statistics including interaction number and average utterance length in supplementary Figure 6 , in which both players choose to use less communication to achieve victory. Self-play examples are attached in Appendix G. 
conclusion: 
 Towards more efficient reasoning-improving methods for LLMs, we introduce a novel training strategy called Self-Play learning in Adversarial language Game (SPAG). In our method, a given LLM first learns to act as an attacker and a defender to play the language game named Adversarial Taboo via imitation learning. Next, we collect self-play episodes from the LLM playing against a copy of itself in the adversarial game. Finally, the LLM is further reinforced on the selected winning episodes via our SPAG algorithm. We repeat this self-play & reinforcement process for three epochs and find that the LLM's reasoning performance continuously and uniformly improves on various benchmarks. The SPAG algorithm explores a new path to improve the fundamental capabilities of LLMs from the perspective of multi-agent self-play. With more elaborate language game designs under more comprehensive task setups, we believe the self-play approaches have great potential for developing a broader range of advanced language abilities of LLMs.Question: Does the paper provide open access to the data and code, with sufficient instructions to faithfully reproduce the main experimental results, as described in supplemental material?Answer: [Yes] Justification: We have provided the code for method implementation in the supplementary materials.Guidelines:• The answer NA means that paper does not include experiments requiring code. • At submission time, to preserve anonymity, the authors should release anonymized versions (if applicable). • Providing as much information as possible in supplemental material (appended to the paper) is recommended, but including URLs to data and code is permitted. 
limitations: 
 Due to the limited computational resources, we only verified the effectiveness of the SPAG method on two open-source LLMs, LLaMA-2-7B and Baichuan-2-13B. The SPAG performances for LLMs with larger sizes have not been empirically evaluated. Besides, more effective estimation methods for the value function and advantages remain unexplored in the SPAG training. For example, Monte Carlo tree search (MCTS) [Coulom, 2006] can be applied to the value function estimation of the Adversarial Taboo game. Also, actor-critic algorithms [Konda and Tsitsiklis, 1999] can provide more accurate policy gradient estimation with lower variances, which have not been tested on SPAG.Although self-playing adversarial language games can continuously improve the reasoning performance of LLMs, we haven't conducted sufficient studies about the harmful impact of this adversarial self-play training on LLMs. It remains unclear whether LLMs have learned unsafe behaviors such as cheating, bluffing, or other disgraceful tricks to win the adversarial games.Question: Does the paper specify all the training and test details (e.g., data splits, hyperparameters, how they were chosen, type of optimizer, etc.) necessary to understand the results?Answer: [Yes] Justification: We have provided sufficient training details and ablation studies in the experimental section.Guidelines:• The answer NA means that the paper does not include experiments.• The experimental setting should be presented in the core of the paper to a level of detail that is necessary to appreciate the results and make sense of them. • The full details can be provided either with the code, in appendix, or as supplemental material. 
broader impacts: 
 From our experiments, we have found the LLM capacities on a particular task can be continuously enhanced through self-play training. This indicates that we are closer to the LLMs' AlphaGo Zero moment: the intelligence level of AI agents can rapidly surpass human beings by self-playing on a particular language task without any supervision, as which already happened on the GO game [Silver et al., 2017] . By designing various self-play environments for LLMs, we can expect that the LLMs can comprehensively surpass humans in terms of intelligence level. This raises the urgency to study the methods to ensure the safety of such super-AIs. Although some of the works have already been devoted to this direction, such as the SuperAlignment [Burns et al., 2023] from OpenAI, more research alertness is required from the LLM community. Besides, within adversarial language games such as Adversarial Taboo, LLMs have great potential to develop harmful language tricks (such as cheating and bluffing) to achieve victory. We warn developers to make security checks on the self-played LLMs as exhaustively as possible.Question: Does the paper report error bars suitably and correctly defined or other appropriate information about the statistical significance of the experiments?Answer: [No] Justification: We did not report the error bars because of the limited computational resources and the huge computational complexity for the large-scale language model training.Guidelines:• The answer NA means that the paper does not include experiments.• The authors should answer "Yes" if the results are accompanied by error bars, confidence intervals, or statistical significance tests, at least for the experiments that support the main claims of the paper. • The factors of variability that the error bars are capturing should be clearly stated (for example, train/test split, initialization, random drawing of some parameter, or overall run with given experimental conditions). • The method for calculating the error bars should be explained (closed form formula, call to a library function, bootstrap, etc.) • The assumptions made should be given (e.g., Normally distributed errors). • It should be clear whether the error bar is the standard deviation or the standard error of the mean. • It is OK to report 1-sigma error bars, but one should state it. The authors should preferably report a 2-sigma error bar than state that they have a 96% CI, if the hypothesis of Normality of errors is not verified. • For asymmetric distributions, the authors should be careful not to show in tables or figures symmetric error bars that would yield results that are out of range (e.g. negative error rates). • If error bars are reported in tables or plots, The authors should explain in the text how they were calculated and reference the corresponding figures or tables in the text. 
experiments compute resources: 
 Question: For each experiment, does the paper provide sufficient information on the computer resources (type of compute workers, memory, time of execution) needed to reproduce the experiments?Answer: [Yes] Justification: We have provided the GPU version and the corresponding memory usage in the experimental setups. • We recognize that the procedures for this may vary significantly between institutions and locations, and we expect authors to adhere to the NeurIPS Code of Ethics and the guidelines for their institution. • For initial submissions, do not include any information that would break anonymity (if applicable), such as the institution conducting the review. 
 
 Appendix: To collect GPT-4 self-play data for imitation learning, we use the following system prompts to let GPT-4 play as the attacker and defender for the next-turn utterances.-Attacker System Prompt: There are two slots in the system prompts: "max turns" and "target word". "max turns" is an integer number randomly selected from [3, 8] . "target word" is filled by the target word of the game.We use the top 50k words with the highest frequency from the Corpus of Contemporary American (CoCA) [Davies, 2020] . The words are sorted by frequency. Words with less than two letters are removed. Next, we remove the stop words using the NLTK package [Bird, 2006] . For GPT-4 game collection, we use the top 30k words from the sorted word list. For the collection of self-play episodes, we use the whole 50k words for open-source LLMs to play. For the testing words, we follow the game setups of 20-Question in [Abdulhai et al., 2023] and use the same 168 object words selected from a vast range of topics.For training and inference of IM models and SPAG models, we use the following attacker and defender prompts.-Attacker Prompt:Play the game of Adversarial Taboo. In this game, there are two players, an attacker and a defender. At the beginning, the attacker is assigned a target word, with which the defender is not informed. The task of the attacker is to induce the defender to utter the target word unconsciously, then the attacker wins the game. However, the attacker is not allowed to utter the target word, otherwise the attacker loses.At the same time, the defender tries to figure out the target word. If the defender identifies the target word, it can say "I know the word! It is 'target word'!". Then the defender wins. Remember, the defender can only guess the word once, otherwise, it will directly lose the game.The game has {max turns} turns. if nobody wins during {max turns} turns, there is a tie.### Game History: {history} ### Instruction: You are the attacker. The target word is '{target word}'. Provide your response for the next turn.### Response:-Defender Prompt:Play the game of Adversarial Taboo. In this game, there are two players, an attacker and a defender. At the beginning, the attacker is assigned a target word, which the defender is not informed of. The task of the attacker is to induce the defender to utter the target word unconsciously, then the attacker wins the game. However, the attacker is not allowed to utter the target word, otherwise, the attacker loses.At the same time, the defender tries to figure out the target word. If the defender identifies the target word, it can say "I know the word! It is 'target word'!". Then the defender wins. Remember, the defender can only guess the word once, otherwise, it will directly lose the game.The game has {max turns} turns. if nobody wins during {max turns} turns, there is a tie.### Game History: {history} ### Instruction: You are the defender. Provide your response to infer the target word.To prevent LLMs from being over-fitted to a single prompt template during the self-play training, we rewrite the above prompt into 8 different expressions via GPT-4. Besides, we randomly select the instruction-tuning and chat formats to enhance the text diversity for the training query-response pairs.We heuristically design rewards to ensure that R(τ ) = 1 if the attacker wins, R(τ ) = -1 if the defender wins, and R(τ ) = 0 for ties.We design the reward function r with the following heuristic rules:• For each episode τ = (s 0 , s ′ 1 , s 1 , . . . , s ′ T , s T ), the attacker reward and the defender reward at t-th turn have r(s t-1 , u t ) = -r(s ′ t , v t ), so that the game is zero-sum:T t=1 r(s t-1 , u t ) + T t=1 r(s ′ t , v t ) = 0.• The attacker total reward R(τ ) > 0 if the attacker wins, R(τ ) < 0 if the defender wins, and R(τ ) = 0 if there is a tie.• Actions closer to the end of the game should have larger reward weights. Because they are semantically more related to the defender's guesses or mistakes, which have larger impacts on the final game outcome. Hence, we introduce a decay weight γ ∈ (0, 1) such that γ • r(s t , u t+1 ) = r(s t-1 , u t ) and γ • r(s ′ t+1 , v t+1 ) = r(s ′ t , v t ). Then {r(s t-1 , u t } T t=1 and {r(s ′ t , v t )} T t=1 become two geometrical sequences whose importance enlarges when dialogue turns increase.• To improve the LLM training stability, we normalized the total reward R to have norm |R(τ)| = 1 if R(τ ) ̸ = 0.Based on the above rules, given a complete trajectory, we can assign the reward for each action:   r(s t-1 , u t ) = (1 -γ)γ T -t /(1 -γ T +1 ), r(s ′ t , v t ) = -r(s t-1 , u t ), if attacker wins. r(s t-1 , u t ) = -(1 -γ)γ T -t /(1 -γ T +1 ), r(s ′ t , v t ) = -r(s t-1 , u t ), if defender wins. r(s t-1 , u t ) = 0, r(s ′ t , v t ) = 0, if game is tied.Note that the above reward design naturally encourages the players to interact less to win the game.For reasoning benchmark evaluation, we use a publicly available code repository called Language Model Evaluation Harness [Gao et al., 2023] .We run the evaluation with "dtype=float16" and "max gen tokens=1024" to make the evaluation faster and more stable. More specifically, we have modified the filtering parameters of BBH by enabling "remove whitespace" to remove the spaces at the beginning of the model output, increasing the pattern-match accuracy of the generated LLM responses. Following the LLaMA-2 paper [Touvron et al., 2023] , we report 5-shot results for MMLU, 3-shot for BBH, and 0-shot results for all other benchmarks. The detailed descriptions of benchmarks are listed below:• MMLU [Hendrycks et al., 2020 ] is a massive multi-task test set consisting of multiple-choice questions from various branches of knowledge, requiring the model to possess extensive world knowledge and problem-solving ability.• BIG-Bench Hard (BBH) [Suzgun et al., 2022 ] consists of 23 most hard tasks in BIG-Bench [Srivastava et al., 2022] , on which humans perform better than large language models.• Mutual [Cui et al., 2020] is a dataset for multi-turn dialogue reasoning modified from Chinese high school English listening comprehension exams.• ARC [Clark et al., 2018 ] consists of 7,787 questions and is partitioned into challenge set ARCchallege (ARC-c) and simple set ARC-easy (ARC-e), which require strong knowledge and reasoning abilities to solve.• LogiQA2 [Liu et al., 2023] is a revision and re-annotation of LogiQA [Liu et al., 2021] , a logical reasoning reading comprehension dataset. LogiQA2 has increased data volume, utilized manual translation, and removed cultural features.• WinoGrande [Sakaguchi et al., 2019] (WGrande) is a commonsense reasoning dataset consisting of 44k questions with binary options.• PIQA [Bisk et al., 2020] is a dataset designed to test the physical commonsense reasoning ability of LLM.To build up the rule-based game outcome judgement, for each target word, we first list its derivative words including the plural form (using TextBlob [Loria et al., 2018] ), and the change of tenses (i.e. adding suffices such as "ing", "ed" etc). For the attacker, if any word form in the form list appears in its utterance, we determined that it breaks the rules because the attacker is not allowed to directly speak the target word. For the defender, we first check whether any word form appears in its statements. If any form of the target word exists, the defender loses. If not, we further check whether the defender has made the prediction. If the prediction is correct, we mark a defender-winning game.Otherwise, if the predicted word is wrong, we claim that the attacker wins the game. We estimate the advantage A µθ t and A νθ t using the Temporal Difference (TD) residual [Sutton, 1988] :EQUATIONHere V µθ (s) is the value function for µθ based on the self-play of µθ ×νθ, which is based on the same language and reasoning ability of LLM πθ. To further simplify the advantage calculation, we make a reasonable approximation that for all states, the value function of self-plays of the same LLM equals 0 for the same levels of game-playing of the attacker and the defender. This leads to Âµθ t ≈ r(s t-1 , u t ). Similarly, for the defender advantage, we have approximationÂνθ t ≈= -r(s ′ t , v t ).Here the defender advantage has a negative sign because the origin reward r is defined from the perspective of the attacker (the defender gets reward -r(s ′ t , v t ) in the zero-sum game).We consider two non-adversarial games as baselines, 20-Question and Guess-My-City. Both games are also target-word-based. Imitation learning and the first-epoch self-play are conducted in these two games respectively. The imitation data we used is also collected with GPT-4 from Abdulhai et al. [2023] . For each game, 20k game history dialogues are extracted from this dataset as the same data size to the SPAG imitation. Then, each imitation-learned model is used to sample 10k game episodes via self-play with the same Algorithm 1. Then each model is further trained with the SPAG loss.Game rule descriptions to the non-adversarial games:• 20-Question: one player (the oracle) thinks of an object, while the other player (the guesser) attempts to identify it by asking a series of yes-or-no questions. The game will have 20 rounds.• Guess-My-City: one player (the oracle) thinks of a city, while the other player (the guesser) attempts to identify it by asking a series yes/no questions and open-ended questions. The game will have 20 rounds.For the SPAG model testing word list, we initially use a self-defined testing set, which includes 150 target words manually selected from diverse topics. The old-version game performances are reported in Figure 5 . Besides, we show the interaction numbers and average utterance length in Figure 6 . Through the self-play training, the number of dialogue rounds continuously decreases. With the SPAG training epoch increasing, the length of the players' utterances decreases. (d) We recognize that reproducibility may be tricky in some cases, in which case authors are welcome to describe the particular way they provide for reproducibility.In the case of closed-source models, it may be that access to the model is limited in some way (e.g., to registered users), but it should be possible for other researchers to have some path to reproducing or verifying the results.38th Conference on Neural Information Processing Systems (NeurIPS 2024). 


Decision: This paper introduces novel methods based on imitation learning and RL for fine-tuning large language models (LLMs) using an adversarial language game to enhance their reasoning abilities. This game, Adversarial Taboo (Yao et al., 2021), has one model (the attacker) trying to get another model (the defender) to say a secret word without explicitly revealing it. The motivation behind this approach is that both participants in this game require strong reasoning skills to succeed. The paper demonstrates that training LLMs with this adversarial game improves their reasoning abilities across various benchmarks.

All reviewers agree that the paper makes significant contributions: the proposed methods are creative, well-motivated, and some of them (especially SPAG-2 and SPAG-3) achieve good results on established benchmarks. The reviewers had mostly minor concerns, most of which were addressed during discussions with the authors. The authors' plan to enhance the paper in the next version (e.g., providing more detailed analyses on the Mutual benchmark) seems reasonable, and we look forward to these improvements being incorporated into the camera-ready version. Overall, this paper represents solid and interesting work, and I enthusiastically recommend its acceptance.

Minor point: The abstract (in the PDF) reads as though *Adversarial Taboo* is a contribution of the paper, as it is the only term italicized in the abstract and appears in the first sentence. Such prominence is usually reserved for methods or ideas that are new. I initially read the abstract as presenting Adversarial Taboo as a new game, and it seems that at least one of the reviewers also had the same initial misunderstanding. I recommend that the authors address this potential for confusion.

Reviews: review: paper_summary: paper_summary: This research investigates a novel self-play training method for Large Language Models (LLMs) using an adversarial language game called Adversarial Taboo. In this game, one LLM acts as an attacker trying to get another LLM (acting as a defender) to say a secret word without revealing it directly. Both sides need strong reasoning to succeed: the attacker to nudge the defender, and the defender to infer the word.  The authors find that training LLMs with self-play in this game improves their reasoning abilities across various benchmarks.
strength_weakness: strength_weakness: - The choice of the second model seems arbitrary. Why not just show it on two LLaMa models?
questions: questions: - Would it be beneficial if we had $n>2$ models?
- How well do you think the results will transfer to other models?
limitations: limitations: Limitations addressed
paper_summary: paper_summary: This paper explores the effects of fine-tuning LLMs on adversarial language games on standard NLP benchmarks such as MMLU, BIG-Bench Hard, etc. The primary game studied is that of "adversarial taboo", an adversarial variant of the well known game Taboo that was first introduced in prior work. This variant is finite-horizon and zero-sum, where the communicator (aka the attacker) tries to induce the utterance of the target word in the listener (aka the defender) while the defender tries to identify the target word and gets one guess (by answer in the form "I know the word! It is ‘target word‘") to identify the target word. If the attacker is able to induce an utterance in the defender not in the form of a guess, or if the defender guesses incorrectly, then it wins the round, and if the defender correctly guesses the target word, it wins the round. Otherwise, the outcome is considered a tie. The authors collect self-play data from GPT and fine-tune Llama-2 7B and Baichuan 13B on the collected game traces, in addition to standard instruction-tuning data in the form of Alpaca. They find that compared to the base model, as well as Alpaca-only fine-tunes, their models trained to also imitate GPT's gameplay achieve higher performance on the tasks of interest. The authors also compare against imitation learning on other adversarial language games, such as 20 questions and "Guess My City" (proposed in earlier work), and find that models trained on these other games are much weaker.
strength_weakness: strength_weakness: * The authors don't actually have any results with RL, even though much of the paper is focused on MDP/RL formalisms and the details of RL algorithms.
* Insufficient baselines to determine whether the imitation learning on GPT self-play traces is actually the reason for improved benchmark performance. The comparisons to Alpaca-only models are interesting, but not enough since the self-play traces are still additional training data. The authors should compare to data that looks similar to the self-play traces, such as multi-turn dialogues about the target word without playing the game directly
questions: questions: * An alternative explanation for why this fine-tuning appears to work is that the SPAG taboo data is simply a rich conversational dataset on which supervised learning is helpful for general LLM capabilities, rather than the game objective or self-play or adversarial nature. This would also explain why the model fine-tuned on 20Q data performs so badly even though the game is very similar in structure, since the version of 20Q used only has 158 different unique targets while the taboo game has 50,000 unique targets. How do we know it's actually taboo that is important?
limitations: limitations: Yes
paper_summary: paper_summary: The paper introduces a self-play method, Adversarial Taboo, to bolster the reasoning ability of LLMs. By engaging in a two-player game that requires strategic communication around a target word, LLMs demonstrate improved performance across several reasoning benchmarks. The method leverages reinforcement learning to refine the models' strategies over successive rounds of play.
strength_weakness: strength_weakness: 1. I concur with the use of a general-purpose instruction-tuning dataset to prevent overfitting to the game. However, I remain concerned that the method proposed in this paper may compromise the language model's broader capabilities in favor of enhancing reasoning skills, as evidenced by the examples provided in the appendix. The authors have only presented performance metrics for a few reasoning-related tasks. To bolster the argument, I believe it would be more persuasive if the authors could compare the results of their method with those of Alpaca SFT on general tasks.

2. The enhancements brought by the method proposed in this paper are not as pronounced when compared to the IM+AlpacaSFT baseline, and there is even a decline under mutual conditions. I look forward to the authors elaborating on the potential of this method for scaling or multi-round iterations.
questions: questions: The table in Figure 1 is quite difficult to read. Could you please add more explanatory information in the caption to facilitate the reader's understanding?
limitations: limitations: Yes.
paper_summary: paper_summary: This paper explores an adversarial language game named Adversarial Taboo, where an attacker and a defender engage in a conversation centered around a target word visible only to the attacker. The attacker's goal is to prompt the defender to unconsciously utter the target word, while the defender strives to avoid doing so and deduce the word from the conversation history. Using LLaMA-2-7B and Baichuan-2-13B models, the study demonstrates that applying reinforcement learning to game outcomes enhances the reasoning capabilities of large language models.
strength_weakness: strength_weakness: - The entire procedure involves standard training within the game data. However, the insight that this training not only  increase the game's win rate but also enhances general reasoning ability is quite interesting.
- There is no discussion or analysis conducted on why training within the game can increase general reasoning ability.
- No ablation study was conducted on training techniques, such as filtering negative advantages.


Others:

- PPO objective (Eq.2): KL (\pi || \pi_sft) ?
questions: questions: Regarding the two baselines (SP-20Q and SP-GuessCity), the authors describe them as self-play models for non-adversarial games. How is self-play conducted in the context of non-adversarial games?
limitations: limitations: The paper includes a section on limitations.

Comments: title: Reply to response
Reply to rebuttal
comment: Thanks for the reply. I choose to maintain my positive score
Thank you so much for raising your score. We are glad to find your concerns being addressed with our explanation!
Thank you for your reply. I think if non-self-play data were used, the proposed SPAG objective would degenerate into an offline PPO (or A-LoL) objective with negative advantage filtering, which can be regarded as an off-policy variant method for RLHF (or simply RL). The major difference is that in SPAG we collect the positive advantages for **both the attacker and defender**, but without a self-play scenario, we can only collect one type of advantage from the **unique** environment outcome. Therefore, the proposed SPAG objective can be regarded as a PPO customization to the self-play scenarios.
Thank you for your response! My apologies, I misread the ReST paper and had previously understood it to be just performing imitation learning on high-scoring samples (e.g. winning GPT-4 traces) but now see that it and your work are using more sophisticated objectives that do require the MDP formalism, and that the SPAG-1/2/3 models differ more substantively from each other as a result. I'd be happy to increase my score.
Thanks for the reply. Regarding the second point about negative advantages, how would the method perform with negative advantages filtering, but other data (such as data from no self-play scenarios) were used instead?
I've read the rebuttal. Thanks for your response!