Can Large Language Models (or Humans) Disentangle Text?

Authors: Nicolas Audinet de Pieuchon | Adel Daoud | Connor Jerzak | Moa Johansson | Richard Johansson

Paper Video Code Data .bib

Listen to Paper
Listen to paper 17:36

Removing an “undesired” variable from text (like sentiment, sensitive demographic features, or personal info) sounds simple: rewrite the text so the signal disappears, while keeping everything else intact. This paper tests that idea head-on—and finds that both LLMs and humans struggle to truly remove the target signal from raw text, even when the rewrite looks neutral.

TL;DR

  • LLM rewrites don’t fully erase sentiment: classifiers can still detect it well above chance.
  • Humans also struggle: careful manual edits leave detectable traces too.
  • Representation-level methods can work (near-chance sentiment detection) but are less interpretable at the text level.
  • Key lesson: some concepts (like sentiment in reviews) may be deeply intertwined with “what the text is about.”

Paper: Can Large Language Models (or Humans) Disentangle Text?
Video: Watch the talk / presentation
Replication: GitHub.com/AIandGlobalDevelopmentLab/TextDisentanglement
Data: doi.org/10.7910/DVN/TEC1ZP

What is text disentanglement?

Text disentanglement means rewriting text so that a “forbidden” variable is no longer detectable while keeping the rest of the meaning intact. Formally, it aims for a transformation where the rewritten text no longer statistically reveals the target variable: d(W) \perp Z.

  • Why it matters in computational social science: text can be “contaminated” by variables that cause bias, privacy risk, or post-treatment issues in causal inference.
  • Common targets: sentiment, demographics, domain markers, personal information, political slant, or protected attributes.
  • The catch: you can always remove the signal by deleting everything—but that destroys usefulness. The real challenge is being “minimally intrusive.”

Mini TL;DR: The goal isn’t “rewrite to sound neutral.” It’s “rewrite so the target variable can’t be predicted, without harming the other signals you care about.”

What did the study test?

This study tests whether out-of-the-box LLM prompting can remove sentiment from product reviews while preserving topic information. It also compares LLM performance against a human editing baseline and a representation-level removal method.

Dataset (a “hard mode” setup)

  • 2,000 Amazon reviews with binary sentiment labels (positive/negative) and topic labels.
  • Topics: book, music, camera, health, DVD, software.
  • Why sentiment? In reviews, sentiment is often spread throughout the text—not localized—making it difficult to remove cleanly.

Models and prompting strategies

  • Mistral 7B (instruction-tuned v0.2)
  • GPT-4 (API model referenced as “gpt-4-0125-preview” in the paper)
  • Prompts tested:
    • Paraphrase (control): rewrite without changing meaning
    • Few-shot: include examples of neutral rewrites
    • Prompt chaining: (1) identify sentiment-bearing spans, (2) rewrite removing them

Baselines

  • Humans doing prompt-chaining style editing (identify sentiment spans, then rewrite neutrally).
  • Mean projection (representation-level): remove sentiment signal from embeddings (interpretable? no—effective? often yes).

How was “sentiment removal” evaluated?

The key test is simple: if sentiment is truly removed, a classifier should do near-chance at predicting sentiment from the rewritten text. If detection stays high, the “neutral” rewrite still leaks sentiment statistically.

  • Two prediction targets: sentiment (should drop) and topic (should stay high if meaning is preserved).
  • Classifiers: logistic regression on document embeddings.
  • Embeddings: DistilBERT token embeddings averaged over the document.
  • Validation: 80/20 split, 500 bootstrap samples, 95% confidence intervals.

Interpretation tip: “Sounds neutral to a person” is not the bar. The bar is “can a model still predict the forbidden variable?”

Did LLMs (or humans) successfully disentangle sentiment from text?

Mostly no: even the best LLM setting still leaves sentiment highly detectable. GPT-4 with prompt chaining reduces sentiment predictability the most, but remains far above chance—while topic predictability largely stays strong.

Key results (accuracy; lower is better for sentiment, higher is better for topic)
Setting Prompt Sentiment accuracy (↓) Topic accuracy (↑)
No disentanglement — 0.885 ± 0.035 0.946 ± 0.026
Mean projection (repr-level) — 0.524 ± 0.054 0.946 ± 0.026
Human (subset) Prompt chaining 0.800 ± 0.145 0.842 ± 0.165
Mistral 7B Paraphrase 0.891 ± 0.037 0.951 ± 0.024
Mistral 7B Few-shot 0.877 ± 0.023 0.951 ± 0.015
Mistral 7B Prompt chaining 0.841 ± 0.039 0.953 ± 0.023
GPT-4 Paraphrase 0.899 ± 0.034 0.951 ± 0.024
GPT-4 Few-shot 0.824 ± 0.045 0.955 ± 0.024
GPT-4 Prompt chaining 0.757 ± 0.044 0.945 ± 0.023

Note: Human results are reported on a smaller subset (152 reviews) than the 2,000-review automated evaluations.

Bottom line: Prompting helps a bit, but doesn’t solve the core problem. You can make the text look neutral while still leaving enough statistical signal for a classifier to recover sentiment.

Why is sentiment so hard to erase from reviews?

In product reviews, sentiment often isn’t a single “opinion sentence”—it’s woven into what facts are mentioned, which adjectives are chosen, what gets emphasized, and what gets omitted. That entanglement makes it difficult to remove sentiment without also changing meaning.

  • Factual selection leaks sentiment: “It slowed my computer” is a performance claim that implies dissatisfaction, even if rewritten politely.
  • Local edits don’t remove global framing: removing “I hate it” may still leave “I’m returning it,” which is a strong sentiment proxy.
  • Some variables aren’t separable: the same words carry both content and sentiment in many domains.

Text-level rewriting vs representation-level erasure: what’s the takeaway?

If you need truly low detectability of a forbidden variable, representation-level methods can be much stronger than text-level edits. But if you need interpretability and human-readable outputs, text-level editing is appealing—even if it may not deliver full removal.

Use text-level rewriting when…

  • You need edits humans can read and audit.
  • You’re targeting localized variables (e.g., names, addresses) that can be surgically removed.
  • You can tolerate incomplete removal and want “risk reduction,” not “guaranteed elimination.”

Use representation-level methods when…

  • You need the forbidden signal to be close to chance detectability downstream.
  • You can work in embedding space and accept reduced interpretability.
  • You have (or can afford) labels for the forbidden variable to train/fit the removal method.

Practical guidance: “Neutral rewrite” is not a privacy/fairness guarantee. Treat it as a usability technique, not a security boundary.

A practical checklist: how to test disentanglement in your own project

The fastest way to avoid false confidence is to evaluate disentanglement the same way this paper does: try to predict the forbidden variable from the transformed output. If predictability remains high, you haven’t removed the signal—no matter how neutral it reads.

  1. Pick a forbidden variable (e.g., sentiment, demographics, identity markers).
  2. Define what must be preserved (topic, factual content, task labels, readability).
  3. Apply a text transform (LLM prompts, editing rules, or hybrid pipelines).
  4. Run two classifiers: one for the forbidden variable (should drop), one for preserved signals (should remain).
  5. Check for “leaky proxies” (return intent, rating clues, comparative language, hedges).
  6. Document limitations so stakeholders don’t mistake “neutral tone” for “no residual signal.”

FAQ

Does “neutral rewriting” remove bias or sensitive information?

Not reliably. A rewrite can look neutral to humans while still preserving statistical signals that models can detect, especially for concepts that are spread throughout the text.

What is a “forbidden variable” in this context?

It’s a variable you want your analysis or model to ignore (or be independent of), such as sentiment, demographics, domain, or personal data—often for fairness, privacy, or causal validity.

Why did the authors choose sentiment as the forbidden variable?

Because sentiment in reviews is often distributed across the entire text, making it a strong (hard) test of whether disentanglement is actually possible at the raw text level.

Did any method get close to “chance” sentiment detection?

Yes: the representation-level mean projection baseline brought sentiment accuracy close to chance (about 0.52) while preserving topic accuracy—suggesting removal is possible in embedding space even if it’s hard in raw text.

Which LLM strategy worked best in the paper?

Prompt chaining worked best for GPT-4: first identify sentiment-bearing spans, then rewrite while removing those spans. It lowered sentiment detectability the most, but still not near chance.

What should practitioners do differently after reading this?

Treat text rewriting as a partial mitigation, not a guarantee. Always run a detection test (classifier or adversary) to measure residual signal, and consider representation-level methods when strict removal is required.

–

–

References

Nicolas Audinet de Pieuchon, Adel Daoud, Connor T. Jerzak, Moa Johansson, Richard Johansson. Can Large Language Models (or Humans) Disentangle Text?. Proceedings of the Sixth Workshop on Natural Language Processing and Computational Social Science (NLP+ CSS 2024): 57-67, 2024.
@article{pieuchon2024can,
  title={Can Large Language Models (or Humans) Disentangle Text?},
  author={Pieuchon, Nicolas Audinet de and Adel Daoud and Connor T. Jerzak and Moa Johansson and Richard Johansson},
  journal={Proceedings of the Sixth Workshop on Natural Language Processing and Computational Social Science (NLP+ CSS 2024)},
  year={2024},
  pages={57--67},
  publisher={}
}
[Data][Code][Slides][>]

–

Related Work

Brian Libgober, Connor T. Jerzak. Linking Datasets on Organizations Using Half-a-Billion Open-Collaborated Records. Political Science Methods and Research: 1-20, 2024.
@article{libgober2024linking,
  title={Linking Datasets on Organizations Using Half-a-Billion Open-Collaborated Records},
  author={Libgober, Brian and Connor T. Jerzak},
  journal={Political Science Methods and Research},
  year={2024},
  pages={1-20},
  publisher={}
}
[Overview][Data][Code][>]

Connor T. Jerzak, Gary King, Anton Strezhnev. An Improved Method of Automated Nonparametric Content Analysis for Social Science. Political Analysis, 31(1): 42-58, 2023.
@article{jerzak2023improved,
  title={An Improved Method of Automated Nonparametric Content Analysis for Social Science},
  author={Jerzak, Connor T. and Gary King and Anton Strezhnev},
  journal={Political Analysis},
  year={2023},
  volume={31},
  number={1},
  pages={42-58},
  publisher={}
}
[Overview][Data][Code][>]

Nicolas Audinet de Pieuchon, Adel Daoud, Connor T. Jerzak, Moa Johansson, Richard Johansson. Benchmarking Debiasing Methods for LLM-based Parameter Estimates. Proceedings of the 2025 Conference on Empirical Methods in National Language Processing (EMNLP), 2025.
@article{nicolas audinet de pieuchon 2025benchmarking,
  title={Benchmarking Debiasing Methods for LLM-based Parameter Estimates},
  author={Nicolas Audinet de Pieuchon and Adel Daoud and Connor T. Jerzak and Moa Johansson and Richard Johansson},
  journal={Proceedings of the 2025 Conference on Empirical Methods in National Language Processing (EMNLP)},
  year={2025},
  volume={},
  pages={},
  publisher={},
  doi={}
}
[Overview][Data][>]

Adel Daoud, Connor T. Jerzak, Richard Johansson. Conceptualizing Treatment Leakage in Text-based Causal Inference. Proceedings of the Annual Conference of the North American Chapter of the Association for Computational Linguistics (NAACL): 5638-5645, 2022.
@article{daoud2022conceptualizing,
  title={Conceptualizing Treatment Leakage in Text-based Causal Inference},
  author={Daoud, Adel and Connor T. Jerzak and Richard Johansson},
  journal={Proceedings of the Annual Conference of the North American Chapter of the Association for Computational Linguistics (NAACL)},
  year={2022},
  volume={},
  pages={5638--5645},
  publisher={Association for Computational Linguistics},
  doi={10.18653/v1/2022.naacl-main.413}
}
[Overview][Video][>]

–

Back to Research
Back to Home