Commit de8c60a9 authored by Delvallez Delvallez's avatar Delvallez Delvallez

Refs complétées + ques corrections

parent 21071dab
@inproceedings{parry_mechir_2025,
series = {Lecture {Notes} in {Computer} {Science}},
title = {{MechIR}: {A} {Mechanistic} {Interpretability} {Framework} for {Information} {Retrieval}},
volume = {15576},
url = {https://doi.org/10.1007/978-3-031-88720-8\_16},
doi = {10.1007/978-3-031-88720-8_16},
booktitle = {Advances in {Information} {Retrieval} - 47th {European} {Conference} on {Information} {Retrieval}, {ECIR} 2025, {Lucca}, {Italy}, {April} 6-10, 2025, {Proceedings}, {Part} {V}},
publisher = {Springer},
author = {Parry, Andrew and Chen, Catherine and Eickhoff, Carsten and MacAvaney, Sean},
year = {2025},
pages = {89--95},
}
@article{lewis_retrieval-augmented_2020,
title = {Retrieval-{Augmented} {Generation} for {Knowledge}-{Intensive} {NLP} {Tasks}},
journal = {arXiv: Computation and Language},
author = {Lewis, Patrick and Perez, Ethan and Piktus, Aleksandra and Petroni, Fabio and Karpukhin, Vladimir and Goyal, Naman and Küttler, Heinrich and Lewis, Mike and Yih, Wen-tau and Rocktäschel, Tim and Riedel, Sebastian and Kiela, Douwe},
year = {2020},
}
@misc{fan_survey_2024,
title = {A {Survey} on {RAG} {Meeting} {LLMs}: {Towards} {Retrieval}-{Augmented} {Large} {Language} {Models}},
shorttitle = {A {Survey} on {RAG} {Meeting} {LLMs}},
url = {http://arxiv.org/abs/2405.06211},
doi = {10.48550/arXiv.2405.06211},
abstract = {As one of the most advanced techniques in AI, Retrieval-Augmented Generation (RAG) can offer reliable and up-to-date external knowledge, providing huge convenience for numerous tasks. Particularly in the era of AI-Generated Content (AIGC), the powerful capacity of retrieval in providing additional knowledge enables RAG to assist existing generative AI in producing high-quality outputs. Recently, Large Language Models (LLMs) have demonstrated revolutionary abilities in language understanding and generation, while still facing inherent limitations, such as hallucinations and out-of-date internal knowledge. Given the powerful abilities of RAG in providing the latest and helpful auxiliary information, Retrieval-Augmented Large Language Models (RA-LLMs) have emerged to harness external and authoritative knowledge bases, rather than solely relying on the model's internal knowledge, to augment the generation quality of LLMs. In this survey, we comprehensively review existing research studies in RA-LLMs, covering three primary technical perspectives: architectures, training strategies, and applications. As the preliminary knowledge, we briefly introduce the foundations and recent advances of LLMs. Then, to illustrate the practical significance of RAG for LLMs, we systematically review mainstream relevant work by their architectures, training strategies, and application areas, detailing specifically the challenges of each and the corresponding capabilities of RA-LLMs. Finally, to deliver deeper insights, we discuss current limitations and several promising directions for future research. Updated information about this survey can be found at https://advanced-recommender-systems.github.io/RAG-Meets-LLMs/},
urldate = {2026-01-09},
publisher = {arXiv},
author = {Fan, Wenqi and Ding, Yujuan and Ning, Liangbo and Wang, Shijie and Li, Hengyun and Yin, Dawei and Chua, Tat-Seng and Li, Qing},
month = jun,
year = {2024},
note = {arXiv:2405.06211},
keywords = {Computer Science - Artificial Intelligence, Computer Science - Computation and Language, Computer Science - Information Retrieval},
}
@inproceedings{tran_retrieval_2024,
address = {Hong Kong China},
title = {Retrieval {Augmented} {Generation} for {Historical} {Newspapers}},
isbn = {9798400710933},
url = {https://dl.acm.org/doi/10.1145/3677389.3702542},
doi = {10.1145/3677389.3702542},
language = {en},
urldate = {2026-05-21},
booktitle = {Proceedings of the 24th {ACM}/{IEEE} {Joint} {Conference} on {Digital} {Libraries}},
publisher = {ACM},
author = {Tran, The Trung and González-Gallardo, Carlos-Emiliano and Doucet, Antoine},
month = dec,
year = {2024},
pages = {1--5},
}
@inproceedings{bell_its_2022,
address = {Seoul Republic of Korea},
title = {It’s {Just} {Not} {That} {Simple}: {An} {Empirical} {Study} of the {Accuracy}-{Explainability} {Trade}-off in {Machine} {Learning} for {Public} {Policy}},
isbn = {9781450393522},
shorttitle = {It’s {Just} {Not} {That} {Simple}},
url = {https://dl.acm.org/doi/10.1145/3531146.3533090},
doi = {10.1145/3531146.3533090},
language = {en},
urldate = {2025-09-11},
booktitle = {2022 {ACM} {Conference} on {Fairness} {Accountability} and {Transparency}},
publisher = {ACM},
author = {Bell, Andrew and Solano-Kamaiko, Ian and Nov, Oded and Stoyanovich, Julia},
month = jun,
year = {2022},
pages = {248--266},
}
@inproceedings{chen_axiomatic_2024,
address = {Washington DC USA},
title = {Axiomatic {Causal} {Interventions} for {Reverse} {Engineering} {Relevance} {Computation} in {Neural} {Retrieval} {Models}},
isbn = {9798400704314},
url = {https://dl.acm.org/doi/10.1145/3626772.3657841},
doi = {10.1145/3626772.3657841},
language = {en},
urldate = {2026-05-21},
booktitle = {Proceedings of the 47th {International} {ACM} {SIGIR} {Conference} on {Research} and {Development} in {Information} {Retrieval}},
publisher = {ACM},
author = {Chen, Catherine and Merullo, Jack and Eickhoff, Carsten},
month = jul,
year = {2024},
pages = {1401--1410},
}
@inproceedings{garouani_investigating_2024,
title = {Investigating the {Duality} of {Interpretability} and {Explainability} in {Machine} {Learning}},
url = {http://arxiv.org/abs/2503.21356},
doi = {10.1109/ICTAI62512.2024.00125},
abstract = {The rapid evolution of machine learning (ML) has led to the widespread adoption of complex "black box" models, such as deep neural networks and ensemble methods. These models exhibit exceptional predictive performance, making them invaluable for critical decision-making across diverse domains within society. However, their inherently opaque nature raises concerns about transparency and interpretability, making them untrustworthy decision support systems. To alleviate such a barrier to high-stakes adoption, research community focus has been on developing methods to explain black box models as a means to address the challenges they pose. Efforts are focused on explaining these models instead of developing ones that are inherently interpretable. Designing inherently interpretable models from the outset, however, can pave the path towards responsible and beneficial applications in the field of ML. In this position paper, we clarify the chasm between explaining black boxes and adopting inherently interpretable models. We emphasize the imperative need for model interpretability and, following the purpose of attaining better (i.e., more effective or efficient w.r.t. predictive performance) and trustworthy predictors, provide an experimental evaluation of latest hybrid learning methods that integrates symbolic knowledge into neural network predictors. We demonstrate how interpretable hybrid models could potentially supplant black box ones in different domains.},
urldate = {2025-08-21},
booktitle = {2024 {IEEE} 36th {International} {Conference} on {Tools} with {Artificial} {Intelligence} ({ICTAI})},
author = {Garouani, Moncef and Mothe, Josiane and Barhrhouj, Ayah and Aligon, Julien},
month = oct,
year = {2024},
note = {arXiv:2503.21356 [cs]},
keywords = {Computer Science - Artificial Intelligence, Computer Science - Machine Learning},
pages = {861--867},
}
@misc{wang_text_2022,
title = {Text {Embeddings} by {Weakly}-{Supervised} {Contrastive} {Pre}-training},
url = {https://arxiv.org/abs/2212.03533v2},
abstract = {This paper presents E5, a family of state-of-the-art text embeddings that transfer well to a wide range of tasks. The model is trained in a contrastive manner with weak supervision signals from our curated large-scale text pair dataset (called CCPairs). E5 can be readily used as a general-purpose embedding model for any tasks requiring a single-vector representation of texts such as retrieval, clustering, and classification, achieving strong performance in both zero-shot and fine-tuned settings. We conduct extensive evaluations on 56 datasets from the BEIR and MTEB benchmarks. For zero-shot settings, E5 is the first model that outperforms the strong BM25 baseline on the BEIR retrieval benchmark without using any labeled data. When fine-tuned, E5 obtains the best results on the MTEB benchmark, beating existing embedding models with 40x more parameters.},
language = {en},
urldate = {2026-05-20},
author = {Wang, Liang and Yang, Nan and Huang, Xiaolong and Jiao, Binxing and Yang, Linjun and Jiang, Daxin and Majumder, Rangan and Wei, Furu},
month = dec,
year = {2022},
}
@misc{touvron_llama_2023,
title = {{LLaMA}: {Open} and {Efficient} {Foundation} {Language} {Models}},
shorttitle = {{LLaMA}},
url = {http://arxiv.org/abs/2302.13971},
doi = {10.48550/arXiv.2302.13971},
abstract = {We introduce LLaMA, a collection of foundation language models ranging from 7B to 65B parameters. We train our models on trillions of tokens, and show that it is possible to train state-of-the-art models using publicly available datasets exclusively, without resorting to proprietary and inaccessible datasets. In particular, LLaMA-13B outperforms GPT-3 (175B) on most benchmarks, and LLaMA-65B is competitive with the best models, Chinchilla-70B and PaLM-540B. We release all our models to the research community.},
urldate = {2025-12-18},
publisher = {arXiv},
author = {Touvron, Hugo and Lavril, Thibaut and Izacard, Gautier and Martinet, Xavier and Lachaux, Marie-Anne and Lacroix, Timothée and Rozière, Baptiste and Goyal, Naman and Hambro, Eric and Azhar, Faisal and Rodriguez, Aurelien and Joulin, Armand and Grave, Edouard and Lample, Guillaume},
month = feb,
year = {2023},
note = {arXiv:2302.13971},
keywords = {Computer Science - Computation and Language},
}
\ No newline at end of file
--- ---
title: "Mechanistic interpretability for enhancing RAG models" title: "Mechanistic interpretability for enhancing RAG models"
author: Marine Delvallez
format: format:
revealjs: revealjs:
toc: true toc: true
...@@ -7,6 +8,7 @@ format: ...@@ -7,6 +8,7 @@ format:
slide-level: 3 slide-level: 3
mouse-wheel: true mouse-wheel: true
jupyter : python3 jupyter : python3
bibliography: biblio.bib
style: | style: |
.columns { .columns {
display: grid; display: grid;
...@@ -25,28 +27,24 @@ style: | ...@@ -25,28 +27,24 @@ style: |
### Retrieval Augmented Generation - Definition ### Retrieval Augmented Generation - Definition
![Simple RAG Architecture](images/DefRAG.drawio.png) ![Simple RAG Architecture [@lewis_retrieval-augmented_2020]](images/DefRAG.drawio.png)
![Advanced RAG Achitecture](images/DefRAGAvance_integration.drawio.png) . . .
![Advanced RAG Achitecture [@fan_survey_2024]](images/DefRAGAvance_integration.drawio.png)
### Approche plus théorique de retriever et generateur
_Retriever comme plongement des documents et questions dans un espace_ ### Example {.center}
_Generateur comme fonction d'une paire (question, ensemble de documents) vers texte_ ![RAG Architecture used here (inspired from [@tran_retrieval_2024])](images/RAGHN-perso.drawio.png)
### Example
![RAG Architecture used here](images/RAGHN-perso.drawio.png)
## Explainability in Artificial Intelligence ## Explainability in Artificial Intelligence
### Explainability in Artificial Intelligence ### Explainability in Artificial Intelligence
Aims: _Open black box models_
#### Aims
- Trustability - Trustability
- Understandability - Understandability
...@@ -56,7 +54,7 @@ Aims: ...@@ -56,7 +54,7 @@ Aims:
**XAI** : Make model's behavior understandable for human [@bell_its_2022] **XAI** : Make model's behavior understandable for human [@bell_its_2022]
**Understand** : Predict model's behavior [@bell_its_2022] **Understand** : Predict model's behavior [@bell_its_2022]
**Explanation** : Any way to make decision process understandable for human **Explanation** : Any way to make the decision process of the model understandable for human
:::: {.columns} :::: {.columns}
...@@ -73,18 +71,18 @@ _Why ?_ ...@@ -73,18 +71,18 @@ _Why ?_
:::: ::::
## Explanation through creation of a model ### Explanation through creation of a model
![Explanation through creation of a model](images/VieModele-TempsXAI.drawio.png) ![Explanation through creation of a model](images/VieModele-TempsXAI.drawio.png)
## MechIR [@parry_mechir_2025] ## Presentation of MechIR
### MechIR [@parry_mechir_2025] ### MechIR
#### Mechanistic interpretability #### Mechanistic interpretability
Understand the internal mechanisms of neural networks by **performing causal interventions** on specific model components Understand the internal mechanisms of neural networks by **performing causal interventions** on specific model components
#### MechIR #### MechIR [@parry_mechir_2025]
- Encoder-only models - Encoder-only models
- For Information Retrieval models - For Information Retrieval models
...@@ -95,18 +93,31 @@ Understand the internal mechanisms of neural networks by **performing causal int ...@@ -95,18 +93,31 @@ Understand the internal mechanisms of neural networks by **performing causal int
Let $Q \times D \subset \mathcal{Q}\times\mathcal{D}$ be a set of pairs of questions and documents Let $Q \times D \subset \mathcal{Q}\times\mathcal{D}$ be a set of pairs of questions and documents
Let $Q \times \tilde{D}$ the same set of pairs but with perturbed documents Let $Q \times \tilde{D}$ the same set of pairs but with perturbed documents
:::{.incremental}
1. Forward pass all $Q\times D$ 1. Forward pass all $Q\times D$
- record $o_{i,j}^e$ the output of each component $n_{i,j}, \forall e \in Q\times D$ - record $o_{i,j}^e$ the output of each component $n_{i,j}, \forall e \in Q\times D$
- record $p_D$ the performance of the model - record $p_D$ the performance of the model
2. Forward pass all $Q\times \tilde{D}$ 2. Forward pass all $Q\times \tilde{D}$
- record $o_{i,j}^\tilde{e}$ the output of each component $n_{i,j}, \forall \tilde{e} \in Q\times \tilde{D}$ - record $o_{i,j}^\tilde{e}$ the output of each component $n_{i,j}, \forall \tilde{e} \in Q\times \tilde{D}$
- record $p_\tilde{D}$ the performance of the model - record $p_\tilde{D}$ the performance of the model
3. Rewrite $D, e, \tilde{D} \text{ and } \tilde{e}$ as 3. Rewrite $D, e, \tilde{D} \text{ and } \tilde{e}$ as
- $\hat{D}, \hat{e}, \check{D} \text{ and } \check{e}$ if $p_D > p_\tilde{D}$ - $\hat{D}, \hat{e}, \check{D} \text{ and } \check{e}$ if $p_D > p_\tilde{D}$
- $\check{D}, \check{e}, \hat{D} \text{ and } \hat{e}$ otherwise - $\check{D}, \check{e}, \hat{D} \text{ and } \hat{e}$ otherwise
:::
### Activation Patching [@chen_axiomatic_2024] {.smaller}
:::{.incremental}
3. Rewrite $D, e, \tilde{D} \text{ and } \tilde{e}$ as
- $\hat{D}, \hat{e}, \check{D} \text{ and } \check{e}$ if $p_D > p_\tilde{D}$
- $\check{D}, \check{e}, \hat{D} \text{ and } \hat{e}$ otherwise
4. For each component $n_{i,j}$ forward pass $Q\times\check{D}$ but replace $o_{i,j}^{\check{e}}$ by $o_{i,j}^{\hat{e}}$ for each $\check{e}$. Record the performance $\bar{p}$ 4. For each component $n_{i,j}$ forward pass $Q\times\check{D}$ but replace $o_{i,j}^{\check{e}}$ by $o_{i,j}^{\hat{e}}$ for each $\check{e}$. Record the performance $\bar{p}$
5. $P = \frac{\bar{p} - p_\hat{D} }{\p_\check{D} - p_\hat{D}}$ gives the impact of the perturbation on the model performance 5. $P = \frac{\bar{p} - p_\hat{D} }{p_\check{D} - p_\hat{D}}$ gives the impact of the perturbation on the model performance
:::
### Animation de l'execution de Activation patching ### Animation de l'execution de Activation patching
...@@ -141,21 +152,8 @@ def perturbation(doc): ...@@ -141,21 +152,8 @@ def perturbation(doc):
### Perspective : Enhance a model with MechIR ### Perspective : Enhance a model with MechIR
### References
::: {#refs}
:::
---
---
# Brouillon
- Mechir
- but et concept : cartographier les sensibilités des modèles encoder-based
- Activation Patching [Chen et al,. 2024]
- Étapes
- recul sur le résultat obtenu
- Perturbation
- Definition
- approche de création par étude du vocabulaire important et utilisation des mots poly-sémantiques
- 3 types de perturbation (append, prepend, replace) -> préférer replace
- identifier une perturbation pertinente
- Améliorer le modèle
- Quelle modification effectuer?
-
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment