| title = "<h1 class='demo-title'>π Plausibility Evaluation of Context Reliance (PECoRe) π</h1>" | |
| subtitle = "<h2 class='demo-subtitle'>An Interpretability Framework to Detect and Attribute Context Reliance in Language Models</h2>" | |
| description = """ | |
| Given a query and a context passed as inputs to a LM, PECoRe will identify which tokens in the generated | |
| response were dependant on context, and match them with context tokens contributing to their prediction. | |
| For more information, check out our <a href="https://openreview.net/forum?id=XTHfNGI3zT" target='_blank'>ICLR 2024 paper</a>. | |
| """ | |
| how_it_works = r""" | |
| <details> | |
| <summary><h3 class="summary-label">βοΈ How Does It Work?</h3></summary> | |
| <br/> | |
| PECoRe uses a contrastive approach to attribute context reliance in language models. | |
| It compares the model's predictions when the context is present and when it is absent, and attributes the difference in predictions to the context tokens. | |
| </details> | |
| """ | |
| how_to_use = r""" | |
| <details> | |
| <summary><h3 class="summary-label">π§ How to Use PECoRe</h3></summary> | |
| </details> | |
| """ | |
| citation = r""" | |
| <details> | |
| <summary><h3 class="summary-label">π Citing PECoRe</h3></summary> | |
| <p>To refer to the PECoRe framework for context usage detection, cite:</p> | |
| <div class="code_wrap"><button class="copy_code_button" title="copy"> | |
| <span class="copy-text"><svg viewBox="0 0 32 32" height="100%" width="100%" xmlns="http://www.w3.org/2000/svg"><path d="M28 10v18H10V10h18m0-2H10a2 2 0 0 0-2 2v18a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2Z" fill="currentColor"></path><path d="M4 18H2V4a2 2 0 0 1 2-2h14v2H4Z" fill="currentColor"></path></svg></span> | |
| <span class="check"><svg stroke-linejoin="round" stroke-linecap="round" stroke-width="3" stroke="currentColor" fill="none" viewBox="0 0 24 24" height="100%" width="100%" xmlns="http://www.w3.org/2000/svg"><polyline points="20 6 9 17 4 12"></polyline></svg></span> | |
| </button><pre><code> | |
| @inproceedings{sarti-etal-2023-quantifying, | |
| title = "Quantifying the Plausibility of Context Reliance in Neural Machine Translation", | |
| author = "Sarti, Gabriele and | |
| Chrupa{\l}a, Grzegorz and | |
| Nissim, Malvina and | |
| Bisazza, Arianna", | |
| booktitle = "The Twelfth International Conference on Learning Representations (ICLR 2024)", | |
| month = may, | |
| year = "2024", | |
| address = "Vienna, Austria", | |
| publisher = "OpenReview", | |
| url = "https://openreview.net/forum?id=XTHfNGI3zT" | |
| } | |
| </code></pre></div> | |
| If you use the Inseq implementation of PECoRe (<a href="https://inseq.org/en/latest/main_classes/cli.html#attribute-context"><code>inseq attribute-context</code></a>), please also cite: | |
| <div class="code_wrap"><button class="copy_code_button" title="copy"> | |
| <span class="copy-text"><svg viewBox="0 0 32 32" height="100%" width="100%" xmlns="http://www.w3.org/2000/svg"><path d="M28 10v18H10V10h18m0-2H10a2 2 0 0 0-2 2v18a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2Z" fill="currentColor"></path><path d="M4 18H2V4a2 2 0 0 1 2-2h14v2H4Z" fill="currentColor"></path></svg></span> | |
| <span class="check"><svg stroke-linejoin="round" stroke-linecap="round" stroke-width="3" stroke="currentColor" fill="none" viewBox="0 0 24 24" height="100%" width="100%" xmlns="http://www.w3.org/2000/svg"><polyline points="20 6 9 17 4 12"></polyline></svg></span> | |
| </button><pre><code> | |
| @inproceedings{sarti-etal-2023-inseq, | |
| title = "Inseq: An Interpretability Toolkit for Sequence Generation Models", | |
| author = "Sarti, Gabriele and | |
| Feldhus, Nils and | |
| Sickert, Ludwig and | |
| van der Wal, Oskar and | |
| Nissim, Malvina and | |
| Bisazza, Arianna", | |
| booktitle = "Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 3: System Demonstrations)", | |
| month = jul, | |
| year = "2023", | |
| address = "Toronto, Canada", | |
| publisher = "Association for Computational Linguistics", | |
| url = "https://aclanthology.org/2023.acl-demo.40", | |
| pages = "421--435", | |
| } | |
| </code></pre></div> | |
| </details> | |
| """ | |
| examples = [ | |
| [ | |
| "When was Banff National Park established?", | |
| "Banff National Park is Canada's oldest national park, established in 1885 as Rocky Mountains Park. Located in Alberta's Rocky Mountains, 110-180 kilometres (68-112 mi) west of Calgary, Banff encompasses 6,641 square kilometres (2,564 sq mi) of mountainous terrain.", | |
| ] | |
| ] | |