|
| 1 | +# iScore |
| 2 | + |
| 3 | +[](https://github.com/AdamCoscia/iScore/blob/main/LICENSE) |
| 4 | +[](https://arxiv.org/abs/2403.04760) |
| 5 | +[](https://doi.org/10.1145/3640543.3645142) |
| 6 | + |
| 7 | +Upload, score, and visually compare multiple LLM-graded summaries simultaneously! |
| 8 | + |
| 9 | +✍️📜🧑🏫📖💯 |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | +## What is iScore? |
| 14 | + |
| 15 | +The popularity of large language models (LLMs) has inspired LLM developers to incorporate them into adaptive educational tools that can **automatically score a summary written on a larger body of text** in a variety of educational settings such as classrooms and textbooks. |
| 16 | +Interactively exploring how LLMs score different summaries can help developers understand the decisions on which the LLMs base their scores, discover unintended biases, update the LLMs to address the biases and mitigate the potential pedagogical ramifications of prematurely deploying untested LLM-powered educational technologies. |
| 17 | + |
| 18 | +iScore is an interactive visual analytics tool for developers to upload, score, and compare multiple summaries of a source text simultaneously. |
| 19 | +iScore introduces a new workflow for comparing the language features that contribute to different LLM scores: |
| 20 | + |
| 21 | +1. First, users **upload, score and can manually revise and re-score** multiple source/summary pairs simultaneously. |
| 22 | +2. Then, users can **visually track how scores change** across revisions in the context of expert-scored LLM training data. |
| 23 | +3. Finally, users can **compare model weights** between words across model layers, as well as differences in scores between automatically revised **summary perturbations**. |
| 24 | + |
| 25 | +Together, the views provide LLM developers with access to multiple summary comparison visualizations and several well-known LLM interpretability methods including attention attribution, input perturbation, and adversarial examples. |
| 26 | +Combining these visualizations and methods in a single visual interface broadly enables deeper analysis of LLM behavior that was previously **time-consuming** and **difficult to perform**. |
| 27 | + |
| 28 | +This code accompanies the research paper: |
| 29 | + |
| 30 | +**[iScore: Visual Analytics for Interpreting How Language Models Automatically Score Summaries][paper]** |
| 31 | +<span style="opacity: 70%">Adam Coscia, Langdon Holmes, Wesley Morris, Joon Suh Choi, Scott Crossley, Alex Endert</span> |
| 32 | +_ACM Conference on Intelligent User Interfaces (IUI), 2024_ |
| 33 | +| [📖 Paper][paper] | [▶️ Live Demo][demo] | [🎞️ Demo Video][video] | [🧑💻 Code][code] | |
| 34 | + |
| 35 | +## Features |
| 36 | + |
| 37 | +<details> |
| 38 | + <summary> 🔍 Track how scores change across revisions, in the context of expert-scored training data:</summary> |
| 39 | + <img src="https://github.com/AdamCoscia/iScore/blob/main/images/scores-dashboard.png" width="60%"> |
| 40 | +</details> |
| 41 | + |
| 42 | +<details> |
| 43 | + <summary> ✏️ Compare differences in scores between automatically revised summary perturbations:</summary> |
| 44 | + <img src="https://github.com/AdamCoscia/iScore/blob/main/images/input-perturbation.png" width="60%"> |
| 45 | +</details> |
| 46 | + |
| 47 | +<details> |
| 48 | + <summary> 📊 Analyze model weights between tokens across model layers:</summary> |
| 49 | + <img src="https://github.com/AdamCoscia/iScore/blob/main/images/token-attention.png" width="60%"> |
| 50 | +</details> |
| 51 | + |
| 52 | +### Demo Video |
| 53 | + |
| 54 | +🎞️ Watch the demo video for a full tutorial here: <https://youtu.be/EYJX-_fQPf0> |
| 55 | + |
| 56 | +## Live Demo |
| 57 | + |
| 58 | +🚀 For a live demo, visit: <https://adamcoscia.com/papers/iscore/demo/> |
| 59 | + |
| 60 | +## Getting Started |
| 61 | + |
| 62 | +🌱 You can test our visualizations on your own LLMs in just a few easy steps! |
| 63 | + |
| 64 | +- Install Python `v3.9.x` ([latest release](https://www.python.org/downloads/release/python-3913/)) |
| 65 | +- Clone this repo to your computer ([instructions](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository)) |
| 66 | + |
| 67 | +```bash |
| 68 | +git clone [email protected]:AdamCoscia/iScore.git |
| 69 | + |
| 70 | +# use --depth if you don't want to download the whole commit history |
| 71 | +git clone --depth 1 [email protected]:AdamCoscia/iScore.git |
| 72 | +``` |
| 73 | + |
| 74 | +### Interface |
| 75 | + |
| 76 | +- A frontend vanilla HTML/CSS/JavaScript web app with D3.js and Tabulator! |
| 77 | +- Additional details can be found in [interface/README.md](interface/README.md) |
| 78 | + |
| 79 | +Navigate to the interface folder: |
| 80 | + |
| 81 | +```bash |
| 82 | +cd interface |
| 83 | +``` |
| 84 | + |
| 85 | +- If you are running Windows: |
| 86 | + |
| 87 | +```bash |
| 88 | +py -3.9 -m http.server |
| 89 | +``` |
| 90 | + |
| 91 | +- If you are running MacOS / Linux: |
| 92 | + |
| 93 | +```bash |
| 94 | +python3.9 -m http.server |
| 95 | +``` |
| 96 | + |
| 97 | +Navigate to [localhost:8000](http://localhost:8000/). You should see iScore running in your browser :) |
| 98 | + |
| 99 | +### Server |
| 100 | + |
| 101 | +- A backend Python 3.9 Flask web app to run local LLM models downloaded from Hugging Face! |
| 102 | +- Additional details can be found in [server/README.md](server/README.md) |
| 103 | + |
| 104 | +Navigate to the server folder: |
| 105 | + |
| 106 | +```bash |
| 107 | +cd server |
| 108 | +``` |
| 109 | + |
| 110 | +Create a virtual environment: |
| 111 | + |
| 112 | +- If you are running Windows: |
| 113 | + |
| 114 | +```bash |
| 115 | +# Start a virtual environment |
| 116 | +py -3.9 -m venv venv |
| 117 | + |
| 118 | +# Activate the virtual environment |
| 119 | +.\venv\Scripts\activate |
| 120 | +``` |
| 121 | + |
| 122 | +- If you are running MacOS / Linux: |
| 123 | + |
| 124 | +```bash |
| 125 | +# Start a virtual environment |
| 126 | +python3.9 -m venv venv |
| 127 | + |
| 128 | +# Activate the virtual environment |
| 129 | +source venv/bin/activate |
| 130 | +``` |
| 131 | + |
| 132 | +Install dependencies: |
| 133 | + |
| 134 | +```bash |
| 135 | +python -m pip install -r requirements.txt |
| 136 | +``` |
| 137 | + |
| 138 | +Install symspellpy `v6.7.7` ([instructions](https://symspellpy.readthedocs.io/en/latest/users/installing.html)) |
| 139 | + |
| 140 | +> symspellpy is a Python port of SymSpell `v6.7.1` |
| 141 | +> **Warning for MacOS users** - symspellpy has only been tested on Windows and Linux systems and is assumed to work on macOS! |
| 142 | +
|
| 143 | +Install PyTorch `v2.0.x` ([instructions](https://pytorch.org/get-started/locally/)) |
| 144 | + |
| 145 | +> PyTorch is installed separately because some systems may support CUDA, which requires a different installation process and can significantly speed up the tool. |
| 146 | +
|
| 147 | +1. First, check if your GPU can support CUDA ([link](https://developer.nvidia.com/cuda-gpus)) |
| 148 | +2. Then, follow the instructions linked above to determine if your system can support CUDA for computation. |
| 149 | + |
| 150 | +Then run the server: |
| 151 | + |
| 152 | +```bash |
| 153 | +python main.py |
| 154 | +``` |
| 155 | + |
| 156 | +## Credits |
| 157 | + |
| 158 | +Led by <a href='https://adamcoscia.com/' target='_blank'>Adam Coscia</a>, iScore is a result of a collaboration between visualization experts in human centered computing and interaction design as well as learning engineers with expertise in natural language processing (NLP) and developing learning tools from |
| 159 | +<img src="https://adamcoscia.com/assets/icons/other/gt-logo.png" alt="Interlocking GT" height="21" style="vertical-align: bottom;"/> |
| 160 | +Georgia Tech, |
| 161 | +<img src="https://adamcoscia.com/assets/icons/other/vanderbilt-logo.svg" alt="Interlocking GT" height="21" style="vertical-align: bottom;"/> |
| 162 | +Vanderbilt, and |
| 163 | +<img src="https://adamcoscia.com/assets/icons/other/gsu-logo.jpg" alt="Interlocking GT" height="21" style="vertical-align: bottom;"/> |
| 164 | +Georgia State. |
| 165 | + |
| 166 | +iScore is created by |
| 167 | +<a href='https://adamcoscia.com/' target='_blank'>Adam Coscia</a>, |
| 168 | +Langdon Holmes, |
| 169 | +Wesley Morris, |
| 170 | +Joon Suh Choi, |
| 171 | +Scott Crossley, |
| 172 | +and |
| 173 | +Alex Endert. |
| 174 | + |
| 175 | +## Citation |
| 176 | + |
| 177 | +To learn more about iScore, please read our [research paper][paper] (published at [IUI '24](https://iui.acm.org/2024/)). |
| 178 | + |
| 179 | +```bibtex |
| 180 | +@inproceedings{Coscia:2024:iScore, |
| 181 | + author = {Coscia, Adam and Holmes, Langdon and Morris, Wesley and Choi, Joon S. and Crossley, Scott and Endert, Alex}, |
| 182 | + title = {iScore: Visual Analytics for Interpreting How Language Models Automatically Score Summaries}, |
| 183 | + year = {2024}, |
| 184 | + isbn = {979-8-4007-0508-3/24/03}, |
| 185 | + publisher = {Association for Computing Machinery}, |
| 186 | + address = {New York, NY, USA}, |
| 187 | + url = {https://doi.org/10.1145/3640543.3645142}, |
| 188 | + doi = {10.1145/3640543.3645142}, |
| 189 | + booktitle = {Proceedings of the 2024 IUI Conference on Intelligent User Interfaces}, |
| 190 | + location = {Greenville, SC, USA}, |
| 191 | + series = {IUI '24} |
| 192 | +} |
| 193 | +``` |
| 194 | + |
| 195 | +## License |
| 196 | + |
| 197 | +The software is available under the [MIT License](https://github.com/AdamCoscia/iScore/blob/main/LICENSE). |
| 198 | + |
| 199 | +## Contact |
| 200 | + |
| 201 | +If you have any questions, feel free to [open an issue](https://github.com/AdamCoscia/iScore/issues) or contact [Adam Coscia](https://adamcoscia.com). |
| 202 | + |
| 203 | +[paper]: https://arxiv.org/abs/2403.04760 |
| 204 | +[demo]: https://adamcoscia.com/papers/iscore/demo/ |
| 205 | +[video]: https://youtu.be/EYJX-_fQPf0 |
| 206 | +[code]: https://github.com/AdamCoscia/iScore |
0 commit comments