Skip to content
/ GP-TSM Public

GP-TSM: An AI-Resilient Text Rendering Technique for Reading and Skimming Documents

License

Notifications You must be signed in to change notification settings

ZiweiGu/GP-TSM

Repository files navigation

Grammar-Preserving Text Saliency Modulation (GP-TSM)

An AI-Resilient Text Rendering Technique for Reading and Skimming Documents
Ziwei Gu, Ian Arawjo, Kenneth Li, Jonathan K. Kummerfeld, Elena L. Glassman
In the 2024 ACM CHI conference on Human Factors in Computing Systems
CHI ’24, May 11–16, 2024, Honolulu, HI, USA

GP-TSM is an LLM-powered text rendering technique that supports reading and skimming by reifying recursive sentence compression in text saliency. Readers can skip over de-emphasized segments without compromising their reading flow/ comprehension of the text, while still being able to notice and recover from AI suggestions they disagree with.

Citation

@inproceedings{10.1145/3613904.3642699,
author = {Gu, Ziwei and Arawjo, Ian and Li, Kenneth and Kummerfeld, Jonathan K. and Glassman, Elena L.},
title = {An AI-Resilient Text Rendering Technique for Reading and Skimming Documents},
year = {2024},
isbn = {9798400703300},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/3613904.3642699},
doi = {10.1145/3613904.3642699},
booktitle = {Proceedings of the CHI Conference on Human Factors in Computing Systems},
articleno = {898},
numpages = {22},
keywords = {human-AI interaction, natural language processing, text visualization},
location = {<conf-loc>, <city>Honolulu</city>, <state>HI</state>, <country>USA</country>, </conf-loc>},
series = {CHI '24}
}

teaser figure In this example we show what it looks like when GP-TSM is applied to two paragraphs of text from GRE (The Graduate Record Examinations) Practice Exams. GP-TSM uses an LLM-based recursive sentence compression method to identify successive levels of detail beyond the core meaning of a passage, which are de-emphasized by rendering words with successively lighter but still legible gray text.

Installation

Clone the repository:

git clone https://github.com/ZiweiGu/GP-TSM

Then, set up the virtual environment (called venv) using virtualenv (installation here):


virtualenv -p python3 venv 

Activate the virtual environment:


source venv/bin/activate

Install necessary packages:


pip install -r requirements.txt

Usage

Run the app (in development mode) with:

python3 app.py

For backend only, use the get_shortened_paragraph(orig_paragraph, k) function in llm.py or gptsm-lite.py. The latter is an alternative of the original GP-TSM algorithm that runs faster, and is designed for applications that require a high level of responsiveness or interactivity. It achieves higher speed by using smaller values for N and MAX_DEPTH and removing grammaticality from evaluation, which is a time-consuming metric to compute. However, this may mean that the key grammar-preserving feature can be violated at times. To achieve the best output quality, please use the original version in llm.py.

Researchers

Name Affiliation
Ziwei Gu Harvard University
Ian Arawjo Harvard University
Kenneth Li Harvard University
Jonathan K. Kummerfeld University of Sydney
Elena L. Glassman Harvard University

License

See LICENSE.md.

About

GP-TSM: An AI-Resilient Text Rendering Technique for Reading and Skimming Documents

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published