mirror of
https://github.com/epfl-dlab/llm-latent-language.git
synced 2026-12-04 08:28:46 +00:00
Read-only mirror of https://github.com/epfl-dlab/llm-latent-language — EPFL Data Science & AI Lab (dlab). Issues & pull requests at the source.
- Jupyter Notebook 82%
- R 9.3%
- Python 8.4%
- Shell 0.3%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| data/langs | ||
| R | ||
| .gitignore | ||
| Cloze.ipynb | ||
| llamawrapper.py | ||
| plot_grid.sh | ||
| README.md | ||
| requirements.txt | ||
| Translation.ipynb | ||
| utils.py | ||
Logit lens plot colab
Try out your own prompts here.
Installation
Set up a python environment and run
pip install -r requirements.txt
Usage
Translation
papermill Translation.ipynb out.ipynb -p input_lang fr -p target_lang zh
Cloze
papermill Cloze.ipynb out.ipynb -p target_lang fr
Precomputed latents
For your convenience, we also provide some precomputed latents on huggingface. Here are some preliminary steering experiments using the precomputed latents.
Acknowledgements
Starting point of this repo was Nina Rimsky's Llama-2 wrapper.
Citation
@article{wendler2024llamas,
title={Do Llamas Work in English? On the Latent Language of Multilingual Transformers},
author={Wendler, Chris and Veselovsky, Veniamin and Monea, Giovanni and West, Robert},
journal={arXiv preprint arXiv:2402.10588},
year={2024}
}