SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Discussion on assumptions. Assumption 2 prescribes that each content component  $c_{j_c}$  and each style component  $s_{j_s}$  do not fully contain each other's influence support. Together with Theorem 1, this assumption is essential to the identification of  $\mathbf{s}$ , without which  $\hat{s}_{j_s}$  may absorb the influence from  $c_{j_c}$ . Assumption 2 does not demand the supports of the entire subspaces  $\mathbf{c}$  and  $\mathbf{s}$  to be partially intersecting or even disjoint, and the latter directly implies Assumption 2. This assumption is plausible for many real-world data distributions, especially for unstructured data like languages and images – certain dimensions in the pixels and word embeddings may reflect the information of either the content or the style.
Contrast with prior work. Kong et al. [2022] obtains the identifiability of the style subspace  $\mathbf{s}$  by exploiting the access to multiple domains over which the marginal distribution of  $\mathbf{s}$  (i.e.,  $p(\mathbf{s}|\mathbf{u})$ ) varies substantially over domains  $\mathbf{u}$ . This hinges on the independence between the two subspaces and is not applicable when the marginal distribution of  $\mathbf{s}$  only varies over the content  $\mathbf{c}$ , i.e.,  $p(\mathbf{s}|\mathbf{c},\mathbf{u})$ .
5 A Framework for Unsupervised Counterfactual Generation
In this section, we translate the theoretical insights outlined in Section 4 into an unsupervised counterfactual generation framework. Guided by the theory, we can approximate the underlying data-generating process depicted in Fig 1 and recover the disentangled latent components.
Figure 3: Our VAE-based framework - MATTE. During training, the input  $\mathbf{x}$  is fed to the encoder  $f_{\mathrm{enc}}$  to derive the latent variable  $\mathbf{z} = [\mathbf{c},\mathbf{s}]$ , which is then passed to the decoder  $g_{\mathrm{dec}}$  for reconstruction. Flow modules, denoted as  $r_c$  and  $r_s$ , are implemented to model the causal influences on  $\mathbf{c}$  and  $\mathbf{s}$  respectively, which yields the creation of exogenous variables  $\tilde{\mathbf{c}}$  and  $\tilde{\mathbf{s}}$ . To generate transferred data  $\mathbf{x}_{\mathrm{transfer}}$ , we intervene on the style exogenous variable  $\tilde{\mathbf{s}}$  while keeping the original content variable  $\mathbf{c}$  unchanged (indicated by the green arrows).
In the following, we will describe each module in our VAE-based estimation framework (Fig 3), the learning objective, and the procedure for counterfactual generation.
5.1 VAE-based Estimation Framework
Given input sentences  $\mathbf{x}$  from various domains, we use the VAE encoder  $f_{\mathrm{enc}}$  to parameterize the posterior distribution  $q_{f_{\mathrm{enc}}}(\mathbf{z}|\mathbf{x})$  and sample  $\mathbf{z} \sim q_{f_{\mathrm{enc}}}(\mathbf{z}|\mathbf{x})$ . The posterior sample  $\mathbf{z}$  is then fed into the VAE decoder  $g_{\mathrm{dec}}$  for reconstruction  $\mathbf{x}_{\mathrm{rec}} = g_{\mathrm{dec}}(\mathbf{z})$ , as in conventional VAE training.
We split  $\mathbf{z}$  into two components:  $\mathbf{c}$  and  $\mathbf{s}$ . As shown in Fig 1, both  $\mathbf{c}$  and  $\mathbf{s}$  encompass information of a particular domain  $\mathbf{u}$ , and  $\mathbf{s}$  is also influenced by  $\mathbf{c}$ . We parameterize such influences using flow-based models [Dolatabadi et al., 2020, Durkan et al., 2019]  $r_c$  and  $r_s$ , respectively:
$$
\tilde {\mathbf {c}} = r _ {c} (\mathbf {c}; \mathbf {u}), \tilde {\mathbf {s}} = r _ {s} (\mathbf {s}; \mathbf {u}, \mathbf {c}), \tag {5}
$$
where  $\tilde{\mathbf{c}}$  and  $\tilde{\mathbf{s}}$  are exogenous variables that are independent of each other, and  $\mathbf{u}$  and  $(\mathbf{u},\mathbf{c})$  act as contextual information for the flow models  $r_c(\cdot;\mathbf{u})$  and  $r_s(\cdot;\mathbf{u},\mathbf{c})$ . This design promotes parameter sharing across domains, as we only need to learn a domain embedding  $\mathbf{u}$  (c.f., a separate flow model per domain). As part of the evidence-lower-bound (ELBO) objective in VAE, we regularize the distributions of  $\tilde{\mathbf{z}} = [\tilde{\mathbf{c}},\tilde{\mathbf{s}}]$  to align with the prior  $p(\tilde{\mathbf{z}})$  using Kullback-Leibler (KL) divergence. Consequently, the VAE learning objective can be expressed as:
$$
\mathcal {L} _ {\mathrm {V A E}} := - \log p _ {f _ {\mathrm {e n c}}, g _ {\mathrm {d e c}}} \left(\mathbf {x} _ {\mathrm {r e c}}\right) + \mathrm {K L} \left(q _ {f _ {\mathrm {e n c}}, r _ {c}, r _ {s}} (\tilde {\mathbf {z}} | \mathbf {x}) | p (\tilde {\mathbf {z}})\right), \tag {6}
$$
where the prior  $p(\tilde{\mathbf{z}})$  is set to a standard Gaussian distribution,  $\mathcal{N}(\mathbf{0},\mathbf{I})$ , consistent with typical VAE implementations.
5.2 Sparsity Regularization for Identification Guarantees
Guided by the insights from Theorem 1 and Theorem 2, the sparsity constraint on the influence of s (i.e., Equation 3) and the partially intersecting influence constraint (i.e., Equation 4) are crucial to faithfully recover and disentangle the latent representations  $\mathbf{c}$  and s.
Sparsity of the style influence. To implement Equation 3, we compute the Jacobian matrix  $\mathbf{J}_{g_{\mathrm{dec}}}(\mathbf{z})$  for the decoder function on-the-fly and apply  $\ell_1$  regularization to the columns corresponding to the style variable  $[\mathbf{J}_{g_{\mathrm{dec}}}(\mathbf{z})]_{:,d_c + 1:d_z}$  to control its sparsity. That is,  $\mathcal{L}_{\mathrm{sparsity}} = \| [\mathbf{J}_{g_{\mathrm{dec}}}(\mathbf{z})]_{:,d_c + 1:d_z}\| _1$ .
Partially intersecting influences. To encourage sparsity in the intersection of influence between c and s (as defined in Equation 4), we select  $K$  output dimensions  $\mathcal{I}_s$  of  $\mathbf{J}_{g_{\mathrm{dec}}}(\mathbf{z})$  that capture the most substantial influence from s and another set of  $K$  output dimensions  $\mathcal{I}_c$  that receive the least influence from c. Subsequently, we apply  $\ell_1$  regularization to the influence from c on the output dimensions at the intersection  $\mathcal{I}_s \cap \mathcal{I}_c$ , i.e.,  $\mathcal{L}_{\mathrm{partial}} = \left\| [\mathbf{J}_{g_{\mathrm{dec}}}(\mathbf{z})]_{\mathcal{I}_s \cap \mathcal{I}_c, 1:d_c} \right\|_1$ .
Content variable masking. In practice, the content dimensionality  $d_{c}$  is a design choice. When  $d_{c}$  is set excessively large, the sparsity regularization term  $\mathcal{L}_{\mathrm{sparsity}}$  may cause the style variable  $\mathbf{s}$  to lose its influence, squeezing the information of  $\mathbf{s}$  into the content variable  $\mathbf{c}$ . To handle this issue, we apply a trainable soft mask that operates on  $\mathbf{c}$  to dynamically control its dimensionality.
In sum, the overall training objective is as follows:
$$
\mathcal {L} := \mathcal {L} _ {\mathrm {V A E}} + \lambda_ {\text {s p a r s i t y}} \cdot \mathcal {L} _ {\text {s p a r s i t y}} + \lambda_ {\text {p a t i a l}} \cdot \mathcal {L} _ {\text {p a t i a l}} + \lambda_ {\mathrm {c} - \text {m a s k}} \cdot \mathcal {L} _ {\mathrm {c} - \text {m a s k}}, \tag {7}
$$
where  $\lambda$  's are weight parameters to balance various loss terms.
For the sake of simplicity, in this section, we discuss estimated variables without the  $\hat{\cdot}$  notation, as in  $\S 4$ .
5.3 Style Intervention
As discussed in Section 3, the content-style dependence should be preserved when generating counterfactual text to ensure linguistic consistency. This can be achieved by intervening on the exogenous style variable  $\tilde{\mathbf{s}}$  of the original sample. Specifically, we feed the original sample  $\mathbf{x}$  to the encoder  $f_{\mathrm{enc}}$  to obtain variables [c, s]. Subsequently, we pass the style variable  $\mathbf{s}$  through the flow models  $r_s$  to obtain its exogenous counterpart  $\tilde{\mathbf{s}}$ , i.e.,  $\tilde{\mathbf{s}} = r_s(\mathbf{s}; \mathbf{c}, \mathbf{u})$ . To carry out style transfer, we set the original variable  $\tilde{\mathbf{s}}$  to the desired style value  $\tilde{\mathbf{s}}_{\mathrm{transfer}}$ , which is the average of the exogenous style values of randomly selected samples with the desired style. As the flow model  $r_s$  is invertible, we can obtain the transferred style variable  $\mathbf{s}_{\mathrm{transfer}} = r_s^{-1}(\tilde{\mathbf{s}}_{\mathrm{transfer}}; \mathbf{c}, \mathbf{u})$ , which, together with the original content variable  $\mathbf{c}$ , generates the new sample  $\mathbf{x}_{\mathrm{transfer}} = g_{\mathrm{dec}}([\mathbf{c}, \mathbf{s}_{\mathrm{transfer}}])$ . This process is illustrated in Fig 3 using green arrows. We demonstrate the importance of preserving the content-style dependence and provide evidence that our approach can indeed fulfill this purpose (Fig 4).
We validate our theoretical findings by conducting experiments on multiple-domain sentiment transfer tasks, which require effective disentanglement of factors, a concept at the core of our identifiability theory.
Datasets and Evaluation Schema. The proposed method is trained on four-domain datasets (Tab 1), i.e., movie (Imdb) [Diao et al., 2014], restaurant (Yelp) [Li et al., 2018], e-commerce (Amazon) [Li et al., 2018] and news (Yahoo) [Zhang et al., 2015, Li et al., 2019].<sup>4</sup> From common practice [Yang et al., 2018, Lample et al., 2019], we evaluate the generated sentences in terms of the four automatic metrics: (1) Accuracy.
Table 1: Dataset on four domains.
Domains	Train	Dev	Test
IMDB	344,175	27,530	27,530
Yelp	444,102	63,484	1000
Amazon	554,998	2,000	1,000
Yahoo	4,000	4,000	4,000
We train a CNN classifier on the original style-labelled dataset, which has over  $95.0\%$  accuracy when evaluated on the four separate validation datasets. Subsequently, we employ it to evaluate the transformed sentences, gauging how effectively they convey the intended attributes. (2) BLEU [Papineni et al., 2002]. It compares the n-grams in the generated text with those in the original text, measuring how well the original content is retained<sup>5</sup>. (3) G-score. It represents the geometric mean of the predicted probability for the ground-truth style category and the BLEU score. Due to its comprehensive nature, it is our primary metric. (4) Fluency. It is the perplexity score of GPT-2 [Radford et al., 2019] – lower perplexity values indicate a higher levels of fluency. For human evaluation, we invited three evaluators proficient in English to rate the sentiment reverse, semantic preservation, fluency and overall transfer quality using a 5-point Likert scale, where higher scores signify better performance. Furthermore, they were asked to rank the generated sentences produced from different models, with the option to include tied items in their ranking.
6.1 Sentiment transfer
Baselines. We compare our model with the state-of-the-art text transfer models that do not rely on style labels, along with a supervised model, B-GST [Sudhakar et al., 2019], which is based on GPT2 [Radford et al., 2019] and accomplishes style transfer through a combination of deletion, retrieval, and generation. The other VAE-based baselines can be divided into two groups based on their architecture: those with LSTM backbones and those utilizing pretrained language models (PLM). Within the LSTM group,  $\beta$ -VAE [Higgins et al., 2017] encourages disentanglement by progressively increasing the latent code capacity. JointTrain [Li et al., 2022] uses the GloVe embedding to initialize s and learns c through LSTM. CPVAE [Xu et al., 2020] is the state-of-the-art unsupervised style transfer model, which maps the style variable to a  $k$ -dimensional probability simplex to model different style categories. In the PLM group, we use GPT2 [Radford et al., 2019] as the backbone and introduce an additional variational layer after fine-tuning its embedding layer to generate the latent variable z, referred to as GPT2-FT. Also, we consider Optimus [Li et al., 2020], which is one of the most widely-used pretrained VAE models, utilizing BERT [Devlin et al., 2019] as the encoder and GPT2 as the decoder.
Dataset and detailed experiment configurations can be found in Appendix, A.1.
We also adopt CTC score [Deng et al., 2021], to mitigate potential issues brought by the word-overlap measurements in BLEU, as it considers the matching embeddings. The evaluation results are shown in Table 9.
IMDB	Yelp
Model	Acc(↑)	BLEU(↑)	G-score(↑)	PPL(↓)	Acc(↑)	BLEU(↑)	G-score(↑)	PPL(↓)
B-GST [Sudhakar et al., 2019]	36.20 ± 0.80	50.45 ± 2.62	32.09 ± 1.81	48.58 ± 2.08	82.00 ± 0.20	32.06 ± 1.34	35.43 ± 0.92	50.45 ± 2.38
β-VAE [Higgins et al., 2017]	38.27 ± 1.03	11.37 ± 3.03	9.05 ± 1.19	43.59 ± 3.07	40.30 ± 0.92	7.58 ± 2.73	6.86 ± 1.08	59.34 ± 3.81
JointTrain [Li et al., 2022]	24.13 ± 0.52	23.26 ± 2.85	12.28 ± 1.91	70.11 ± 2.76	14.20 ± 0.62	31.72 ± 1.91	12.74 ± 0.95	84.07 ± 2.37
CPVAE [Xu et al., 2020]	20.15 ± 0.40	49.82 ± 1.25	20.01 ± 0.96	70.18 ± 2.78	14.50 ± 0.30	51.47 ± 1.81	16.84 ± 0.92	72.81 ± 2.26
GPT2-FT [Radford et al., 2019]	15.20 ± 0.25	28.93 ± 3.16	12.19 ± 2.84	71.08 ± 2.19	12.00 ± 0.42	39.62 ± 1.92	14.49 ± 1.35	78.37 ± 2.14
Optimus [Li et al., 2020]	14.07 ± 0.20	59.04 ± 1.68	17.47 ± 1.21	61.90 ± 2.61	13.60 ± 0.30	69.82 ± 1.92	21.24 ± 1.83	52.56 ± 2.01
MATTE	32.43 ± 0.28	45.10 ± 2.91	25.92 ± 1.62	50.08 ± 2.02	34.30 ± 0.26	50.14 ± 2.51	26.34 ± 1.37	51.51 ± 2.09
Amazon	Yahoo
Model	Acc(↑)	BLEU(↑)	G-score(↑)	PPL(↓)	Acc(↑)	BLEU(↑)	G-score(↑)	PPL(↓)
B-GST [Sudhakar et al., 2019]	60.45 ± 0.65	56.02 ± 2.36	47.67 ± 1.68	49.01 ± 3.18	84.30 ± 0.40	40.39 ± 2.81	38.65 ± 1.64	58.20 ± 2.19
β-VAE Higgins et al. [2017]	50.08 ± 0.68	8.04 ± 2.62	9.39 ± 1.24	33.09 ± 2.53	55.47 ± 0.40	3.77 ± 1.32	5.85 ± 1.71	52.17 ± 3.06
JointTrain Li et al. [2022]	32.90 ± 0.42	23.21 ± 2.16	18.33 ± 1.07	84.63 ± 2.76	35.33 ± 0.28	14.04 ± 1.72	11.62 ± 0.92	67.34 ± 2.84
CPVAE Xu et al. [2020]	32.60 ± 0.20	41.08 ± 1.28	30.08 ± 1.15	77.61 ± 3.12	43.92 ± 0.30	25.44 ± 1.37	20.28 ± 0.95	76.28 ± 2.67
GPT2-FT [Radford et al., 2019]	30.46 ± 0.30	40.34 ± 2.82	26.72 ± 1.93	79.36 ± 2.63	17.90 ± 0.40	44.19 ± 1.86	15.99 ± 1.11	70.99 ± 2.37
Optimus [Li et al., 2020]	24.80 ± 0.20	62.50 ± 1.55	28.53 ± 1.22	74.66 ± 3.10	27.10 ± 0.15	32.73 ± 1.82	19.17 ± 1.69	73.18 ± 2.76
MATTE	34.50 ± 0.24	52.25 ± 1.48	35.73 ± 1.14	63.37 ± 2.22	38.45 ± 0.20	42.40 ± 1.35	29.01 ± 2.30	56.12 ± 2.57
Quantitative performance. Among LSTM baselines in Table 2,  $\beta$ -VAE shows high sentiment transfer accuracy and fluency but poor content preservation. We observed that many generated sentences follow simple but repetitive patterns, e.g.,  $2.2\%$  transferred sentences in Yelp containing the phrase "I highly recommend" while only  $0.6\%$  original sentences do. They are fluent and correctly sentiment flipped but their semantics are significantly different from the original sentences, indicating a generation degradation problem<sup>6</sup>. CPVAE achieves an overall better G-Score than all the other baselines across three domains (except for Yelp). Compared with the other LTSM-based methods, its superiority in content preservation is pronounced. PLMs models achieve overall better BLEU scores compared with the LSTM group. Optimus outperforms GPT2-FT, which can be partly explained by the fact that the variational layer in Optimus has been pretrained on 1,990K Wikipedia sentences. Our model is built on top of CPVAE with the proposed causal influence modules and sparsity regularisations. It gains consistent improvements in G-score and fluency across all datasets over all the other unsupervised methods. Compared with the supervised method, despite a relatively large gap in accuracy due to the lack of supervision, our approach achieves comparable BLEU scores. The human evaluation results in Table 3 show that human annotators favour Optimus in terms of content preservation and fluency, but MATTE ranks the best-performing method with  $58.5\%$  support set, compared to  $41.00\%$  for Optimus.
Table 2: Comparison with unsupervised methods across four domain datasets with supervised B-GST as an upper bound reference. The top and the second-best results are in bold.
Style	Content	Fluency	Best rank(%)
CPVAE	1.30	2.78	3.20	21.50
Optimus	1.41	3.79	4.12	41.00
MATTE	1.99	2.91	3.53	58.50
Table 3: Human evaluation results from three annotators. The Cohen's Kappa coefficient among every two annotators over the Best-rank is 0.46. Human annotators favour Optimus in terms of content preservation and fluency, but MATTE ranks the best-performing method with more than  $58\%$  support set after considering the style reverse success rate.
Src1: This guy is an awful actor. . ×
CPVAE	The guy is very flavorful. ✓
Optimus	The guy is an amazing actor. ✓
MATTE	This guy is an amazing actor! ✓
Src2: I had it a long time now and I still love it. ✓
CPVAE	I had it a long time before and I've never eaten it. ×
Optimus	It is a long time now and I always get this food. ✓
MATTE	I had it a long time now and I never played it. ×
Src3 These come in handy with those tender special moments. ✓
CPVAE	These come in handy with those sexy care employees. ✓
Optimus	These are fateless in their only safe place. ×
MATTE	These come in handy with those poorly executed characteristics. ×
Table 4: Generated style-transferred Sentences.  $\checkmark$  ,  $X$  represent sentiment polarity.
Qualitative results. We randomly selected three sentences from the test sets and analyzed the results generated by the top-performing baselines in Table 4. For Src 1, although all the methods successfully transfer the original sentiment of the sentence, CPVAE generates the word 'flavourful' for the content guy, resulting in an unnatural sentence. This issue arises because CPVAE fails to identify the domain-specific content-style dependency, i.e., the Src domain is in IMDB, while the transferred sentence incorrectly uses the style word 'flavourful' which is commonly used in Yelp. While Optimus can generate relatively fluent sentences partly due to its powerful decoder, it hardly
$^{6}$ The diversity-  $n$  [Li et al., 2016] also indicates repetitious pattern and the evaluation results are in Table 10.
IMDB	Yelp
Model	Acc(↑)	BLEU(↑)	G-score(↑)	PPL(↓)	Acc(↑)	BLEU(↑)	G-score(↑)	PPL(↓)
Backbone	20.15	49.82	20.01	70.18	14.50	51.47	16.84	72.81
Indep [Kong et al., 2022]	45.00▲	30.88	19.89	61.85▲	61.90▲	25.67	21.24▲	73.78
CausalDep	28.71▲	39.63	21.85▲	53.25▲	22.10▲	48.98	25.98▲	55.14▲
:w./Lsparsity	21.55	56.59△	20.90	65.26	13.20	56.26△	14.59	54.10△
:w./Lpartial	30.18△	51.95	25.57△	54.66	33.70△	49.09	25.81△	52.87△
:w./Lc-mask(Full1)	32.43△	45.10	25.92△	50.08△	34.30△	50.14	26.34△	51.51△
maintains the original semantics (Src 2, 3), indicating a lack of effective disentanglement between c and s. These failure modes demonstrate the importance of a proper disentanglement of content and style and modelling the causal influence between the two across domains. Benefiting from theoretical insights, our approach manages to reflect the content influence across different domains in Src 1 and retain the content information in Src2, 3.
6.2 Ablation Study
Table 5: Ablation results on sentiment transfer on two domains. CausalDep incorporates style flow  $r_s$  to model dependency of c on s, while Indep assumes the independence between the two variables. ▲ marks the improvements overBackbone, while △ over the CausalDep.
This one does the job I need it for !
This one does the job i bought it for someone else on.	This one does the job i need it for kids ?
Overall i love them , and would probably buy them again .
Since i love them , and everything went through fine.	Overall i didn't want but would absolutely buy something else !
Thank heaven the operation is intuitive because there are no instructions .
They're very durable and carries an egg after every minute.	Thank you amazon very fast as they clearly makes opening up process .
Figure 4: Histograms of negative log-likelihood (NLL) of 1000 Amazon test samples evaluated on the original latent variable and intervened ones. left: flips s, right flips  $\tilde{\mathbf{s}}$ . The table shows the corresponding sentences.
Ablation studies in Table 5 are used to verify our theoretical results in  $\S 4^7$ . On top of the backbone, CPVAE, we incrementally add each component of our method: (1)Indep considers the domain influence on c (i.e., the  $r_c$  module in Fig 3), while neglecting the independence between c and s. It experiences a large accuracy boost in conjunction with a significant degradation in BLEU, suggesting poor retention of the content information. (2) CausalDep takes into account the dependency between content and style by incorporating the module  $r_s$  in Fig 3. This ameliorates the content retention problem and strikes an overall better balance, as reflected by the raised BLEU score and G-score, although causal dependence in CausalDep is not sufficient for identification without proper regularization. (3) After introducing the style sparsity regularization  $\mathcal{L}_{\mathrm{sparsity}}$  as specified in Theorem 1, we observe a significant increase of BLEU over CausalDep, verifying Theorem 1 that
the style influence sparsity facilitates content identification §4.1. (4) We further introduce  $\mathcal{L}_{\mathrm{partial}}$  inspired by Theorem 2, which controls the intersection of content and style influence supports. This improvement in style identification, i.e., the recovery of accuracy over  $\mathcal{L}_{\mathrm{sparsity}}$  corroborates Theorem 2. (5) The incorporation of  $\mathcal{L}_{\mathrm{c - mask}}$  arrive at our full model, which further improves the style identification, consistent with our motivation in § 5.3. It also exhibits the best G-score across all the datasets, with the most predominant improvement over CausalDep on the Yahoo dataset, where the G-score increases from  $21.39\%$  to  $29.01\%$ .
The importance of content-style dependence. We demonstrate the importance of content-style dependence by visualizing the changes in negative log-likelihood (NLL) induced by different ways of style intervention, namely flipping  $\tilde{\mathbf{s}}$  as in our method and flipping s which breach the content-style dependence. If the NLL increases after the style transfer, it indicates that the new variables are located in a lower density region [Zheng et al., 2022, Xu et al., 2020]. Fig 4 shows the histograms of NLLs for all the Amazon test samples, both before and after a style transfer. We can see that the NLL distribution changes negligibly when we flip  $\tilde{\mathbf{s}}$ , in contrast with the significant change caused by flipping s. This implies that flipping  $\tilde{\mathbf{s}}$  enables better preservation of the joint distribution of the
The results on Amazon and Yahoo are in Appendix, Table 8.
original sentence. The generated sentences resulting from flipping  $\tilde{\mathbf{s}}$  exhibit a higher level of semantic fidelity to the original sentence, with a clear inverse sentiment.
6.3 Comparison with large language model
As widely recognized, large language models (LLMs) have demonstrated an impressive capability in text generation. However, we consider the principles of counterfactual generation to be complementary to the development of LLMs. We aim to leverage our theoretical insights to further enhance the capabilities of LLMs. We provide examples in Table 6 where LLMs struggle with sentiment transfer, primarily due to their tendency to overlook the broader and implicit sentiments while accurately altering individual sentiment words. Consequently, it is reasonable to anticipate that LLMs could benefit from the principles of representation learning, as developed in our work.
Src: The buttons to extend the arms worked exactly one time before breaking.
ChatGPT-p1: The buttons to extend the arms failed to work from the beginning, never functioning even once.
ChatGPT-p2: The buttons to extend the arms never worked, even once, and remained functional until they broke.
Our: The buttons to extend the arms worked exactly as described.
Src: I love that it uses natural ingredients but it was ineffective on my skin.
ChatGPT-p1: I dislike that it uses natural ingredients, but it was highly effective on my skin.
ChatGPT-p2: I dislike that it uses natural ingredients, but it was highly effective on my skin.