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%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2024-03-11 11:47:33 +01:00
data/langs initial 2024-02-20 09:14:33 +01:00
R Create README.md 2024-02-23 16:28:06 +01:00
.gitignore Initial commit 2024-02-16 12:06:34 +01:00
Cloze.ipynb debugged 2024-02-20 11:06:00 +01:00
llamawrapper.py Update llamawrapper.py 2024-03-11 11:47:33 +01:00
plot_grid.sh Update plot_grid.sh 2024-02-21 20:48:30 +01:00
README.md Update README.md 2024-03-08 14:24:52 +01:00
requirements.txt debugged 2024-02-20 11:06:00 +01:00
Translation.ipynb debugged 2024-02-20 11:06:00 +01:00
utils.py initial 2024-02-20 09:14:33 +01:00

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}
}