To run, first load the environment from the environment.yml file with:
conda env create -f environment.yml
Then activate it:
conda activate assignment2
You may need to install the transformers library manually since we are using a forked version:
pip uninstall transformers
pip install -e transformers-dola-main
In order to run inferences for the various layer outputs on the model run:
python Evaluation_Layers.py
1) We would like for you to present and visualize the probabilities of each token in the vocabulary from early exit layers (premature vocabulary distribution layers) vs. mature layer (last layer – Layer 32).
2) If you recall the paper we reviews on consistency checking used several models, do you think we can use consistency check method between these layers for factuality analysis? Present your approach and results including discussion. Yes I believe consistency checking would be somewhat effective by looking at the different layers. Intuitively, if a token had a high probability in all observered layers, one could expect that that token is solid and not being hallucinated. The token would have "survived" so many layers, meaning that the model always had high confidence in it.
3) Write another discussion explaining the how the layers effect on the different metrics on your trained model from assignment 1.c.
Interestingly the model seems to improve slightly from Layer 8 to Layer 16, but then regess a bit in Layer 24. At the top layer, 32, it performs the best across all metrics. BERTScore shows the least amount ofchange from layer to layer, probably because it is a more robust to words that are similar. Rouge and CodeBLEU followed a pattern that I mentioned above more decidedly. At the final layer, CodeBLEU score was more than double the score of any of the other layers.
DOLA: https://github.com/voidism/DoLa
DOLA Transformers: https://github.com/voidism/transformers-dola/




